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

Index already exists error #322

Open
jeremylynch opened this issue Feb 9, 2024 · 8 comments
Open

Index already exists error #322

jeremylynch opened this issue Feb 9, 2024 · 8 comments
Labels
enhancement New feature or request needs more info This issue needs a minimal complete and verifiable example

Comments

@jeremylynch
Copy link

jeremylynch commented Feb 9, 2024

We are frequently seeing this error in our tasks:

Error: {"message"=>"Index `Car_production` already exists.", "code"=>"index_already_exists", "type"=>"invalid_request", "link"=>"https://docs.meilisearch.com/errors#index_already_exists"}

We are not entirely sure why meilisearch rails is trying to recreate the index every 10-20 minutes?

Meilisearch 1.6.0, meilisearch rails 0.10.2

@ellnix
Copy link
Collaborator

ellnix commented Feb 11, 2024

... in our tasks:

Presumably this means background tasks? If possible please provide information on the task that is causing this, if you can narrow it down.

If not, I'll try to find the cause anyway.

@jeremylynch
Copy link
Author

We are actually not using background tasks to handle meilisearch indexing, just indexing straight to Meilisearch (using meilisearch-rails).

What additional details of the task would you like?

@ellnix
Copy link
Collaborator

ellnix commented Feb 13, 2024

Is this error appearing in your Rails logs or other logs?

meilisearch-rails does indeed not check with the server before attempting to create an index, so in many cases it tries to create an index that is already there, which normally just fails silently.

@curquiza curquiza added the needs more info This issue needs a minimal complete and verifiable example label Feb 13, 2024
@jeremylynch
Copy link
Author

This is occuring in the meilisearch tasks. If an indexation fails in this way, will a document potentially not get indexed?

Can these failing tasks be ignored?

@curquiza
Copy link
Member

Hello @jeremylynch
We have difficulties to exactly reproduce your issue, but we just released v0.12.0 of Meilisearch rails.
Does it help?

@jeremylynch
Copy link
Author

Will test and report back

@jeremylynch
Copy link
Author

Confirming we are still seeing the error on v0.12.0

Error: {"message"=>"Index `Page_production` already exists.", "code"=>"index_already_exists", "type"=>"invalid_request", "link"=>"https://docs.meilisearch.com/errors#index_already_exists"}

@ellnix
Copy link
Collaborator

ellnix commented Mar 6, 2024

This is occuring in the meilisearch tasks. If an indexation fails in this way, will a document potentially not get indexed?

Can these failing tasks be ignored?

If these errors are only on the meilisearch tasks on the instance, and you do not see them in your Rails logs, you can freely ignore them. They are just a side effect of how meilisearch-rails communicates with the server.

This is still polluting the tasks on the server so I will look into an alternative implementation.

@curquiza curquiza added the enhancement New feature or request label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs more info This issue needs a minimal complete and verifiable example
Projects
None yet
Development

No branches or pull requests

3 participants