Deployment of new FastAPI application results in crash Deploy
I've been trying to deploy my fast api application but this always results in a crash with the errors: /bin/bash: line 1: uvicorn: command not found
https://cdn.discordapp.com/attachments/1172621190515392552/1172621191421374524/image.png
I don't have any custom build command in the railway dashboard.
My procfile is as so: https://media.discordapp.net/attachments/1172621190515392552/1172621191706579034/image.png
And my nixpacks.toml is as so: https://cdn.discordapp.com/attachments/1172621190515392552/1172621192700629022/image.png
Here is what my pyproject.toml file looks like: https://cdn.discordapp.com/attachments/1172621190515392552/1172621192985837648/image.png
After crashing multiple times with the error: /bin/bash: line 1: uvicorn: command not found, I ran poetry install locally and added poetry.lock file to the repo. Weirdly, that made that error go away (although I'm unsure why).
Now I just get a different error as per below: https://cdn.discordapp.com/attachments/1172621190515392552/1172621193262673940/image.png
Thoughts on potential issues and how to resolve this?
40 Replies
Project ID:
d47e5ad1-4f17-45f5-aed5-01885dc11984
d47e5ad1-4f17-45f5-aed5-01885dc11984
does tesseract need a GPU?
I don't think so
GPU speeds it up, but by default it uses the CPU
libgl.so.1 is a library related to the gpu
That's correct. Plus I'm using this exact same setup on a different railway service without issues.
I know you said you use a pyproject.toml, but do you also have a requirements.txt
The errors seem inconsistent to me. Thoughts on why it would throw a uvicorn: command not found error if the repo doesn't have a poetry.lock file
No I don't
can you send your pyproject.toml?
Same thing as in the original post unfortunately
can you send the nixpacks.toml, preferably not in a screenshot
try that
Will report back in a bit when build completes didn't work unfortunately 🥲
same libgl error?
Yes:
updated, try this now
Some errors are the start that might be useful:
Trying this now
is the libgl error still there?
Yes unfortunately it still is. It is right at the end
I'm going to add openCV to my project and see what it gives
Answers on StackOverflow seem to suggest it could work
that's what I'm saying lol
time to learn how to write a dockerfile
Okay here is the plan. Since The project was failing earlier for not have a poetry.lock file, I went ahead and compared the .lock file of the current project to the project whose code I adapted. Similar setup but that one is working.
I noticed a lot of the packages in the new project are at a higher version in the .lock file (which is fair since running poetry install with '^' installs the latest version). So I've now downgraded the packages to be in line with the adapted code base that's working. I've pushed that and see how it goes.
If that fails again, then I'll add OpenCV and push again. And if that fails too, then, to docker land I guess.
sounds good
lmao
Guess who gets to postpone learning dockerfiles
nice, what exactly fixed it?
This actually worked lol
(still learn Dockerfiles tho)
no idea. Its comical at this point
I will, I will
that's the development world for ya
I think the latest version of one of the packages in the .toml file did. Once I downgraded everything to match my other working project, things worked.
awesome
Thanks for your help mate! I appreciate you 🙏
no problem 🙂