R
Railway

✋|help

Deployment failing

Aamazingjoe19769/16/2023
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
Bbrody1929/16/2023
Aamazingjoe19769/16/2023
Here is the build log
Bbrody1929/16/2023
mysql issue, I seriously recommend switching to postgres, it would be both cheaper and easier
Aamazingjoe19769/16/2023
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
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
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?
Bbrody1929/16/2023
this isn't a railway issue
Aamazingjoe19769/16/2023
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.
Bbrody1929/16/2023
heroku does a lot of hand holding with its builds, railway builds and runs your code as is
Aamazingjoe19769/16/2023
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?
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
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
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
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?
Bbrody1929/16/2023
as I've said previously, I am not sure
Aamazingjoe19769/16/2023
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?
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
Wait are you a Railway staff employee or a community member?
Bbrody1929/16/2023
community member, because as I've said previously, you are on the hobby plan and only have access to community support
Aamazingjoe19769/16/2023
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.
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
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?
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
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
Bbrody1929/16/2023
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
Aamazingjoe19769/16/2023
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?
Bbrody1929/16/2023
can you link it?
Bbrody1929/16/2023
that was an issue with pip upgrade
Aamazingjoe19769/16/2023
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
Bbrody1929/16/2023
sounds good!

Looking for more? Join the community!

Recommended Posts
Payload CMS app 500 errorURL: https://edit.gravybo.at/ ID: 9c654a5e-96b8-42bd-a2a0-d82a9e0b8d11 App builds/runs locally, howConfiguring Redis TemplateHi, I was wondering how we can configure the new Redis from the templates. In particular setting theNew deployments maxing out RAM?I have no idea why this started happening, but any new deployments made for one of my services now mPlease help, we are down during a live eventI am not sure what is wrong, everything was working fine but now we cannot access the site. I lookedError installing Python Packages via requirements.txt inside Docker buildProject ID: 1b6776e2-c07c-4f4f-8d54-cd1c9aee3de0 I am trying to deploy an application via DockerHow can I set usage limits?Hello! Following the latest changelog, I wanted to configure usage limits and reading the documentatWhat Postgres Version is railway usingWhat Postgres Version is railway usingcredit missingHello, before the railway plan rework, I purchased $5 credits. Now after the rework, I only have theSomebody got a working PostHog Template?The current template in the marketplace is not deploying: https://railway.app/template/16rDubUpgrading NixPacks NodeJS from 18.12.1 to 18.14.1I tried to deploy an Astro.build 3.1.0 I get a build error that my node version is incorrect: ``` 0.Many print statements are missing from logs?Hello! I have been using railway for a couple months now I have my program sysout a couple thousand All cron jobs skippedProject ID: `f3ce15da-e811-4392-8e64-d21d3ca5660e` I have a project with a cron job that runs everyError deploy flaskHii, im having a problem with my project, can someone help me Project ID 0f9c813d-b8f5-4b7c-aa00-adHelp with webhooksRailway doesn't call my webhook, but i can manually call it through postmanDeleted MySQL DatabaseHow do I recover a deleted database without backup. projectId: e28cd36d-0d6f-4588-a03f-b54a6e97d1Connect to services using Private NetworksProject ID: 1790d4a8-0e32-4b4e-bf67-6ce23d7ae9e1 I'm trying to connect my main project (Node.js) toUpload FilesGood morning, I have 4 gigabytes of image files, my application is connected to Git, and I can't uplFiles on mounted volume not available after redeployI did a fresh deploy of @Brody 's Payload CMS template (https://github.com/brody192/payload-cms-tempCan't manually fill MySQLNone of the options i've tried works. I can still create dbs and populate them when connecting throuReferenced variables are emptyIf I hardcode the url in env variables, the deployment is successful, however using a reference to a