airy-creation- healthcheck not working. Please help

acetra19
PRO

5 months ago

Dear Railway Support Team,
I am writing to report persistent deployment issues with my Railway project "airy-creation". Specifically, my client service is consistently failing health checks, and the server service also experienced unusual startup problems.
Project Details:
Project Name: airy-creation
Client Service URL: https://client-production-dac9.up.railway.app
Server Service URL: https://eyzenhighcard-production.up.railway.app
Current Main Issue: Client Health Check Failure
My client service (a React build served with Nginx via Dockerfile) has been failing health checks for some time now.
The deploy logs consistently show: Attempt #X failed with service unavailable. Continuing to retry…
The health check is configured for path / and port 80 (which should be correct for the Nginx container).
What we've tried:
The Dockerfile build completes successfully.
We confirmed via ls -l in the Dockerfile that the build files (/usr/share/nginx/html) and the Nginx config file (/etc/nginx/conf.d/default.conf) exist in the container with correct permissions.
We confirmed via CMD ["nginx", "-t"] in the Dockerfile that the Nginx configuration is valid (test is successful).
We tested with a minimal Nginx configuration that only includes location / { return 200 "Healthy"; } – even with this, the health check fails.
We increased the health check's "Initial Delay" up to 30s without success.
The "Start command" in the Railway deploy settings for the client is empty, so the CMD from the Dockerfile should be used.
Since the health check fails even with a minimal, valid Nginx configuration, we suspect a platform-level issue with starting or monitoring the Nginx process in the client container.
Previous Issue: Server Startup / 502 Errors
Previously, the server service (Node.js/Express/Socket.IO) also had issues:
HTTP Logs consistently showed 502 Bad Gateway for all requests.
Deploy Logs showed the Node.js process starting correctly (Server running on port 3001) but being immediately stopped by Railway (Stopping Container), followed by unexpected Nginx startup logs.
What we've tried:
Changed CMD to ENTRYPOINT ["node", "dist/index.js"] in the server/Dockerfile.
Added a root route (/) for health checks in the Node.js code and set the Railway health check path to /.
Ensured the "Start command" in the Railway deploy settings for the server is empty.
Various CORS configurations in code and via RAILWAYSTATICHEADERS were tested unsuccessfully (the variable is currently removed; we rely on cors({ origin: '*' }) in the code). Checked environment variables (CLIENTURL, REACTAPPSERVER_URL).
It appears the server might be running more stably now after the ENTRYPOINT change and adding the / route (no immediate Stopping Container seen in the last check), but we couldn't fully verify due to the client issues. However, the fact that Railway previously tried to start Nginx for a Node.js service is concerning.
Request for Investigation:
Could you please investigate why the client service is failing health checks, even though the Nginx configuration test (nginx -t) is successful and even a minimal config fails the check? Is there an issue with how the Nginx process is started or monitored for this service?
Could you also please confirm if the server service is now starting correctly according to its Dockerfile's ENTRYPOINT and that no Nginx processes are being incorrectly involved?
Thank you for your help in resolving these frustrating issues.
Sincerely, Moonmaker

Solved

0 Replies

acetra19
PRO

5 months ago

N/A


acetra19
PRO

5 months ago

airy-creation


5 months ago

Hello,

I believe these docs pages will help you -


acetra19
PRO

5 months ago

Thank you, it appears they helped with the server but now I am running into another issue. I have absolutely no idea whats wrong. I think this should be easy to fix but I have been running around in circles for days now. ---- 'm experiencing a persistent "Application failed to respond" (502 Bad Gateway) error when trying to access my deployed Client service, even though the deployment logs and health checks indicate it's running correctly.
Project: airy-creation
Client Service URL: https://[client-production-dac9.up.railway.app](client-production-dac9.up.railway.app)
Server Service URL: https://eyzenhighcard-production.up.railway.app (This service appears to be running stably now).
Problem Details:
The Client service builds successfully using its Dockerfile.
The Client deploy logs clearly show the container starting, the $PORT variable being correctly substituted into the Nginx config (listen ${PORT};), and Nginx starting successfully.
The Railway Health Check for the Client service (Path: /) succeeds, indicating the container is responsive on the correct port initially.
Despite the successful start and health check, accessing the Client URL (https://[client-production-dac9.up.railway.app](client-production-dac9.up.railway.app)/) consistently results in a 502 "Application failed to respond" error.
I have configured the Nginx instance within the Client container to send its accesslog and errorlog to /dev/stdout and /dev/stderr respectively.
Crucially: When I attempt to access the Client URL and receive the 502 error, no corresponding access or error log entries appear in the Railway deploy logs for the client container. This strongly suggests that the incoming requests are not reaching the running Nginx process inside the container.
Request ID (from 502 page): [Your Request ID - e.g., x2gJvvydQN2btIKGFh0SSg_2823689937]
Could you please investigate the connectivity between the Railway edge proxy/load balancer and my running Client container (client-production-dac9.up.railway.app)? All evidence points towards the container running correctly but being unreachable by the proxy layer.
Thank you for your help.
Best regards


5 months ago

Please see the first docs page I linked


acetra19
PRO

5 months ago

I did. And I did all the troubleshooting as best as I could, but I am very uncertain now that the problem is on my side. Request ID -Qpyt7AERK2Pg5MRl098FQ_499424464 ----------------- Status Quo: Project: airy-creation
Client Service URL: https://client-production-dac9.up.railway.app
Evidence Summary:
Successful Build & Start: The client service builds successfully using its Dockerfile. The deploy logs show the container starting, correctly substituting the $PORT variable into the Nginx config (listen 0.0.0.0:${PORT};), and Nginx starting its worker processes without error.
Successful Health Check: The deploy logs explicitly show the Railway health check succeeding: [1/1] Healthcheck succeeded!. Furthermore, the Nginx access log (redirected to deploy logs) shows the GET / request from RailwayHealthCheck/1.0 receiving a 200 status code.
Running Container: The deploy logs show Nginx running, and there are no "Stopping Container" messages after the successful start and health check.
Persistent 502 Errors: Despite the above, accessing the public URL (https://client-production-dac9.up.railway.app/) consistently returns a 502 "Application failed to respond" error.
HTTP Logs Confirm Proxy Issue: The Railway HTTP Logs for the client service show these incoming GET / requests resulting in a 502 status after a significant response time (e.g., 10-18 seconds).
Requests Not Reaching Container: Crucially, when the 502 error occurs from a browser request, no corresponding access log entry appears in the Nginx access log within the deploy logs (only the successful health check request is logged).
Conclusion:
The evidence strongly indicates that my client container is running correctly, listening on the correct port ($PORT), binding to 0.0.0.0, and is internally reachable (as proven by the successful health check). However, the Railway edge proxy is receiving public requests but failing to connect to or get a timely response from the running container, resulting in the 502 error.
Could you please urgently investigate the proxy and network layer connecting to my Client service container? The problem appears to be occurring between the edge proxy and the healthy, running container.


5 months ago

Please read through the first docs page I linked.


acetra19
PRO

5 months ago

What specifically ? I did so twice and three LLMs as well.


5 months ago

likely the target port section


6royal
HOBBY

5 months ago

hello


6royal
HOBBY

5 months ago

for some time I've been trying to pay my railway credit but my card is rejected. I've tried with several cards but it still doesn't work, so I want to know if I can retrieve the data from my database hosted on railway.


6royal
HOBBY

5 months ago

hello


6royal
HOBBY

5 months ago

for some time I've been trying to pay my railway credit but my card is rejected. I've tried with several cards but it still doesn't work, so I want to know if I can retrieve the data from my database hosted on railway.


acetra19
PRO

5 months ago

you were right, LLMs were arrogant and wrong , now back to the CORS issue …fingers crossed.


5 months ago

nothing beats a human reading the docs themselves


acetra19
PRO

5 months ago

FIXXED IT…OMG ….if you could see me right now …so much trouble for such an easy fix.. I was about to jump man<:kekw:788259314607325204> ….thank you for the quick help!


acetra19
PRO

5 months ago

✅ Thread can be closed.


5 months ago

Glad you solved it!


5 months ago

!s


Status changed to Solved brody 5 months ago