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

[BUG] - Recipes not showing after upgrade #4294

Closed
5 of 6 tasks
rafaelmathieu opened this issue Sep 30, 2024 · 13 comments · Fixed by #4325
Closed
5 of 6 tasks

[BUG] - Recipes not showing after upgrade #4294

rafaelmathieu opened this issue Sep 30, 2024 · 13 comments · Fixed by #4325
Labels
bug: confirmed bug Something isn't working

Comments

@rafaelmathieu
Copy link

rafaelmathieu commented Sep 30, 2024

First Check

  • This is not a feature request.
  • I added a very descriptive title to this issue (title field is above this).
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Mealie documentation, with the integrated search.
  • I already read the docs and didn't find an answer.
  • This issue can be replicated on the demo site (https://demo.mealie.io/).

What is the issue you are experiencing?

I recently updated the nightly for the first time in a while. (Last time I updated it, open AI was not a thing)

After the update I cannot see or search for any recipes. I know they are there as I can access them via their direct URL and they are in the DB.

There seem to be an error showing in the logs when the main page is loaded. (URL/g/home)

Steps to Reproduce

I have not been able to reproduce the issue on the demo site.

Please provide relevant logs

ERROR 2024-09-30T12:51:15 - Exception in ASGI application
Traceback (most recent call last):
File "/opt/pysetup/.venv/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/opt/pysetup/.venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
return await self.app(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in call
await super().call(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/applications.py", line 123, in call
await self.middleware_stack(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in call
raise exc
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call
await self.app(scope, receive, _send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in call
await responder(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in call
await self.app(scope, receive, self.send_with_gzip)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 756, in call
await self.middleware_stack(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 776, in app
await route.handle(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
await self.app(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
raise exc
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
await app(scope, receive, sender)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/routing.py", line 72, in app
response = await func(request)
File "/app/mealie/routes/_base/routers.py", line 35, in custom_route_handler
response = await original_route_handler(request)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 301, in app
raw_response = await run_endpoint_function(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 214, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/opt/pysetup/.venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/app/mealie/routes/recipe/recipe_crud_routes.py", line 362, in get_all
pagination_response = self.group_recipes.by_user(self.user.id).page_all(
File "/app/mealie/repos/repository_recipes.py", line 222, in page_all
items = [RecipeSummary.model_validate(item) for item in data]
File "/app/mealie/repos/repository_recipes.py", line 222, in
items = [RecipeSummary.model_validate(item) for item in data]
File "/opt/pysetup/.venv/lib/python3.10/site-packages/pydantic/main.py", line 596, in model_validate
return cls.pydantic_validator.validate_python(
pydantic_core._pydantic_core.ValidationError: 1 validation error for RecipeSummary
household_id
UUID input should be a string, bytes or UUID object [type=uuid_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.9/v/uuid_type

Mealie Version

Docker Version: ghcr.io/mealie-recipes/mealie:nightly
Build Tag: 1bd3d38

Using OIDC

image

Deployment

Unraid

Additional Deployment Details

No response

@rafaelmathieu rafaelmathieu added bug Something isn't working triage labels Sep 30, 2024
@michael-genson
Copy link
Collaborator

Do you have logs from when you upgraded? Looks like something might have gone wrong with the migration. Can you provide a backup here from before the upgrade?

Also, if you could edit the title on the bug report

@rafaelmathieu rafaelmathieu changed the title [BUG] - YOUR DESCRIPTIVE TITLE GOES HERE [BUG] - Recipes not showing after upgrade Sep 30, 2024
@rafaelmathieu
Copy link
Author

Updated the title.

I do not have any upgrade logs anymore :(.

The only other log error I could find is this:

[ERROR|scheduler_service|L60] 2024-09-30T13:37:52: Error in scheduled task func='locked_user_reset': exception='group_id must be set'

I do a backup from april but this is kinda old.

@michael-genson
Copy link
Collaborator

If you could provide that, it may be helpful

@michael-genson
Copy link
Collaborator

Also, are you using sqlite or postgres?

@brandonjkessler
Copy link

brandonjkessler commented Oct 1, 2024

I'm having the same issue. The Shopping List feature is also not working

OS: UnRAID 6.12.13
Channel: ghcr.io/mealie-recipes/mealie:nightly
Build: fa32a6489c35d62eec976e24af14cd179d0bf279
DB engine: SQLite

Attached is my log output from UnRAID for that container

mealie_error.txt

@michael-genson
Copy link
Collaborator

Can you provide the logs from when you upgraded to nightly, and a copy of your backup from before you upgraded?

@brandonjkessler
Copy link

I don't have any upgrade logs, and my backup is from almost a year ago, but if that will be beneficial I can get you that. Thanks for the effort and sorry I don't have anything more substantial for you to work with.

@michael-genson
Copy link
Collaborator

That backup would be helpful if you're able to provide! Along with your actual db file if possible

@rafaelmathieu
Copy link
Author

@michael-genson I am using postgres.

is there a way to send you the backup directly as putting the backup with user data in the open is not great.

@michael-genson
Copy link
Collaborator

If you could DM it to me on Discord that will work. In case you're not on the Discord:
https://discord.gg/nvmfQyzn

@michael-genson
Copy link
Collaborator

After taking a look at the data, it looks like this is related to this: #3171 (and this: #3219)

Basically, if a recipe exists and its user_id doesn't match a real user, we can't find the recipe's household_id so we error out. The intermittent fix is to manually edit your data and make sure all recipes point to a valid user.

@rafaelmathieu
Copy link
Author

Thanks. was able to fix it via DB edit.

@michael-genson
Copy link
Collaborator

Glad to hear! I've got a PR open to fix this automatically in the future: #4325

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: confirmed bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants