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

nightly - Refreshing Timeline or going to the Timeline url directly causes a server error on postgres #2370

Closed
5 tasks done
jecorn opened this issue May 1, 2023 · 5 comments · Fixed by #2372
Closed
5 tasks done

Comments

@jecorn
Copy link
Contributor

jecorn commented May 1, 2023

First Check

  • This is not a feature request
  • I added a very descriptive title to this issue.
  • 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.

What is the issue you are experiencing?

@michael-genson
I love the new Timeline! But refreshing the Timeline page or going to http://<mealie-url>/group/timeline without clicking on the Timeline causes my Postgres production instance of mealie to experience a server error (reported by nuxt, error output to stdout linked below). And despite the title, this also happens with sqlite (just figured that out).

Clicking on the Timeline link/icon loads the timeline just fine and the Timeline can be navigated as intended. I can even click on a recipe in the Timeline, then go "Back" in the browser and the Timeline loads OK. But refreshing the Timeline once I'm on it, or directly entering the Timeline URL, or even copying the link behind the Timeline icon and then pasting it into the address bar gives the server error linked below.

servererror.log

This does not happen on an empty dev instance of mealie nightly, using either sqlite or postgres. Which means it's going to be a pain in the butt to debug.

Deployment

Docker (Linux)

Deployment Details

Postgres and sqlite backend

@michael-genson
Copy link
Collaborator

Thanks for this, I might have a fix, but I'm not too sure what the issue is. Either way, the logs are super helpful, so thank you!

@jecorn
Copy link
Contributor Author

jecorn commented May 1, 2023

Wow, incredibly fast debugging! Kudos!

@michael-genson
Copy link
Collaborator

Haha don't get too excited yet, I have no idea if this will fix it or not since I can't reproduce in dev, only in production

@hay-kot
Copy link
Collaborator

hay-kot commented May 5, 2023

@michael-genson I'm like 99% sure that #2372 is not the issue. $auth should be fine for SSR.

This is likely the culprit

https://github.com/hay-kot/mealie/blob/75698c531aaa057e1d35ae5bd4fb09ee8a11b47b/frontend/components/Domain/Recipe/RecipeTimeline.vue#L107-L124

You cannot directly access DOM api's fro the setup script and rely on SSR to work. You should be able to wrap it in a onMounted hook though and that should fix it.

For testing, you can use the make docker/prod to build a production like container, (or just copy the command if you're on windows).

This in the logs makes me pretty sure.

mealie-frontend  |  ERROR  document is not defined
mealie-frontend  | 
mealie-frontend  |   at setup (components/Domain/Recipe/RecipeTimeline.vue)

@michael-genson
Copy link
Collaborator

Ahhh okay, thanks! I'll go ahead and update #2372 (I like the small cleanup that provides anyway so I'll keep it there instead of making a new PR)

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

Successfully merging a pull request may close this issue.

3 participants