4 months ago
im trying to deploy my docker-compose app by dragging and dropping my docker-compose.yml to the canvas. I have linked the root dir to each image and also configured the variables. however im getting the following errors
backend and worker images - Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/23148efd-5df5-4ea6-b8d0-188820826b88/vol_ssrkb5l37ov79nui. Error: bash: /app/start.sh: No such file or directory. clearly the start.sh image is there and works when i run locally
postgres - initdb: error: directory "/var/lib/postgresql/data" exists but is not empty. nitdb: detail: It contains a lost+found directory, perhaps due to it being a mount point. nitdb: hint: Using a mount point directly as the data directory is not recommended. Create a subdirectory under the mount point.
ⓘ Deployment information is only viewable by project members and Railway employees.
16 Replies
4 months ago
Hello,
Your empty volume is mounted at /app
Your sh script is within /app
The volume mount has overridden the working directory with an empty directory.
Please mount the volume elsewhere, such as /app/data
Best,
Brody
brody
Hello,Your empty volume is mounted at /appYour sh script is within /appThe volume mount has overridden the working directory with an empty directory.Please mount the volume elsewhere, such as /app/dataBest,Brody
4 months ago
thanks ive refactored my docker-compose file and the build works.
however now im getting this error: postgres.railway.internal: forward host lookup failed: No address associated with name
any idea on this? it is related to setting the posgres DB host name
4 months ago
While not the direct issue, I really cannot recommend deploying Postgres via docker-compose, please use our Postgres template, as the template will come with a uniquely secure password where as Postgres deployed via docker-compose will not.
As for the lookup error, please tell me the language you are using in your stack that will connect to the database.
Some things to note, the internal private network is not available during build. The private network is IPv6 only, so if your client doesn't support that, you will have to make the required changes in your code so it can be supported.
4 months ago
thanks brody, i am now deploying my python flask app without using docker-compose, i have spun up postgres and redis, and added my own backends. i have configured the flask app to read from the DATABASE_URL which i have set to ${{Postgres.DATABASE_URL}} and i see that it matches that of the variable in postgres. however im getting this error "password authentication failed for user postgres" any idea why this is happening?
Attachments
4 months ago
You have modified the Postgres password via its service variable, I have undone that for you.
Please do not modify such variables going forward.
Try to redeploy your service please.
pangshengwei
thanks brody, i am now deploying my python flask app without using docker-compose, i have spun up postgres and redis, and added my own backends. i have configured the flask app to read from the DATABASE_URL which i have set to ${{Postgres.DATABASE_URL}} and i see that it matches that of the variable in postgres. however im getting this error "password authentication failed for user postgres" any idea why this is happening?
4 months ago
when i look into the deploy logs of my app, this is the error im getting
{ "severity": "error", "timestamp": "2025-01-28T04:09:54.951745993Z", "message": "postgres.railway.internal: forward host lookup failed: No address associated with name", "tags": { "deploymentId": "ac728adb-b6b9-4b15-beae-bac81ea8b0cd", "deploymentInstanceId": "d8b35c7c-b862-4fa6-83dd-3f2525f9096d", "environmentId": "dc20bd2e-0152-41df-ad99-28c96e781df3", "pluginId": null, "projectId": "5d949acf-3b3b-4a86-a9a3-2dc9a6114b93", "serviceId": "f3841852-0174-480b-aede-38cef7be9f75", "snapshotId": null }, "attributes": { "level": "error" } }
Attachments
brody
You have modified the Postgres password via its service variable, I have undone that for you.Please do not modify such variables going forward.Try to redeploy your service please.
4 months ago
thanks redeploying. strange i didnt remember doing that and i know i shouldnt
pangshengwei
thanks redeploying. strange i didnt remember doing that and i know i shouldnt
4 months ago
the error still persists ( i see that the database url password has changed tho)
Attachments
4 months ago
The version of nc
you are installing does not have support for IPv6, that is an issue because the internal private network is IPv6 only.
Instead of netcat-traditional
you want netcat-openbsd
4 months ago
thanks ive removed netcat completely as i realised i dont actually need it
however now my app is crashing due to high memory :(
how can i increase the memory (vram)? i notice it is capped at 512MB max
Attachments
4 months ago
500MB is the limit on the trial plan.
I'd strongly advise you not to run a deployment server, as you have shown, they use a lot of memory, flask should be ran with gunicorn.
brody
500MB is the limit on the trial plan.I'd strongly advise you not to run a deployment server, as you have shown, they use a lot of memory, flask should be ran with gunicorn.
4 months ago
thanks for the advice, im now running it with gunicorn, however the RAM still exceeds 500MB because im serving an ML model in the app.
hence ive gone ahead to purchase a hobbyist subscription to remove the 500MB limit and now the app mostly works!
however one of the features is not working - which is when i try to upload a document and it is supposed to be processed by a celery worker asynchronously, however it seems like this is not happening and im trying to debug why, but i cant seem to find the worker logs in any of the prd sercice logs. when i run it locally via docker-compose, i can see the worker logs (image attached below). hence i suspect my worker service may not be properly set up / configured, any idea on that? let me know if you need more info, i can provide more code/snippets
Attachments
4 months ago
Please do not enable app sleeping on a worker, app sleeping is meant only to be used with web services, workers would never wake back up and thus it would never process any tasks.
But the bigger issue here, your worker service is running gunicorn, you need to update its start command here to run the worker -
brody
Please do not enable app sleeping on a worker, app sleeping is meant only to be used with web services, workers would never wake back up and thus it would never process any tasks.But the bigger issue here, your worker service is running gunicorn, you need to update its start command here to run the worker -https://railway.com/project/5d949acf-3b3b-4a86-a9a3-2dc9a6114b93/service/f3841852-0174-480b-aede-38cef7be9f75/settings?environmentId=dc20bd2e-0152-41df-ad99-28c96e781df3#deploy-start-command
4 months ago
thanks it works now after i ran the celery cmd
Status changed to Solved brody • 4 months ago