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

Instance unhealthy after v0.14.0: MeiliSearchApiError: The provided API key is invalid. #162

Closed
mmanjos opened this issue Jan 26, 2025 · 4 comments

Comments

@mmanjos
Copy link
Contributor

mmanjos commented Jan 26, 2025

I seem to be having some issues after upgrading to this morning's v0.14.0 release

I'm using the latest docker-compose.yml from main so the migration to meilisearch v1.11.3 was included:

(...)
    container_name: wanderer-search
    image: getmeili/meilisearch:v1.11.3
(...)

Basically, my docker-compose.yml is the same as main but with these modifications:

  • wanderer-web environment variable ORIGIN is set to the hostname
  • PUBLIC_DISABLE_SIGNUP set to true
  • MEILI_MASTER_KEY set to a persistent, secret value using cenv

here's how that looks:

x-common-env: &cenv                                                                                     
  MEILI_URL: http://search:7700
  MEILI_MASTER_KEY: secretvalue

After starting the new docker-compose stack, it looks like meilisearch starts up cleanly:

Image

After trying to load /trails I get this error in the logs:

wanderer-web     | MeiliSearchApiError: The provided API key is invalid.
wanderer-web     |     at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
wanderer-web     |     at Generator.next (<anonymous>)
wanderer-web     |     at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
wanderer-web     |     at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
wanderer-web     |   code: 'invalid_api_key',
wanderer-web     |   type: 'auth',
wanderer-web     |   link: 'https://docs.meilisearch.com/errors#invalid_api_key',
wanderer-web     |   httpStatus: 403
wanderer-web     | }
@mmanjos mmanjos changed the title Instance unhealthy after v0.14.0 Instance unhealthy after v0.14.0: MeiliSearchApiError: The provided API key is invalid. Jan 26, 2025
@mmanjos
Copy link
Contributor Author

mmanjos commented Jan 26, 2025

(and this secretvalue did not change between versions - I keep that persistent in my environment)

@mmanjos
Copy link
Contributor Author

mmanjos commented Jan 26, 2025

hmm, it seems like I get that error if I try to access wanderer through my nginx reverse proxy (SSL)

if I go directly to the web container (tcp/3000) I get this error in the logs instead:

wanderer-web     | MeiliSearchApiError: Attribute `distance` is not filterable. This index does not have configured filterable attributes.
wanderer-web     | 1:9 distance >= 0 AND elevation_gain >= 0 AND elevation_loss >= 0 AND difficulty IN [easy,moderate,difficult] AND ((public = true OR author = undefined) OR shares = undefined)
wanderer-web     |     at /app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:378:19
wanderer-web     |     at Generator.next (<anonymous>)
wanderer-web     |     at fulfilled (/app/node_modules/meilisearch/dist/bundles/meilisearch.cjs.js:298:58)
wanderer-web     |     at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
wanderer-web     |   code: 'invalid_search_filter',
wanderer-web     |   type: 'invalid_request',
wanderer-web     |   link: 'https://docs.meilisearch.com/errors#invalid_search_filter',
wanderer-web     |   httpStatus: 400
wanderer-web     | }

@Flomp
Copy link
Owner

Flomp commented Jan 26, 2025

This is likely due to a change that makes lists searchable. This required me to update the meilisearch tokens for every user. This migration should have made sure that all tokens are automatically updated.
Ah, but maybe you need to logout and login to invalidate your token. Could you try that please?

@mmanjos
Copy link
Contributor Author

mmanjos commented Jan 26, 2025

Very strange - I tried logging out and logging back in, but it didn't solve the problem.

I tried restoring a backup of all the volumes from before I upgraded, then started the stack again and this time it seems like the migration(s) worked fine and the instance is healthy again. Very weird - if I find anything in the logs about the first upgrade I'll post here, but for now it seems like it's working again ¯_(ツ)_/¯

@Flomp Flomp closed this as completed Feb 1, 2025
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