启动后,Python Heroku应用程序崩溃

时间:2019-12-09 22:48:22

标签: python-3.x heroku

因此,我将一个Python应用程序上传到了Heroku。一款在我的计算机上运行正常的软件。综上所述,Start.py是一个python脚本,可以同时创建3个不同的脚本。他们每个人都打开一个网站,抓取一些数据并查询数据库。

我使用buildpacks配置了chromedriver和google chrome,并添加了一个postgreSQL数据库。无论如何,当我将自由测功机设置为运行worker python Start.py时,这是我可以在heroku日志中看到的日志

2019-12-09T19:40:58.989027+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T19:40:59.660594+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T19:41:01.191954+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T19:41:01.269256+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T19:41:01.175286+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T19:41:17.958918+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T19:41:18.770794+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T19:41:19.018920+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=cornerbetbot.herokuapp.com request_id=c52fb218-8edc-46ba-a102-b261889ff5c2 fwd="85.49.38.178" dyno= connect= service= status=503 bytes= protocol=https
2019-12-09T19:41:19.587237+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=cornerbetbot.herokuapp.com request_id=84c199ea-fe28-4a00-82bb-fb22503931dc fwd="85.49.38.178" dyno= connect= service= status=503 bytes= protocol=https
2019-12-09T19:41:20.695980+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T19:41:20.675338+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T19:59:07.558199+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T19:59:18.890032+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T19:59:19.438727+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T19:59:20.724438+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T19:59:20.707567+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T20:47:04.961419+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T20:47:17.060719+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T20:47:17.762218+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T20:47:19.297417+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T20:47:19.274605+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T21:00:19.001603+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T21:00:33.622685+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T21:00:34.321670+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T21:00:36.421283+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T21:00:36.385484+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T21:15:40.826368+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T21:15:53.081199+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T21:15:53.836401+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T21:15:55.771307+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T21:15:55.743596+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T21:33:42.453572+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T21:33:53.726816+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T21:33:54.420552+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T21:33:57.127258+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T21:33:57.100514+00:00 heroku[worker.1]: Process exited with status 0
2019-12-09T21:53:43.151613+00:00 heroku[worker.1]: State changed from crashed to starting
2019-12-09T21:53:55.686795+00:00 heroku[worker.1]: Starting process with command `python Start.py`
2019-12-09T21:53:56.288200+00:00 heroku[worker.1]: State changed from starting to up
2019-12-09T21:53:57.966552+00:00 heroku[worker.1]: State changed from up to crashed
2019-12-09T21:53:57.939834+00:00 heroku[worker.1]: Process exited with status 0

我真的不知道我在做什么错

编辑:此处附有Start.py的完整代码

#! /usr/bin/env python

import sys
import subprocess

for cmd in ['Cornerbot.py', 'Betcornerbot.py']:
    subprocess.Popen([sys.executable, cmd], shell=False)

0 个答案:

没有答案