Heroku app crashed after pushing small change. Very confused

前端 未结 3 1171
面向向阳花
面向向阳花 2021-01-12 15:47

I am using Heroku with python and Flask. My app was working fine until I updated a few lines in my python application file. The app runs fine locally, but I now have the fol

3条回答
  •  一整个雨季
    2021-01-12 15:54

    This bit me, too. I'm not sure when it started. I don't believe it was in response to any change on my part, I just noticed Application Error on my site today, and found this in the logs:

    2012-12-12T16:02:06+00:00 heroku[web.1]: State changed from crashed to starting
    2012-12-12T16:02:09+00:00 heroku[web.1]: Starting process with command `aspen --network_address=:40856 --www_root=doc/ --project_root=doc/.aspen`
    2012-12-12T16:02:10+00:00 app[web.1]: ImportError: No module named site
    2012-12-12T16:02:11+00:00 heroku[web.1]: Process exited with status 1
    2012-12-12T16:02:11+00:00 heroku[web.1]: State changed from starting to crashed
    

    I had another release ready to go, so I just deployed as usual. After a git push heroku, the site is back up. My heroku config doesn't have the extra envvars listed above:

    $ heroku config
    === aspen-io Config Vars
    ASPEN_IO_SHOW_GA: yes
    PATH:             bin:/usr/local/bin:/usr/bin:/bin
    PYTHONUNBUFFERED: true
    

    Update: @kennethreitz pointed me to this:

    Cannot import module site

    This occurs when the configured environment variables don't match the paths of the installed Python. When this occurs, it is because someone purged an app's cache without understanding the above implications.

    To fix, either purge the cache and update the configuration, or restore the expected configurations (preferred).

提交回复
热议问题