Deployment Failed during build process
Anonymous
HOBBYOP

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

Anonymous
HOBBYOP

2 years ago

Project ID: da285e3a-b7b2-4c5a-a383-0e7f536ba2ac


2 years ago

full build logs please -


Anonymous
HOBBYOP

2 years ago

Brody, were you able to find anything in the logs that's causing the build to fail?

1245857433423839274


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?


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

Python 3.8.10


2 years ago

can you try putting just 3.8 into a runtime.txt file in your project


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

Here is the log,


Anonymous
HOBBYOP

2 years ago


Anonymous
HOBBYOP

2 years ago

Brody, is there anything else you want me to try?


2 years ago

honestly, I'm stumped, at this point I'm gonna ask you to move to a Dockerfile based build


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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?


Anonymous
HOBBYOP

2 years ago

Here's the build log

1252299285186482216


Anonymous
HOBBYOP

2 years ago

Here's my Dockerfile


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

Here's the deploy logs

1252365702405427241


2 years ago

are you setting your start command somewhere else like in the service settings


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

Brody I removed the PROCFILE and redeployed but still getting Application failed to respond


2 years ago

deployment logs please


Anonymous
HOBBYOP

2 years ago

Here's the deployment log

1252385940891242517


2 years ago

do what it says and then deploy the changes


Anonymous
HOBBYOP

2 years ago

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? Run railway up to deploy your changes!

I did a redeploy, and still getting "Application failed to respond"


Anonymous
HOBBYOP

2 years ago

Here's the deploy log

1252751126638362754


2 years ago

you need to deploy the changes to github


Anonymous
HOBBYOP

2 years ago

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.


Anonymous
HOBBYOP

2 years ago

still getting "Application failed to respond"


2 years ago

please use the bookmarklet to send me the latest logs from railway


Anonymous
HOBBYOP

2 years ago

here are the logs

1252779637306822787


Anonymous
HOBBYOP

2 years ago


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


Anonymous
HOBBYOP

2 years ago

Brody, the migration issue has been remedied but still getting "Application failed to respond". Here's the deployment log

1255004580333355102


2 years ago

what's your current start command?


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

I not sure what you mean, should I clear out the start command, and just leave blank?

1255033882412056600


2 years ago

correct


Anonymous
HOBBYOP

2 years ago

I removed the start command, redeployed, but redeployment crashed

1255037369711722516


2 years ago

you need gunicorn in your requirements


Anonymous
HOBBYOP

2 years ago

I do have gunicorn in my requirements.txt file. The build logs show tht gunicorn is being installed:

1255184764839657700


2 years ago

your deploy logs disagree


Anonymous
HOBBYOP

2 years ago

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


Anonymous
HOBBYOP

2 years ago

Brody, here's my Dockerfile

1255270857216098435


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.wsgi

and if you still have a start command set in the service settings remove it, same goes for a Procfile


Anonymous
HOBBYOP

2 years ago

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


Loading...