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
Samuel
  • 101
  • 4
  • 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. – ChrisGPT was on strike Jun 19 '19 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. ` – shardy Jun 20 '19 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.... https://github.com/econner/heroku-buildpack-python – Eric Conner Jun 20 '19 at 21:58
  • @EricConner just wanted to double check, so you replaced `"buildpacks": [{"url": "https://github.com/heroku/heroku-buildpack-python"}` with `"buildpacks": [{"url": "https://github.com//heroku-buildpack-python"}`in the `app.json` ? And, The changes being from : https://github.com/econner/heroku-buildpack-python/commit/cbf78e29ade9866a427386a2d412961f89f7b631 ? – jmunsch Jun 20 '19 at 22:43
  • 1
    @EricConner Thanks for sharing your fix. Was able to verify and deploy with the changes in your PR. – jmunsch Jun 20 '19 at 23:20
  • correct, glad you got it working. no word on this still from heroku.... crazy – Eric Conner Jun 20 '19 at 23:49
  • 1
    @EricConner looks like they are in the process of rolling out some changes for this : https://github.com/heroku/heroku-buildpack-python/pull/825 by adding a config var to the app.json – jmunsch Jun 21 '19 at 00:46

2 Answers2

4

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

"buildpacks": [
    {
      "url": "https://github.com/heroku/heroku-buildpack-python.git#remove- 
              sqlite"
    },
shardy
  • 357
  • 2
  • 6
1

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

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

jmunsch
  • 22,771
  • 11
  • 93
  • 114
  • 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 – Adam Jun 21 '19 at 15:52