Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[elasticsearch-plugin] Better error output #1141

Closed
Izayda opened this issue Oct 10, 2021 · 3 comments
Closed

[elasticsearch-plugin] Better error output #1141

Izayda opened this issue Oct 10, 2021 · 3 comments

Comments

@Izayda
Copy link
Contributor

Izayda commented Oct 10, 2021

Is your feature request related to a problem? Please describe.
Now, if i have some error in elastic while request execution, i'll mostly get only search_phase_execution_exception. Elastic is terrible and very difficult in its configuration, so, some errors can occur due inappropriate configuration only on some specific installation of Vendure.

To get real error i need to do aт investigation each time.
For example:

  1. I get search_phase_execution_exception after adding to search query prices ranges.
  2. Then i look into Vendure source code to understand where there can be error. In current case, there is only one query to elastic, so, i have an idea that while aggregation elastic get too many buckets
  3. I deploy Vendure from source and change config to searchConfig: { priceRangeBucketInterval: 1, }, and than get similar error on default populated data
  4. Then i add
try {
    await this.client.search({
                index: indexPrefix + VARIANT_INDEX_NAME,
                body: elasticSearchBody,
    });
} catch (e) {
    console.dir(e, { depth: null });
}

to get real error Trying to create too many buckets. Must be less than or equal to: [65535] but was [641402]. This limit can be set by changing the [search.max_buckets] cluster level setting.

Describe the solution you'd like
I would like to get real elastic error in Vendure logs.

Describe alternatives you've considered
To configure elastic to log all errors (it's slowly and awful in configuration).

@Izayda Izayda changed the title Better error output in elasticsearch-plugin [elasticsearch-plugin] Better error output Oct 10, 2021
@Izayda
Copy link
Contributor Author

Izayda commented Oct 13, 2021

Hi! I'm not sure this issue should be closed, cause i fix error output only for reindexing.

@michaelbromley
Copy link
Member

I believe the errors during search were handled by this commit: d300f8b#diff-d10b5c5b32aa60b16131727742c8a9647664cbe926eb4fed17a0c15bf79c285bR199

@Izayda
Copy link
Contributor Author

Izayda commented Oct 13, 2021

Oh, sure, sorry. Didn't notice, that @Draykee fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants