karlomikus / vue-salt-rim

Salt Rim is a Vue based web client used for connecting to Bar Assistant server instance.
https://barassistant.app
MIT License
101 stars 17 forks source link

Salt-Rim MultiSearch broken after Meilisearch v1.11.3 upgrade. #261

Closed reefland closed 4 days ago

reefland commented 4 days ago

As a followup to #253 about Meilisearch v1.11.x - Breaking Changes, seems multi-search broke for me. I upgraded the same way I have done before, bring down all containers, delete all files on the Meilisearch volume, and bring up the containers.

Meilisearch shows a master key has been set:

A master key has been set. Requests to Meilisearch won't be authorized unless you provide an authentication key.

I make sure Bar Assistant connects:

Setting up Meilisearch client keys...
Clearing existing search tokens from bars...
Updating ENV...
Meilisearch setup done!
Settings for the [cocktails] index synced successfully.
Settings for the [ingredients] index synced successfully.
INFO Configuration cached successfully.
INFO Routes cached successfully.
INFO Events cached successfully.
Syncing search index...
[2024-11-19 17:17:33] production.INFO: Building search indexes
[2024-11-19 17:17:35] production.INFO: Search indexes updated
Pruning tokens with expired expires_at timestamps ............. 31.38ms DONE

Confirm the Meilisearch volume gets repopulated:

/meili_data/data.ms $ ls -R 
.:
VERSION       auth          indexes       tasks         update_files

./auth:
data.mdb  lock.mdb

./indexes:
23a9fafe-6783-4de8-be31-895bdef52dbe  7b2d7031-60df-4acc-8bab-fe616c5fda48

./indexes/23a9fafe-6783-4de8-be31-895bdef52dbe:
data.mdb  lock.mdb

./indexes/7b2d7031-60df-4acc-8bab-fe616c5fda48:
data.mdb  lock.mdb

./tasks:
data.mdb  lock.mdb

./update_files:

/meili_data/data.ms $ 

Within Salt-Rim, upon clicking [Add Ingredient] I get a dialog box I can't use: image

Meilisearch logs show 403 The provided API key is invalid:

2024-11-19T16:38:58.741633Z WARN HTTP request{method=POST host="bar.[REDACTED]" route=/multi-search query_parameters= user_agent=Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0 status_code=403 error=The provided API key is invalid.}: tracing_actix_web::middleware: Error encountered while processing the incoming HTTP request: ResponseError { code: 403, message: "The provided API key is invalid.", error_code: "invalid_api_key", error_type: "auth", error_link: "https://docs.meilisearch.com/errors#invalid_api_key" }

I verified the KEY is set and the same in each container:

From Meilisearch (both set to same value):

$ echo $MEILI_MASTER_KEY
Uk2EipeE9YI6cfrEmOQ3QaiYqfATdOI1Gl4

$ echo $MEILISEARCH_KEY
Uk2EipeE9YI6cfrEmOQ3QaiYqfATdOI1Gl4

From Bar Assistant:

$ echo $MEILISEARCH_KEY
Uk2EipeE9YI6cfrEmOQ3QaiYqfATdOI1Gl4

From Salt-Rim:

$ echo $MEILISEARCH_KEY
Uk2EipeE9YI6cfrEmOQ3QaiYqfATdOI1Gl4

As Salt-Rim itself doesn't seem to do any logging, not sure how to troubleshoot this.

karlomikus commented 4 days ago

Hi, you should try logging out, login back in and reselect the bar, this should update search token for the specific bar if it's out of sync for some reason.

reefland commented 4 days ago

I did try a log out/in but did not try reselect bar. That combination did the trick thank you for the prompt response.