10

My Python app on Heroku failed to build consistently:

-----> Python app detected
 !     Python has released a security update! Please consider upgrading to python-3.6.8
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Found python-3.6.4, removing
-----> Installing python-3.6.7
-----> Installing pip
-----> Installing SQLite3
 !     Push rejected, failed to compile Python app.
 !     Push failed

It is a Django application that runs fine locally.

python-3.6.7 specified in runtime.txt, and I've tried other versions.

My Procfile contains:


release: python <appname>/manage.py migrate
web: python <appname>/manage.py runserver 0.0.0.0:$PORT

I could probably use gunicorn but that's irrelevant here. The build logs doesn't seem to provide me any information.

requirements.txt

chardet==3.0.4
Django==2.0.2
idna==2.6
pytz==2018.3
requests==2.18.4
urllib3==1.22
dj-database-url==0.5.0
setuptools==1.0.0
7
  • It looks like you already know not to use manage.py runserver in production. Once you get your application working migrating to gunicorn or similar, as you suggest, is probably a good idea. Commented Jun 19, 2019 at 23:58
  • 4
    I have raised the concern with the heroku team and the suspect the new security patch released 15 hrs ago for SQLite is causing the issue I've been taking a look and I see that a new version of the SQLite3 package for Xenial was released 15 hours ago with some security fixes. This package is installed by the Python buildpack, and I think this could be related to the installation errors in the build. Commented Jun 20, 2019 at 12:13
  • 3
    I managed to get our app to build by forking the heroku buildpack and commenting out the part that installs sqlite3 and replacing the official buildpack. We just run some python scripts so I don't even know why it is installing SQLite3.... github.com/econner/heroku-buildpack-python Commented Jun 20, 2019 at 21:58
  • 1
    @EricConner Thanks for sharing your fix. Was able to verify and deploy with the changes in your PR. Commented Jun 20, 2019 at 23:20
  • 1
    @EricConner looks like they are in the process of rolling out some changes for this : github.com/heroku/heroku-buildpack-python/pull/825 by adding a config var to the app.json Commented Jun 21, 2019 at 0:46

2 Answers 2

4

Try this in your app.json. Although it a temporary solution

"buildpacks": [
    {
      "url": "https://github.com/heroku/heroku-buildpack-python.git#remove- 
              sqlite"
    },
Sign up to request clarification or add additional context in comments.

2 Comments

as well as : "env": ["PYTHON_NO_SQLITE3": {"value": "true"}]
I don't think this works now. github.com/heroku/heroku-buildpack-python/pull/825 wasn't merged.
1

See: https://travis-ci.org/heroku/heroku-buildpack-python

Upgrade the the stack from heroku-16 to heroku-18 in app.json.

1 Comment

Just answer the question, no need to mention additional comment above like Hi i was facing the same problem, try to make the answer short and clear

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.