8 months ago
I'm trying to deploy an application. The services are all online and seem to be working. However, when I go to open the browser interface, it shows me a railway error, but I don't see any errors in the logs to help identify what is the cause.
here is the error that shows on the web interface:
Application failed to respond
This error appears to be caused by the application.
If this is your project, check out your deploy logs to see what went wrong. Refer to our docs on Fixing Common Errors for help, or reach out over our Help Station.
If you are a visitor, please contact the application owner or try again later.
Request ID:
NdSpk9YDR_SR49LOn6XIxQ
14 Replies
8 months ago
Hi,
It looks like your app isn’t responding, which usually means it’s not listening on the correct port or not bound to 0.0.0.0 .
Please make sure your app uses the PORT environment variable from Railway like this:
port = int(os.environ.get("PORT", 8000))
uvicorn.run(app, host="0.0.0.0", port=port)
Also, double-check your start command in Railway settings, and watch the logs right after a redeploy for any silent failures.
8 months ago
railway proxy is unable to reach your application. can you describe your application a bit ?
8 months ago
I think you're right that it is a proxy issue. I am trying to deploy this app. https://github.com/kortix-ai/suna it has a front-end, a back-end, and a worker service as well as a RabbitMQ template from railway. I've set a public URL for the back-end and then a public URL for the front-end, and the back-end seems to be working okay in my curl request. But front-end continues to do a 502 error. Previously, I was not receiving any logs, but I just saw these logs come in when I updated the ports for the frontend from 8080 to 3000. The 502 error persists. Thank you for your help.
2025-07-10T14:30:32.989530Z [info ] Request started: GET / from 100.64.0.5 | Query: client_ip=100.64.0.5 filename=api.py func_name=log_requests_middleware lineno=115 method=GET path=/ query_params= request_id=af0cb15b-d968-46cd-9e96-89115e072000
2025-07-10T14:30:32.989981Z [debug ] Request completed: GET / | Status: 404 | Time: 0.00s client_ip=100.64.0.5 filename=api.py func_name=log_requests_middleware lineno=120 method=GET path=/ query_params= request_id=af0cb15b-d968-46cd-9e96-89115e072000
2025-07-10T14:30:33.102112Z [info ] Request started: GET /favicon.ico from 100.64.0.5 | Query: client_ip=100.64.0.5 filename=api.py func_name=log_requests_middleware lineno=115 method=GET path=/favicon.ico query_params= request_id=31f99be2-9435-4961-aa9d-905a8e00c720
2025-07-10T14:30:33.103037Z [debug ] Request completed: GET /favicon.ico | Status: 404 | Time: 0.00s client_ip=100.64.0.5 filename=api.py func_name=log_requests_middleware lineno=120 method=GET path=/favicon.ico query_params= request_id=31f99be2-9435-4961-aa9d-905a8e00c720
2025-07-10T14:45:07.046119Z [info ] Request started: HEAD /api/health from 100.64.0.5 | Query: client_ip=100.64.0.5 filename=api.py func_name=log_requests_middleware lineno=115 method=HEAD path=/api/health query_params= request_id=c77dea73-aea5-4ec0-b9a2-e7cf230cdda8
2025-07-10T14:45:07.046636Z [debug ] Request completed: HEAD /api/health | Status: 405 | Time: 0.00s client_ip=100.64.0.5 filename=api.py func_name=log_requests_middleware lineno=120 method=HEAD path=/api/health query_params= request_id=c77dea73-aea5-4ec0-b9a2-e7cf230cdda8
2025-07-10T14:45:20.929240Z [info ] Request started: GET /api/health from 100.64.0.3 | Query: client_ip=100.64.0.3 filename=api.py func_name=log_requests_middleware lineno=115 method=GET path=/api/health query_params= request_id=c028cf30-009d-4fea-8f05-3dcd2714a58a
2025-07-10T14:45:20.929640Z [info ] Health check endpoint called client_ip=100.64.0.3 filename=api.py func_name=health_check lineno=182 method=GET path=/api/health query_params= request_id=c028cf30-009d-4fea-8f05-3dcd2714a58a
2025-07-10T14:45:20.929858Z [debug ] Request completed: GET /api/health | Status: 200 | Time: 0.00s client_ip=100.64.0.3 filename=api.py func_name=log_requests_middleware lineno=120 method=GET path=/api/health query_params= request_id=c028cf30-009d-4fea-8f05-3dcd2714a58a
smolpaw
railway proxy is unable to reach your application. can you describe your application a bit ?
8 months ago
@Please see my reply below.
brij123987
Hi,It looks like your app isn’t responding, which usually means it’s not listening on the correct port or not bound to 0.0.0.0 .Please make sure your app uses the PORT environment variable from Railway like this:port = int(os.environ.get("PORT", 8000))uvicorn.run(app, host="0.0.0.0", port=port)Also, double-check your start command in Railway settings, and watch the logs right after a redeploy for any silent failures.
8 months ago
@Please see my reply below.
ahimsafdn
@Please see my reply below.
8 months ago
Yes i am reviewing the code, thanks for providing the link to github repo
port 3000 was the correct port to be used for nextjs as that's what they use by default and that's what you have mentioned in your Dockerfile.
I will let you know when i have a possible solution.
8 months ago
Can you check your nextjs deploy logs and paste the entire logs here ?
It shouldn't be more than 10 lines if it's working correctly.
smolpaw
Can you check your nextjs deploy logs and paste the entire logs here ?It shouldn't be more than 10 lines if it's working correctly.
8 months ago
Thank you so much for the help.
The build was having trouble with Docker so I removed the docker files and instead used this railway.toml file
[build]
builder = "nixpacks"
buildCommand = ""
[deploy]
startCommand = "uv run gunicorn api:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT --timeout 1800"
healthcheckPath = "/api/health"
healthcheckTimeout = 300
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 10
[[services]]
name = "backend"
sourceDir = "backend"
buildCommand = ""
[[services]]
name = "worker"
sourceDir = "backend"
startCommand = "uv run dramatiq --processes 2 --threads 2 run_agent_background"
buildCommand = ""
[[services]]
name = "frontend"
sourceDir = "frontend"
startCommand = "npm start"
buildCommand = ""
The front end build and deploy logs are attached. I am not sure if I was able to copy/paste everything.
If there is the opportunity to do so, I would be happy to pay for your time to help work through this on a zoom if possible. my contact: shaleen@shah.so
Attachments
ahimsafdn
Thank you so much for the help.The build was having trouble with Docker so I removed the docker files and instead used this railway.toml file[build]builder = "nixpacks"buildCommand = ""[deploy]startCommand = "uv run gunicorn api:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT --timeout 1800"healthcheckPath = "/api/health"healthcheckTimeout = 300restartPolicyType = "on_failure"restartPolicyMaxRetries = 10[[services]]name = "backend"sourceDir = "backend"buildCommand = ""[[services]]name = "worker"sourceDir = "backend"startCommand = "uv run dramatiq --processes 2 --threads 2 run_agent_background"buildCommand = ""[[services]]name = "frontend"sourceDir = "frontend"startCommand = "npm start"buildCommand = ""The front end build and deploy logs are attached. I am not sure if I was able to copy/paste everything.If there is the opportunity to do so, I would be happy to pay for your time to help work through this on a zoom if possible. my contact: shaleen@shah.so
8 months ago
Can you do discord ? you can reach for me at smolit
8 months ago
chatgpt ahhh
ahimsafdn
Thank you so much for the help.The build was having trouble with Docker so I removed the docker files and instead used this railway.toml file[build]builder = "nixpacks"buildCommand = ""[deploy]startCommand = "uv run gunicorn api:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT --timeout 1800"healthcheckPath = "/api/health"healthcheckTimeout = 300restartPolicyType = "on_failure"restartPolicyMaxRetries = 10[[services]]name = "backend"sourceDir = "backend"buildCommand = ""[[services]]name = "worker"sourceDir = "backend"startCommand = "uv run dramatiq --processes 2 --threads 2 run_agent_background"buildCommand = ""[[services]]name = "frontend"sourceDir = "frontend"startCommand = "npm start"buildCommand = ""The front end build and deploy logs are attached. I am not sure if I was able to copy/paste everything.If there is the opportunity to do so, I would be happy to pay for your time to help work through this on a zoom if possible. my contact: shaleen@shah.so
8 months ago
Hi, my pull request was merged. let me know if that solved the issue. you don't seem to be responding to my messages on discord.
7 months ago
Hey ahimsafdn, if this issue is resolved could mark it as resolved ?
smolpaw
Hey ahimsafdn, if this issue is resolved could mark it as resolved ?
7 months ago
Hi Smolpaw, unfortunately not. I had tried to reply back to you on Discord as the pull request merger did not resolve the issue yet. I would still love to work with you to resolve it, and happy to pay for your time as well.
ahimsafdn
Hi Smolpaw, unfortunately not. I had tried to reply back to you on Discord as the pull request merger did not resolve the issue yet. I would still love to work with you to resolve it, and happy to pay for your time as well.
7 months ago
bruh, I replied back. you never came back online
I am going to paste my discord response here:
I am looking at the railway issue and find that the issue was related just to the frontend
the back-end seems to be working okay in my curl request. But front-end continues to do a 502 error
I seem to have solved the frontend issue. I know nextjs and have experience with it that's why i decided to join the conversation and offer my help. I just looked at the backend code again it seems to be written in python which i have no experience with. so sorry but i would only be wasting your time if i tried to help with it. Maybe try making an issue on the original repo about the failing backend build