8 months ago
project id: ee5f48cd-ecf0-40ae-a417-8f8072a5dcd5
It runs with no errors locally. But in deployment, it gives errors.
I'm not sure what "path /app" means. I set the root directory to "/server", which has nothing to do with app folder for the front-end.
And how can I find the log file? I tried to use railway CLI and run$railway run cat /root/.npm/_logs/2024-09-01T22_01_25_321Z-debug-0.log
but it says no such file or directory.
0 Replies
8 months ago
I'm getting the same type of errors and can't seem to access the log file. I'm losing it. Why aren't all logs available at Logs in the dashboard?
8 months ago
the command railway run
runs the given command locally, not on your deployment, you would not be able to access that log file, and you also don't need to, as it wouldn't tell you anything useful anyway.
at what point in your deployment lifecycle are you seeing this error?
The build stage was fine, only in the deployment stage.
btw I try to use curl to make a GET request, it returns with an error 502 Application failed to respond. It was fine when running locally too.
8 months ago
that means your app did not respond.
are you sure you have the domain pointing to the correct port?
Actually I just added a log to my db.ts file, and it seems like a DB issue (pic1)..
But at the DB, although there are some red marks (pic2), it says "database system is ready to accept connections" eventually so I guess it's fine?
8 months ago
you have PGHOST="${{RAILWAY_PRIVATE_DOMAIN}}"
but it needs to be PGHOST="${{meticulous-empathy.RAILWAY_PRIVATE_DOMAIN}}"
I used to manually paste all those values from my DB variables, so it might be because I accidentlly changed it… I now changed them all to the format above. The DB issue is gone, but the old problem is still persistent..
wait but the curl works fine now, the whole app works now as well <:HAHAHA:786868887441375243>
8 months ago
what's your start script?
"scripts": { "test": "jest", "start": "node dist/server.js", "build": "tsc" },
I run npm run build, then npm run start
8 months ago
set the start command in the railway service settings to the start script command
8 months ago
no, just the actual command
Ahh the error is gone!! Thank you so much Brody!! I spent almost a day on this alone, but you just pointed the errors out within minutes, you are amazing!!!
8 months ago
thank you, happy to help