R
Railway7mo ago
Nim

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
Percy
Percy7mo ago
Project ID: d47e5ad1-4f17-45f5-aed5-01885dc11984
Nim
Nim7mo ago
d47e5ad1-4f17-45f5-aed5-01885dc11984
Brody
Brody7mo ago
does tesseract need a GPU?
Adam
Adam7mo ago
I don't think so GPU speeds it up, but by default it uses the CPU
Brody
Brody7mo ago
libgl.so.1 is a library related to the gpu
Nim
Nim7mo ago
That's correct. Plus I'm using this exact same setup on a different railway service without issues.
Brody
Brody7mo ago
I know you said you use a pyproject.toml, but do you also have a requirements.txt
Nim
Nim7mo ago
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
Brody
Brody7mo ago
can you send your pyproject.toml?
Nim
Nim7mo ago
Same thing as in the original post unfortunately
Brody
Brody7mo ago
can you send the nixpacks.toml, preferably not in a screenshot
Brody
Brody7mo ago
[phases.setup]
nixPkgs = ["...", "tesseract", "libGL"]
[phases.setup]
nixPkgs = ["...", "tesseract", "libGL"]
try that
Nim
Nim7mo ago
Will report back in a bit when build completes salute didn't work unfortunately 🥲
Brody
Brody7mo ago
same libgl error?
Nim
Nim7mo ago
Yes:
No description
Nim
Nim7mo ago
No description
Brody
Brody7mo ago
updated, try this now
Nim
Nim7mo ago
Some errors are the start that might be useful:
No description
Nim
Nim7mo ago
Trying this now
Nim
Nim7mo ago
No description
Brody
Brody7mo ago
is the libgl error still there?
Nim
Nim7mo ago
Yes unfortunately it still is. It is right at the end
Nim
Nim7mo ago
No description
Nim
Nim7mo ago
I'm going to add openCV to my project and see what it gives Answers on StackOverflow seem to suggest it could work
Brody
Brody7mo ago
that's what I'm saying lol time to learn how to write a dockerfile
Nim
Nim7mo ago
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.
Brody
Brody7mo ago
sounds good
Nim
Nim7mo ago
lmao Guess who gets to postpone learning dockerfiles cooldoge
Brody
Brody7mo ago
nice, what exactly fixed it?
Nim
Nim7mo ago
This actually worked lol
Brody
Brody7mo ago
(still learn Dockerfiles tho)
Nim
Nim7mo ago
no idea. Its comical at this point I will, I will
Brody
Brody7mo ago
that's the development world for ya
Nim
Nim7mo ago
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.
Brody
Brody7mo ago
awesome
Nim
Nim7mo ago
Thanks for your help mate! I appreciate you 🙏
Brody
Brody7mo ago
no problem 🙂