2 years ago
I am getting Deployment failed, even though nothing has changed in my configuration recently.
The two error messages in build log:
math -Ibuild/src.linux-x8664-3.1/numpy/core/src/common -Ibuild/src.linux-x8664-3.1/numpy/core/src/npymath -c numpy/core/src/multiarray/scalarapi.c -o build/temp.linux-x8664-cpython-311/numpy/core/src/multiarray/scalarapi.o -MMD -MF build/temp.linux-x8664-cpython-311/numpy/core/src/multiarray/scalarapi.o.d" failed with exit status 1
10 267.6 ERROR: Failed building wheel for numpy
I'm using
Django 3.2.18
numpy 1.16.4
pandas 1.1.5
Any ideas why the build is failing?
Thank you.
70 Replies
2 years ago
full build logs please -
Brody, were you able to find anything in the logs that's causing the build to fail?
2 years ago
I mean, you just sent them so I haven't looked yet, but you seem to assume I had already somehow read your logs before you sent them?
Ya sorryI though I sent you the log yesterday but somehow the logs were in limbo state on my computer
2 years ago
what version of python do you use locally
2 years ago
can you try putting just 3.8 into a runtime.txt file in your project
I changed runtime.txt to just python 3.8 , did a git push to remote, where Railway picked up the push, but still getting deployment failed
2 years ago
honestly, I'm stumped, at this point I'm gonna ask you to move to a Dockerfile based build
The build has been working for months, what has changed? I don't know what a Dockerfile based build is, can you provide some instructions?
2 years ago
a Dockerfile based build would not be anything railway specific, so it would be of great help if you were able to familiarize yourself with the topics at hand
2 years ago
By default, Railway builds your app using nixpacks, their in house builder. It seems to be having issues with building your app, so Brody is suggesting you swap to a Dockerfile. Dockerfiles are instructions for Railway (or other cloud services) to build a Dockerized container for your app. You can make it more prescriptive and include exactly what your app needs, rather than relying on Nixpacks to make decisions for you, which it seems to be doing wrong in this case. Railway will automatically build off a Dockerfile if you include the file named “Dockerfile” in your project’s root directory
2 years ago
Here are the Dockerfile docs: https://docs.docker.com/reference/dockerfile/
2 years ago
@Brody I don’t want to send them off the deep end without any help, do you have any example dockerfiles available to share?
2 years ago
Dockerfiles definitely aren't the deep end, any basic python Dockerfile will do with some minor modifications
Adam, Brody: What has changed with these “nixpacks”. My app has been running for a while with no issues, and then this happens now out of the blue. I’ve got a 2nd app with Railway, and now it is giving the same build error: “ERROR: Failed building wheel for numpy”.
What I am hearing is that this nixpack system can be flaky and going to a Dockerfile based build will be much more reliable on Railway. So I guess I will have to invest the time to do that.
2 years ago
there have been multiple recent updates to nixpacks, so yes for some people nixpacks can be flakey, a Dockerfile will always be the way to go so that you have complete control over your build, that way if you build breaks it wouldn't be someone else's fault
2 years ago
by no means are Dockerfiles complicated, please don't overthink this
Brody I created the Dockerfile for my app and I tried not to overthink it as you recommended but I am stumped now. After creating the Dockerfile, I deployed to Railway. I see 'deployment successful', but when I open a browser and launch my app I'm getting "Application failed to respond". I don't see any errors in the build log. What am I doing wrong?
Here's the build log
FROM python:3.8-buster
ENV PYTHONUNBUFFERED 1
RUN mkdir /equick
WORKDIR /equick
COPY requirements.txt /equick/
RUN pip install --user -r requirements.txt
COPY . /equick/
ARG DATABASEURL ARG DEBUG ARG DJSTRIPEWEBHOOKSECRET ARG MAINTENANCEMODE
ARG PGDATABASE
ARG PGHOST
ARG PGPASSWORD
ARG PGPORT
ARG PGUSER
ARG SECRETKEY ARG SENDGRIDAPIKEY ARG STRIPELIVEMODE ARG STRIPELIVESECRETKEY
ARG STRIPEPRICEID
ARG STRIPEPUBLISHABLEKEY
ARG STRIPETESTSECRETKEY ARG domainurl
ARG dsn
CMD python3 manage.py runserver
2 years ago
python3 manage.py runserver is a development server, please use gunicorn
Brody, I changed in my docker file 'CMD python3 manage.py runserver '
to 'CMD gunicorn equick.wsgi' but I'm still getting "Application failed to respond". Have I got the CMD correct?
2 years ago
send your deploy logs please
Here's the deploy logs
2 years ago
are you setting your start command somewhere else like in the service settings
I have a PROCFILE with this setting
web: python manage.py migrate && gunicorn equick.wsgi
2 years ago
that's overwriting the CMD in your Dockerfile, you can remove it
Brody I removed the PROCFILE and redeployed but still getting Application failed to respond
2 years ago
deployment logs please
Here's the deployment log
2 years ago
do what it says and then deploy the changes
I did the makemigrations and migrate:
railway run python manage.py migrate
Select a service to pull variables from web
Operations to perform:
Apply all migrations: account, admin, auth, contenttypes, datainput, djangosummernote, djstripe, idea, loginhistory, posts, sessions, sites, subscribers, useraccounts Running migrations: Applying djangosummernote.0003alterattachment_id… OK
Looking good? Runrailway upto deploy your changes!
I did a redeploy, and still getting "Application failed to respond"
Here's the deploy log
2 years ago
you need to deploy the changes to github
Brody, I did the migrate and makemigrations then git push to Github
-iMac equick % python3 manage.py makemigrations
No changes detected
(equick) iMac equick % python3 manage.py migrate
Operations to perform:
Apply all migrations: account, admin, auth, contenttypes, datainput, djangosummernote, djstripe, idea, loginhistory, posts, sessions, sites, subscribers, user_accounts
Running migrations:
No migrations to apply.
2 years ago
please use the bookmarklet to send me the latest logs from railway
here are the logs
2 years ago
Your models in app(s): 'django_summernote' have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.please remedy this before proceeding
Brody, the migration issue has been remedied but still getting "Application failed to respond". Here's the deployment log
2 years ago
what's your current start command?
when you say start command are you referring to the CMD statement in the dockerfile? If so, it is: CMD gunicorn equick.wsgi
2 years ago
I'm talking about the command that railway will be running
It is: python manage.py migrate && gunicorn equick.wsgi
2 years ago
then that means your migrate command is exiting prematurity for whatever reason and not allowing gunicorn to run, please look into that
How do I look into that? It was running before when I was using Nixpack method.
2 years ago
this would be an issue with your code
I don't think it is existing prematurely because there is nothing to migrate, that's why it says "no migrations to apply"
2 years ago
then it's exciting with an error, fact of the matter is that gunicorn never gets ran because something in the migrate command is preventing it
If it's exiting with an error wouldn't the build or deploy logs show that. Everything looks good. You said going "Dockerfiles complicated, please don't overthink this" but I have worked on this for days with no real progress.
2 years ago
okay then if you haven't made any progress, don't have the start command run migrations
I not sure what you mean, should I clear out the start command, and just leave blank?

2 years ago
correct
I removed the start command, redeployed, but redeployment crashed
2 years ago
you need gunicorn in your requirements
I do have gunicorn in my requirements.txt file. The build logs show tht gunicorn is being installed:

2 years ago
your deploy logs disagree
Brody, I am so confused. I thought you said using a Dockerfile would be straight forward? If the build log says Gunicorn is installed, but deploy log says it can’t find Gunicorn… so what should I do? I’ve been working on this Dockerfile method for weeks, should I try going back to Nixpack? Do you have a successful working dockerfile for a python/django application that I can copy? I’m totally lost. I need some direction from you or one of your colleagues.
2 years ago
please attach your dockerfile
Brody, here's my Dockerfile
2 years ago
try this -
FROM python:3.8-buster
ENV PYTHONUNBUFFERED 1
WORKDIR /equick
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . ./
CMD gunicorn equick.wsgiand if you still have a start command set in the service settings remove it, same goes for a Procfile
Brody, …Bingo, OMG it's up and running now! That Dockerfile is really simple. It took awhile to figure this out. Thanks for your help!
2 years ago
told you not to complicate things