R
Railwayβ€’13mo ago
bfortuna.dev

Issue Deploying a Python Application on Railway

Project ID: f2fafb89-464a-475d-8a88-80b715a91259. Hello everyone, I'm having trouble deploying my Python application on Railway, and I was wondering if someone could help me resolve a specific error. The error I'm facing is as follows: "Container failed to start. We failed to create a container for this image." I'm using Railway to deploy my application with a Dockerfile and a Procfile. Could anyone provide some guidance on what might be causing this issue or how to resolve it? I greatly appreciate any help you can offer. Thank you in advance!
No description
No description
No description
No description
No description
No description
Solution:
yeah but can you try creating a new project to deploy this app
Jump to solution
43 Replies
Percy
Percyβ€’13mo ago
Project ID: f2fafb89-464a-475d-8a88-80b715a91259
Brody
Brodyβ€’13mo ago
your dockerfile isnt doing anything nixpacks cant do, try removing the dockerfile
bfortuna.dev
bfortuna.devβ€’13mo ago
Hi there, Brody! Thanks for your prompt response. I've removed the Dockerfile as you suggested since Nixpacks can handle the build process. However, now I'm encountering the following error after removing the Dockerfile.
No description
Brody
Brodyβ€’13mo ago
ive been here a long time and i have seen a lot of builds fail, but i have never seen railway say to install docker to be clear, thats railway telling itself to install docker
jr
jrβ€’13mo ago
The error is seen when the container fails to start on startup. Have you checked that your start command is correct and works locally? Is gunicorn installed?
Brody
Brodyβ€’13mo ago
ive seen the error when gunicorn isnt installed this is nothing like that lol
jr
jrβ€’13mo ago
Sorry I was refering to the first error
Brody
Brodyβ€’13mo ago
ah gotcha, but uh i think theres now a bigger problem 🀣
jr
jrβ€’13mo ago
Builds look all good on our end. Can you try deploying again?
bfortuna.dev
bfortuna.devβ€’13mo ago
Should I try it with the Dockerfile added to the project again?
Brody
Brodyβ€’13mo ago
nope
bfortuna.dev
bfortuna.devβ€’13mo ago
In that case, it continues to give me the same error
Brody
Brodyβ€’13mo ago
how did you trigger the new deploy?
bfortuna.dev
bfortuna.devβ€’13mo ago
I'm simply changing a variable, and then I add it back to make a redeploy.
Brody
Brodyβ€’13mo ago
for future ref, you can also use this
No description
bfortuna.dev
bfortuna.devβ€’13mo ago
No description
Brody
Brodyβ€’13mo ago
bfortuna.dev
bfortuna.devβ€’13mo ago
It continues to give me the same error since I removed the Dockerfile.
bfortuna.dev
bfortuna.devβ€’13mo ago
No description
Brody
Brodyβ€’13mo ago
that's not ideal, I'm confident this isn't anything you're doing wrong can you try spinning up another project, that way your service will hopefully use a different builder
Tsh
Tshβ€’13mo ago
@Brody do you check pm ?
bfortuna.dev
bfortuna.devβ€’13mo ago
I have another website online that is not giving me any kind of issues.
Brody
Brodyβ€’13mo ago
um why bfortuna, do you know tsh?
bfortuna.dev
bfortuna.devβ€’13mo ago
No :/
Tsh
Tshβ€’13mo ago
i saw you answering problems and i have one too, i am new , i was trying to contact you in pm sorry for interrupting
Brody
Brodyβ€’13mo ago
#πŸ›‚ο½œreadme #5 open your own #βœ‹ο½œhelp thread
Tsh
Tshβ€’13mo ago
ok ty
bfortuna.dev
bfortuna.devβ€’13mo ago
I have this other website that is working wonderfully. Can I attach the link to this one?
Solution
Brody
Brodyβ€’13mo ago
yeah but can you try creating a new project to deploy this app
bfortuna.dev
bfortuna.devβ€’13mo ago
Okay
bfortuna.dev
bfortuna.devβ€’13mo ago
In these two deployments, the first one was done with the environment variables added, and the second one without adding them. In both cases, the Dockerfile is obviously not present.
No description
No description
Brody
Brodyβ€’13mo ago
same install docker issue?
bfortuna.dev
bfortuna.devβ€’13mo ago
In the one with the variables added in Railway, it's giving me the same error as with the Dockerfile.
Brody
Brodyβ€’13mo ago
show me the error
bfortuna.dev
bfortuna.devβ€’13mo ago
Okay, let me explain. I removed the environment variables PORT, PATH, and HOST from my project, and now the project is visible πŸ™‚
Brody
Brodyβ€’13mo ago
can you still show me the logs for that failed deployment
bfortuna.dev
bfortuna.devβ€’13mo ago
[Region: us-west1] ============== Using Nixpacks ============== context: 713f4df6e22ad8c661bd016a0232cbf6 ╔══════════════════════════════ Nixpacks v1.17.0 ══════════════════════════════╗ β•‘ setup β”‚ python38, gcc β•‘ ║──────────────────────────────────────────────────────────────────────────────║ β•‘ install β”‚ python -m venv --copies /opt/venv && . /opt/venv/bin/activate β•‘ β•‘ β”‚ && pip install -r requirements.txt β•‘ ║──────────────────────────────────────────────────────────────────────────────║ β•‘ start β”‚ gunicorn app:app β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• Error: Please install Docker to build the app https://docs.docker.com/engine/install/
Docker Documentation
Install Docker Engine
Learn how to choose the best method for you to install Docker Engine. This client-server application is available on Linux, Mac, Windows, and as a static binary.
Brody
Brodyβ€’13mo ago
interesting you dont need to set a PORT or HOST variable for gunicorn anyway? but what where you setting those 3 variables to?
bfortuna.dev
bfortuna.devβ€’13mo ago
I don't even know how to thank you for taking the time to help me with my project. It's working practically everything. I only have one error left, but I think this one depends on me πŸ™‚ No, I don't need those variables; it seems it was a layer 8 error
bfortuna.dev
bfortuna.devβ€’13mo ago
I'm trying to use the session_id to create a cart for the user (it's a kind of Ecommerce website). I will still solve it on my own, but if you know about it, please let me know. Again, I thank you for helping me and giving me the most valuable thing, which is time.
No description
bfortuna.dev
bfortuna.devβ€’13mo ago
❀️
Brody
Brodyβ€’13mo ago
fwiw, it was an issue with setting the PATH variable and I'm sorry but I don't know about that, I'm not a python dev
bfortuna.dev
bfortuna.devβ€’13mo ago
No problem, thank you very much πŸ™‚
Want results from more Discord servers?
Add your server