Internal Server Error 500

houdiniss
HOBBY

5 months ago

Backend is working well after deployment

After about 1-2 days later, when I try to visit the site, I get those errors:

1) console log:
Failed to load resource: the server responded with a status of 500

Syntax Error: "undefined" is not valid JSON

2) Deploy logs:
Starting Container

Jan 18 08:56:14

Portfolio-backend

npm warn config production Use --omit=dev instead.

Jan 18 08:56:14

Portfolio-backend

> server@1.0.0 start

Jan 18 08:56:14

Portfolio-backend

> node server.js

Jan 18 08:56:14

Portfolio-backend

Server started successfully

Jan 18 08:56:14

Portfolio-backend

Connected to the MySQL database.

Jan 18 08:56:19

Portfolio-backend

Stopping Container

Jan 18 08:56:20

Portfolio-backend

npm error path /app

Jan 18 08:56:20

Portfolio-backend

npm error command failed

Jan 18 08:56:20

Portfolio-backend

npm error signal SIGTERM

Jan 18 08:56:20

Portfolio-backend

npm error command sh -c node server.js

Jan 18 08:56:20

Portfolio-backend

npm error A complete log of this run can be found in: /root/.npm/_logs/2025-01-17T07_41_02_480Z-debug-0.log

This is always happening between the hours of 6:00 - 10:00 AM GTM+2 .... I have no idea why this happens at this specific time.

When I redeploy the backend, everything works fine again and after 2 days it breaks again.

Awaiting User Response

3 Replies

5 months ago

Hello,

The logs -

Stopping Container
npm error path /app
npm error command failed
npm error signal SIGTERM
npm error command sh -c node server.js
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-01-17T07_41_02_480Z-debug-0.log

Are completely fine, that happens when your old deploy is shut down so your new deployment can come online.


Status changed to Awaiting User Response railway[bot] 5 months ago


houdiniss
HOBBY

5 months ago

I made a new instance of the container, re-configured the backend and deployed it.

Was working well for 30 hours straight until 1 hour ago that I tried to access to site and got the 500 internal server error again.

These are the http logs :

requestId:

"YSGXenGuS1e-8ekfosSl0g_2207837401"

timestamp:

"2025-01-20T07:42:32.048254092Z"

method:

"GET"

path:

"/dbData"

host:

"backend-production-2ff0.up.railway.app"

httpStatus:

500

upstreamProto:

"HTTP/1.1"

downstreamProto:

"HTTP/2.0"

responseDetails:

""

totalDuration:

153

upstreamAddress:

"http://[fd12:18ad:aeff:0:2000:20:5c10:1cad]:8080"

clientUa:

"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36"

upstreamRqDuration:

153

txBytes:

35

rxBytes:

675

srcIp:

"91.140.27.197"

edgeRegion:

"europe-west4"

The only way I can temporary fix this is by re-deploying or restarting and then no 500-ish error anymore...But I can't do this every day .


Status changed to Awaiting Railway Response railway[bot] 5 months ago


5 months ago

Hello,

A 500 error is returned by your code, there's no circumstance where we would send 500.

Meaning this is an application level issue.

Please look at your logs for errors, and if there aren't errors, please handle your error and implement more robust logging so that you can track down the issue.

Best,
Brody


Status changed to Awaiting User Response railway[bot] 5 months ago


Internal Server Error 500 - Railway Help Station