1
確實類似的問題以簡單的解決方案回答。不要以爲這是一樣的。首先是我的代碼,然後是日誌。我正在使用提供的PORT env變量,但仍然出現此錯誤。
if __name__ == "__main__":
import sys
print('HELLO %s' % str(sys.argv[1]))
#import os
import os
port = os.environ['PORT']
print(port)
cherrypy.config.update({
'server.socket_port': int(port),
})
cherrypy.quickstart(House())
這裏談到的日誌
2016-06-28T20:23:08.801989+00:00 app[web.1]: HELLO 33860
2016-06-28T20:23:08.802004+00:00 app[web.1]: 33860
2016-06-28T20:23:08.802471+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Listening for SIGTERM.
2016-06-28T20:23:08.802622+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Listening for SIGUSR1.
2016-06-28T20:23:08.802790+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Listening for SIGHUP.
2016-06-28T20:23:08.802942+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Bus STARTING
2016-06-28T20:23:08.803132+00:00 app[web.1]: CherryPy Checker:
2016-06-28T20:23:08.803139+00:00 app[web.1]: The Application mounted at '' has an empty config.
2016-06-28T20:23:08.803140+00:00 app[web.1]:
2016-06-28T20:23:08.803640+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Started monitor thread '_TimeoutMonitor'.
2016-06-28T20:23:08.803919+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Started monitor thread 'Autoreloader'.
2016-06-28T20:23:08.955231+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Serving on http://127.0.0.1:33860
2016-06-28T20:23:08.955533+00:00 app[web.1]: [28/Jun/2016:20:23:08] ENGINE Bus STARTED
2016-06-28T20:24:06.045442+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-28T20:24:06.045345+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
請隨時單擊旁邊的灰色複選標記以「接受」您的答案;這樣其他人可以一眼就看出你的問題已經解決。 – webKnjaZ