karlomikus / bar-assistant

Bar assistant is a all-in-one solution for managing your home bar
https://barassistant.app
MIT License
442 stars 22 forks source link

Cannot create menu #278

Closed proffalken closed 2 months ago

proffalken commented 2 months ago

Describe the bug When trying to create a menu, I cannot add cocktails to a section and I get an error:

image image

There are no entries in the logs for any errors to help understand what might be causing this

To Reproduce Fresh install running on kubernetes (k3s) - config at https://gist.github.com/proffalken/574ba5f3088b0325e1308c96a6b1b2ff

Sign up, create a new bar, add basic ingredients and cocktails, try to create a menu

Versions:

Additional context, log outputs...

Any help available on getting the app into debug mode so I can troubleshoot and share my learnings would be great!

karlomikus commented 2 months ago

Error logs are printed to stdout, so it should be somewhere in docker container logs.

I think this happens because you don't have any cocktails in a category, try adding some and than saving.

proffalken commented 2 months ago

Error logs are printed to stdout, so it should be somewhere in docker container logs.

OK, thanks, I'll see what I can find, but there doesn't seem to be anything obvious there at the moment:

image

I think this happens because you don't have any cocktails in a category, try adding some and than saving.

That's part of the problem, when I click on Add cocktail in the "Add menu category" box, I just get a blank screen so can't add them.

Should I be adding them somewhere else in the UI instead?

proffalken commented 2 months ago

OK, this looks like a config thing - if I run npm run dev from the salt-rim source then it works.

I'm comparing the environments to find out where I'm going wrong, but this is a setup issue, not a code issue, so I'll close this.

proffalken commented 2 months ago

I managed to solve the issue that was causing the above error, however I'm now getting a server 400 error in Meilesearch:

2024-04-30T19:33:07.942455Z  WARN HTTP request{method=POST host="msearch.wallace.network" route=/multi-search query_parameters= user_agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 status_code=400 error=Inside `.queries[0]`: Attribute `bar_id` is not filterable. This index does not have configured filterable attributes.
1:7 bar_id = 1}: tracing_actix_web::middleware: Error encountered while processing the incoming HTTP request: ResponseError { code: 400, message: "Inside `.queries[0]`: Attribute `bar_id` is not filterable. This index does not have configured filterable attributes.\n1:7 bar_id = 1", error_code: "invalid_search_filter", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#invalid_search_filter" }

That's running Meilesaerch 1.7, but if I switch it back to 1.6 then I just get:

[2024-04-30T19:35:41Z INFO  actix_web::middleware::logger] 10.42.0.6 "POST /multi-search HTTP/1.1" 400 271 "https://drinks.wallace.network/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" 0.081604
[2024-04-30T19:36:02Z INFO  actix_web::middleware::logger] 10.42.0.6 "POST /multi-search HTTP/1.1" 400 271 "https://drinks.wallace.network/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" 0.002418

Any idea how I track this down or what might be causing it?

karlomikus commented 2 months ago

Seems like your meilisearch <- -> salt-rim configuration is not correct. I have no experience with kubernetes, but saltrim needs to be able to access meilisearch. So if you can access meilisearch api from your browser, salt rim should work.

Looking at the logs, seems like bar-assistant server can access meilisearch so that part looks fine.

proffalken commented 2 months ago

Ah, ok, thanks, I'll take a look at that.

I can access meilesearch in my browser, but I'll take another look at the developer console logs and network traffic to see what's going on.

proffalken commented 2 months ago

@karlomikus - I put meilesearch logging into DEBUG whilst running in production, the error thrown is because saltrim isn't providing an API key:

[2024-05-05T18:27:10Z DEBUG actix_web::middleware::logger] Error in response: 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'll move this over to the SaltRim Docs, but I can't see anything obvious either in that repo or the dockercompose repo that would set the appropriate environment variable?

proffalken commented 2 months ago

Now working, storage was storing API keys for a previous deployment of meilesearch. Deleting and recreating the entire stack (including meilesearch) and associated storage fixed it.