scrapy / scrapyd

A service daemon to run Scrapy spiders
https://scrapyd.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
2.96k stars 569 forks source link

Error R10 (Boot timeout) -> Web process failed to bind to $PORT when deploying to heroku #367

Closed pratikaher88 closed 4 years ago

pratikaher88 commented 4 years ago

This is my config file :

[settings] default = scrapy_app.settings

[deploy] url = https://cscrapcraw.herokuapp.com/ project = scrapy_app

[scrapyd] bind_address = 0.0.0.0

The error I am getting in logs is :

2020-02-26T03:22:56.000000+00:00 app[api]: Build succeeded 2020-02-26T03:23:04.827686+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2020-02-26T03:23:04.827899+00:00 heroku[web.1]: Stopping process with SIGKILL 2020-02-26T03:23:04.943522+00:00 heroku[web.1]: Process exited with status 137 2020-02-26T03:23:51.451982+00:00 heroku[web.1]: State changed from starting to crashed

Is there something I am missing in logs ?

my8100 commented 4 years ago

You should bind scrapyd to os.environ['PORT'] on heroku. FYI: https://github.com/my8100/scrapyd-cluster-on-heroku https://github.com/my8100/scrapyd-cluster-on-heroku/blob/e8cdd3779736cd0d651a49b9a4b26daed076888e/scrapyd/init.py#L7-L13