Deployment failing

I am trying to deploy some updates to my app and I am getting errors during the build process. Dockerfile:20 ------------------- 18 | ENV NIXPACKS_PATH /opt/venv/bin:$NIXPACKS_PATH 19 | COPY . /app/. 20 | >>> RUN --mount=type=cache,id=s/0a5fd1c3-1a15-4fc0-a21b-d12aa5ba547f-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt 21 | 22 | ------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1 Error: Docker build failed
32 Replies
Percy
Percy15mo ago
Project ID: 0a5fd1c3-1a15-4fc0-a21b-d12aa5ba547f
Brody
Brody15mo ago
Joseph U.
Joseph U.OP15mo ago
Here is the build log
Brody
Brody15mo ago
mysql issue, I seriously recommend switching to postgres, it would be both cheaper and easier
Joseph U.
Joseph U.OP15mo ago
What do I need to do to resolve the issue? If I was starting from scratch I would go to Supabase or something but for now I have all my code so don't really want to refactor
Brody
Brody15mo ago
then I'm sorry but no one has found a good solution to this besides switch to postgres the best I can say is try different mysql packages
Joseph U.
Joseph U.OP15mo ago
So Railway.app is not compatible with the specific pip application I am installing and I need to go with a different one if I want to use Railway?
Brody
Brody15mo ago
this isn't a railway issue
Joseph U.
Joseph U.OP15mo ago
Just to give you a heads up and if you want to see this first hand we can do a screenshare but I am able to build off the exact same Github repo on Heroku and the build completes.
Brody
Brody15mo ago
heroku does a lot of hand holding with its builds, railway builds and runs your code as is
Joseph U.
Joseph U.OP15mo ago
Is your position that you are able to support me in doing whatever Heroku is doing to make the build work but refuse to do so or that you don't know how to?
Brody
Brody15mo ago
as I've said previously, I have never seen a solution to getting a build with the mysqlclient package working, it has always been use a different mysql package or switch to postgres
Joseph U.
Joseph U.OP15mo ago
If you want to see it I can do a screenshare to show you Heroku's build working. Also I am ok with using a differnt MySQL client. Which one do you reccomend for use on Railway? I'm working in a Python env
Brody
Brody15mo ago
as I've said previously, heroku does a lot of hand holding with its builds, railway builds and runs your code as is as for the mysql package, I'm not sure, as I've said previously, try different mysql packages
Joseph U.
Joseph U.OP15mo ago
Lets say I went to this page: https://docs.railway.app/databases/mysql And I followed the Railway recommendations for a MySQL server and I have a Python envirionment which library would I use?
Railway Docs
MySQL | Railway Docs
Documentation for Railway
Brody
Brody15mo ago
as I've said previously, I am not sure
Joseph U.
Joseph U.OP15mo ago
Ok you don't know how to solve the technical problem if the solution is MySQL. I can accept that answer. Can you please escalate my case to someone on the team that can help?
Brody
Brody15mo ago
it should not take too long to try some of the drop in replacements for the package you are using You're on the hobby plan so unfortunately community help is all you have access to someone else from the community may know how to solve this
Joseph U.
Joseph U.OP15mo ago
Wait are you a Railway staff employee or a community member?
Brody
Brody15mo ago
community member, because as I've said previously, you are on the hobby plan and only have access to community support
Joseph U.
Joseph U.OP15mo ago
I didn't realize that, I thought you were speaking on behalf of the company and refusing to help. Thank you for the suggestions and sorry for pressing you. I thought it was a staff employee who was not wanting to do the extra digging. I'll see what I can do with another library or maybe upgrade the plan if needed.
Brody
Brody15mo ago
I have legitimately tried to solve this in the past, I could not that is why I come with the recommendation of switching to postgres mysql has a base cost of ~ 5$ a month at idle too
Joseph U.
Joseph U.OP15mo ago
I'm going with a cloud provider for MySQL (PlanetScale) which gives 10M row writes and 1B row reas per month up to 5GB storage in the free plan which will keep me going for a while. It works well from my dev envirionment, just need to figure out a way to get it to deploy to railway. Is there anything in your logs that might give a specific error on what dependency of the package might be conflicting?
Brody
Brody15mo ago
I've tried building with a bunch of mysql system packages and all that stuff, nothing seems to work, I truly have no options for you besides try a different client library
Joseph U.
Joseph U.OP15mo ago
Just out of curiosity and hopefully to avoid going down a path that wont work. Do you know if people have had any luck (or failed) with PyMySQL as an alternative? I think mysqlclient is a c based library vs. PyMySQL which won't be as performant but is written in pure python I htink
Brody
Brody15mo ago
I'm not sure, sorry. although it should be very easy to test, throw connect in a main.py file and that package in your requirements.txt file
Joseph U.
Joseph U.OP15mo ago
Agreed. And it seems that the API is the same so a slight modification to the import file and I should be able to test. I'll give it a go locally and then try a deploy and see where I land. Thank you for your help. One last thing. There was another issue released a few mins before mine about a deployment failing in the requirement.txt. Is that just coincidence or is there a chance that something is up with the deployment system and I should try later?
Brody
Brody15mo ago
can you link it?
Brody
Brody15mo ago
that was an issue with pip upgrade
Joseph U.
Joseph U.OP15mo ago
ok. I'll plug away and see what i can find So I think I have MySQL connection code deployed and working. The client library I am using is pymysql==1.1.0 And I am inserting into PlanetScale. I hit some glitches at first but now seems to be running smooth. Will have to hit it harder a bit later to be sure. But I think pymysql is a decent drop in replacement for the standard mysql client library for Python deployments. Thank you for isolating the issue to the mysql library
Brody
Brody15mo ago
sounds good!
Want results from more Discord servers?
Add your server