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