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

Application Error after updating to latest Ryot version #713

Closed
amedcalf opened this issue Mar 24, 2024 · 17 comments · Fixed by #715 or #719
Closed

Application Error after updating to latest Ryot version #713

amedcalf opened this issue Mar 24, 2024 · 17 comments · Fixed by #715 or #719

Comments

@amedcalf
Copy link

Hi,

I just updated to the latest docker image of Ryot. Now when go to the Ryot login screen and enter my username and password after I press "Login" I get to a page that just says "Application Error" and has an empty pink box. Nothing else is shown

The developer tools show errors like:

POST http://192.168.1.187:8000/auth/login?redirectTo=%2Factions%3FredirectTo%3D%252F&_data=routes%2Fauth.login 500 (Internal Server Error)

I am not sure how to see any more detailed logs but if there's anything else helpful I can provide I would be glad to.
Thank you for any help.

@IgnisDa
Copy link
Owner

IgnisDa commented Mar 24, 2024

Can you show me the docker logs. The backend must've panicked.

@amedcalf
Copy link
Author

amedcalf commented Mar 24, 2024

Sure! I do see the word panicked in the docker logs. Here they are (I just changed the username and password in the below to my_usernme and my_password - but they were my correct login details)

ryot
date,stream,content
2024/03/24 15:55:19,stdout,[frontend] POST /auth/login?redirectTo=%2Factions%3FredirectTo%3D%252F&_data=routes%2Fauth.login 500 - - 14.465 ms

2024/03/24 15:55:19,stdout,[frontend] }

2024/03/24 15:55:19,stdout,[frontend]   }

2024/03/24 15:55:19,stdout,[frontend]     variables: { input: [Object] }

2024/03/24 15:55:19,stdout,"[frontend]       '}',
"
2024/03/24 15:55:19,stdout,[frontend]       '  }\n' +

2024/03/24 15:55:19,stdout,[frontend]       '    }\n' +

2024/03/24 15:55:19,stdout,[frontend]       '      apiKey\n' +

2024/03/24 15:55:19,stdout,[frontend]       '    ... on LoginResponse {\n' +

2024/03/24 15:55:19,stdout,[frontend]       '    }\n' +

2024/03/24 15:55:19,stdout,[frontend]       '      error\n' +

2024/03/24 15:55:19,stdout,[frontend]       '    ... on LoginError {\n' +

2024/03/24 15:55:19,stdout,[frontend]       '    __typename\n' +

2024/03/24 15:55:19,stdout,[frontend]       '  loginUser(input: $input) {\n' +

2024/03/24 15:55:19,stdout,[frontend]     query: 'mutation LoginUser($input: UserInput!) {\n' +

2024/03/24 15:55:19,stdout,[frontend]   request: {

2024/03/24 15:55:19,stdout,"[frontend]   },
"
2024/03/24 15:55:19,stdout,[frontend]     headers: Headers { [Symbol(map)]: [Object: null prototype] }

2024/03/24 15:55:19,stdout,"[frontend]     status: 500,
"
2024/03/24 15:55:19,stdout,"[frontend]     error: 'Service panicked',
"
2024/03/24 15:55:19,stdout,[frontend]   response: {

2024/03/24 15:55:19,stdout,[frontend]     at requestHandler (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:94:18) {

2024/03/24 15:55:19,stdout,[frontend]     at handleDataRequestRR (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:122:20)

2024/03/24 15:55:19,stdout,[frontend]     at Object.queryRoute (/home/ryot/node_modules/@remix-run/router/router.ts:3041:18)

2024/03/24 15:55:19,stdout,[frontend]     at queryImpl (/home/ryot/node_modules/@remix-run/router/router.ts:3091:22)

2024/03/24 15:55:19,stdout,[frontend]     at submit (/home/ryot/node_modules/@remix-run/router/router.ts:3156:16)

2024/03/24 15:55:19,stdout,[frontend]     at callLoaderOrAction (/home/ryot/node_modules/@remix-run/router/router.ts:4043:16)

2024/03/24 15:55:19,stdout,[frontend]     at Object.callRouteActionRR (/home/ryot/node_modules/@remix-run/server-runtime/dist/data.js:35:16)

2024/03/24 15:55:19,stdout,[frontend]     at action$1 (file:///home/ryot/build/server/index.js?t=1711269916000:13144:25)

2024/03/24 15:55:19,stdout,[frontend]     at processTicksAndRejections (node:internal/process/task_queues:95:5)

2024/03/24 15:55:19,stdout,[frontend]     at makeRequest (file:///home/ryot/node_modules/graphql-request/src/index.ts:426:11)

2024/03/24 15:55:19,stdout,"[frontend] ClientError: GraphQL Error (Code: 500): {\"response\":{\"error\":\"Service panicked\",\"status\":500,\"headers\":{}},\"request\":{\"query\":\"mutation LoginUser($input: UserInput!) {\n  loginUser(input: $input) {\n    __typename\n    ... on LoginError {\n      error\n    }\n    ... on LoginResponse {\n      apiKey\n    }\n  }\n}\",\"variables\":{\"input\":{\"password\":\"my_password\",\"username\":\"my_username\"}}}}
"
2024/03/24 15:55:19,stdout,"[backend] called `Result::unwrap()` on an `Err` value: Query(SqlxError(ColumnDecode { index: \"\\"preferences\\"\", source: Error(\"missing field `disable_navigation_animation`\", line: 1, column: 1132) }))
"
2024/03/24 15:55:19,stdout,[backend] thread 'tokio-runtime-worker' panicked at apps/backend/src/miscellaneous/resolver.rs:4934:14:

2024/03/24 15:55:10,stdout,[frontend] GET /auth/login?redirectTo=%2Factions?redirectTo=%252F 200 - - 29.430 ms

2024/03/24 15:55:10,stdout,[frontend] OPTIONS /auth/login?redirectTo=%2Factions?redirectTo=%252F 405 - - 10.385 ms

2024/03/24 15:55:10,stdout,[frontend] }

2024/03/24 15:55:10,stdout,[frontend]       at processTicksAndRejections (node:internal/process/task_queues:95:5)

2024/03/24 15:55:10,stdout,[frontend]       at /home/ryot/node_modules/@remix-run/express/dist/server.js:41:28

2024/03/24 15:55:10,stdout,[frontend]       at requestHandler (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:108:24)

2024/03/24 15:55:10,stdout,[frontend]       at handleDocumentRequestRR (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:184:35)

2024/03/24 15:55:10,stdout,[frontend]       at Object.query (/home/ryot/node_modules/@remix-run/router/router.ts:2940:19)

2024/03/24 15:55:10,stdout,[frontend]       at getInternalRouterError (/home/ryot/node_modules/@remix-run/router/router.ts:4519:5)

2024/03/24 15:55:10,stdout,[frontend]   error: Error: Invalid request method "OPTIONS"

2024/03/24 15:55:10,stdout,"[frontend]   data: 'Error: Invalid request method \"OPTIONS\"',
"
2024/03/24 15:55:10,stdout,"[frontend]   internal: true,
"
2024/03/24 15:55:10,stdout,"[frontend]   statusText: 'Method Not Allowed',
"
2024/03/24 15:55:10,stdout,"[frontend]   status: 405,
"
2024/03/24 15:55:10,stdout,[frontend] ErrorResponseImpl {

2024/03/24 15:55:10,stdout,[frontend]     at processTicksAndRejections (node:internal/process/task_queues:95:5)

2024/03/24 15:55:10,stdout,[frontend]     at /home/ryot/node_modules/@remix-run/express/dist/server.js:41:28

2024/03/24 15:55:10,stdout,[frontend]     at requestHandler (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:108:24)

2024/03/24 15:55:10,stdout,[frontend]     at handleDocumentRequestRR (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:184:35)

2024/03/24 15:55:10,stdout,[frontend]     at Object.query (/home/ryot/node_modules/@remix-run/router/router.ts:2940:19)

2024/03/24 15:55:10,stdout,[frontend]     at getInternalRouterError (/home/ryot/node_modules/@remix-run/router/router.ts:4519:5)

2024/03/24 15:55:10,stdout,[frontend] Error: Invalid request method "OPTIONS"

2024/03/24 15:55:10,stdout,[frontend] GET /actions?redirectTo=%2F 302 - - 6.014 ms

2024/03/24 15:55:10,stdout,[frontend] OPTIONS /actions?redirectTo=%2F 302 - - 6.872 ms

2024/03/24 15:55:10,stdout,[frontend] GET / 302 - - 8.419 ms

2024/03/24 15:55:10,stdout,[frontend] OPTIONS / 405 - - 21.557 ms

2024/03/24 15:55:10,stdout,[frontend] }

2024/03/24 15:55:10,stdout,[frontend]       at processTicksAndRejections (node:internal/process/task_queues:95:5)

2024/03/24 15:55:10,stdout,[frontend]       at /home/ryot/node_modules/@remix-run/express/dist/server.js:41:28

2024/03/24 15:55:10,stdout,[frontend]       at requestHandler (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:108:24)

2024/03/24 15:55:10,stdout,[frontend]       at handleDocumentRequestRR (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:184:35)

2024/03/24 15:55:10,stdout,[frontend]       at Object.query (/home/ryot/node_modules/@remix-run/router/router.ts:2940:19)

2024/03/24 15:55:10,stdout,[frontend]       at getInternalRouterError (/home/ryot/node_modules/@remix-run/router/router.ts:4519:5)

2024/03/24 15:55:10,stdout,[frontend]   error: Error: Invalid request method "OPTIONS"

2024/03/24 15:55:10,stdout,"[frontend]   data: 'Error: Invalid request method \"OPTIONS\"',
"
2024/03/24 15:55:10,stdout,"[frontend]   internal: true,
"
2024/03/24 15:55:10,stdout,"[frontend]   statusText: 'Method Not Allowed',
"
2024/03/24 15:55:10,stdout,"[frontend]   status: 405,
"
2024/03/24 15:55:10,stdout,[frontend] ErrorResponseImpl {

2024/03/24 15:55:10,stdout,[frontend]     at processTicksAndRejections (node:internal/process/task_queues:95:5)

2024/03/24 15:55:10,stdout,[frontend]     at /home/ryot/node_modules/@remix-run/express/dist/server.js:41:28

2024/03/24 15:55:10,stdout,[frontend]     at requestHandler (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:108:24)

2024/03/24 15:55:10,stdout,[frontend]     at handleDocumentRequestRR (/home/ryot/node_modules/@remix-run/server-runtime/dist/server.js:184:35)

2024/03/24 15:55:10,stdout,[frontend]     at Object.query (/home/ryot/node_modules/@remix-run/router/router.ts:2940:19)

2024/03/24 15:55:10,stdout,[frontend]     at getInternalRouterError (/home/ryot/node_modules/@remix-run/router/router.ts:4519:5)

2024/03/24 15:55:10,stdout,[frontend] Error: Invalid request method "OPTIONS"

@IgnisDa
Copy link
Owner

IgnisDa commented Mar 24, 2024

Can you email me a dump of your database? The email I'd is in my profile.

@amedcalf
Copy link
Author

Sure! I have sent a dump just now. Thank you for taking a look, much appreciated.

@IgnisDa
Copy link
Owner

IgnisDa commented Mar 25, 2024

@amedcalf This should be fixed once you upgrade to the latest version.

I noticed that you use Ryot exclusively for fitness tracking; how is that working out (pun intended) for you? Are there any features you would like to see?

@amedcalf
Copy link
Author

Thanks so much @IgnisDa for doing the change so quickly!

I upgraded to the new version but unfortunately now when I press the Login button I just get returned to the initial login screen again each time.

I think it may be cookie related - I get this message in developer tools:

This attempt to set a cookie via a Set-Cookie header was blacked because it had the "Secure" attribute but was not receiveed over a secure connection in developer tools

It is the same error message as I had as part of a previous issue at #612 that was fixed so I wonder if something to do with me using http only.

@IgnisDa
Copy link
Owner

IgnisDa commented Mar 25, 2024

Yes, i did make changes in how cookies are set. I'll take a look.

@IgnisDa IgnisDa reopened this Mar 25, 2024
@TheBig-O
Copy link

I'm having the exact same issues. Nothing I do gets me past the login screen. The log shows the login attempt and no errors. Not sure what is going on, but hoping you can figure out a solution quickly.
Thanks for the great work and application.

@IgnisDa IgnisDa mentioned this issue Mar 26, 2024
@IgnisDa
Copy link
Owner

IgnisDa commented Mar 26, 2024

Set env variable FRONTEND_INSECURE_COOKIES=true.

@TheBig-O
Copy link

Still can't log in. I added the environment variable and now I'm getting an application error again. It looks like it is starting up but throws a panic and a DB connection error. I have not changed the db at all.
The log file shows this:

[backend] 2024-03-27T01:39:09.900403Z  INFO ryot: Running version: 4.3.7
[proxy] {"level":"info","ts":1711503549.9767125,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
[proxy] {"level":"warn","ts":1711503549.9788682,"logger":"admin","msg":"admin endpoint disabled"}
[proxy] {"level":"warn","ts":1711503549.9794967,"logger":"http.auto_https","msg":"automatic HTTPS is completely disabled for server","server_name":"srv0"}
[proxy] {"level":"info","ts":1711503549.982601,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc0002c1b80"}
[proxy] {"level":"info","ts":1711503549.9849596,"logger":"tls","msg":"cleaning storage unit","description":"FileStorage:/home/ryot/.local/share/caddy"}
[proxy] {"level":"info","ts":1711503549.9850252,"logger":"tls","msg":"finished cleaning storage units"}
[proxy] {"level":"info","ts":1711503549.9861813,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
[proxy] {"level":"info","ts":1711503549.986382,"msg":"autosaved config (load with --resume flag)","file":"/home/ryot/.config/caddy/autosave.json"}
[proxy] {"level":"info","ts":1711503549.986404,"msg":"serving initial configuration"}
[frontend] [remix-serve] http://localhost:3000 (http://172.18.80.3:3000)
[backend] thread 'main' panicked at apps/backend/src/main.rs:131:10:
[backend] Database connection failed: Conn(SqlxError(PoolTimedOut))
[backend] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[backend] BACKEND_PORT=5000 /usr/local/bin/ryot exited with code 101
--> Sending SIGTERM to other processes..
node:events:492
      throw er; // Unhandled 'error' event
      ^
Error: spawn ps ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
�
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn ps',
  path: 'ps',
  spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 14 ]
}
Node.js v20.10.0

@IgnisDa
Copy link
Owner

IgnisDa commented Mar 27, 2024

Looks like the connection is timing out. Stop all containers and start them up again. If that doesn't fix it, please share your docker compose.

@amedcalf
Copy link
Author

Thank you @IgnisDa - latest version + setting the environment variable has fixed my problem. Thank you.

To your question from an earlier comment, yes indeed, I'm using your app purely for fitness tracking, and it's working very well! My favourite of other apps I've tried for sure and I appreciate how responsive and helpful you are.

Regarding new features - to be honest it already does the basics of what I want well! So my suggestions would mostly be UI-focused, and probably quite specific to exactly how I use it - for instance I work with a trainer who gives me specific exercises so I use the custom exercise feature more than the built-in list of exercises so I don't know if you would be interested. But if it helps to know what I've been thinking:

  • I use custom exercises a lot. But sometimes I mistype or click the wrong info or want to add some new notes. For instance I'd like to update the instructions when my trainer advises me to change something. I don't think there's a way to edit, update or delete exercises in the UI after you initially set them up? So that could be useful, as right now I'd have to manually go into the database to edit the record if I want to make changes.

  • I put my exercises in collections but I don't upload photographs. The way they are displayed in the collections screen means they show up as large grey boxes and oftentimes the title is cut off. For me it'd be more helpful to have them in a list format, listing their names, rather than as tiles. Perhaps a table that shows also their reps, last tracked date, etc. Although I totally see why other people would like the tiles, esp if the same screen is for media collections.

  • I almost always want to filter to the same collection when adding an exercise. It'd be nice if it remembered my filter and sort settings each time I went to add an exercise.

  • Sometimes when a workout is in progress I end up clicking through to the collections screen. It'd be nice if I could add an exercise to current workout from there too. Although not essential because the search when you add an exercise already lets me filter to collection so this might just be user error.

  • Perhaps some new custom attributes I can store the reps etc. my trainer recommends even if I actually do a different number? But I could also use current instructions field for that and maybe it'd be complicated.

Then a couple that are less interesting to me but a couple of other ideas:

  • Perhaps it could be nice to have the workouts show up in the calendar screen. So you could see when and how many times you worked out.

  • Perhaps tags could be added to workouts. In other software I used to tag workouts as being either at home or in the gym or wherever. Now though I can just put that in the title of the workout in Ryot and it's fine.

But overall, what you already created is great, and I enjoy using it a lot!

@IgnisDa
Copy link
Owner

IgnisDa commented Mar 27, 2024

Thank you, these are really useful!

  1. Yes, I plan to add edit views. This is something I need too.

  2. I attempted a table view for the list pages of the media pages, back when fitness tracking did not exist in Ryot. It did not look good so i removed it. Adding a table view for collections sounds like a good idea. I will take a look. Note to self: DO NOT ATTEMPT THIS BEFORE [FEATURE REQUEST] - Share public link to database and reviews #373.

  3. This was how it worked before v4, but I removed it since I did not have any idea on how to implement it with Remix. I have an idea now on how to do it. I suggest you follow [FEATURE REQUEST] - Make filters and sorting persistent again #545 for updates.

  4. Note to self: look into viability once 2) is implemented.

  5. [FEATURE REQUEST] - Item Tags and Custom Fields #578 might be interesting to you.

  6. I will keep this in mind. Right now the calendar view is pretty much useless if you use Ryot for fitness tracking only.

  7. Do you think 5) will be the same? I have this requirement too but I store them in the "Add note" button for the exercise since that places the note closer to the set i performed.

@TheBig-O
Copy link

Looks like the connection is timing out. Stop all containers and start them up again. If that doesn't fix it, please share your docker compose.

It took several stops and starts to get things up and running, but it seems like we're back on track. I have it up and everything seems to be working as expected. Thanks for helping me sort this out.

@amedcalf
Copy link
Author

amedcalf commented Apr 6, 2024

Thanks @IgnisDa for your reply above. I'm excited to see all the directions your project is going. It just gets better and better! thank you.

I think the difference between my 5 and 7 was that 5 is about tagging exercises (so for instance they'd show up when you look at the details of the exercise) and 7 is about tagging workouts so would show up when looking at the details of an individual workout.

I hadn't used the "add note" button yet - thanks for bringing it to my attention.

@IgnisDa