Heroku-进程退出,状态为255

时间:2020-06-05 18:11:07

标签: python heroku streamlit

我是Heroku的新手 该应用程序在python 3.7中运行,并使用流光,散景和熊猫 我已经成功部署了python streamlit应用程序,但是当我尝试打开它时,出现以下错误。 我无法理解255错误和以下行:

Found invalid character in key name: '['. Try quoting the key name.

如果有人可以帮助我,我会很高兴。 这是日志文件:

C:\Users\imall\Desktop\projects\app>heroku logs --tail
2020-06-05T17:31:11.476321+00:00 app[api]: Release v1 created by user xxx@gmail.com
2020-06-05T17:31:11.476321+00:00 app[api]: Initial release by user xxx@gmail.com
2020-06-05T17:31:11.710688+00:00 app[api]: Release v2 created by user xxx@gmail.com
2020-06-05T17:31:11.710688+00:00 app[api]: Enable Logplex by user xxx@gmail.com
2020-06-05T17:31:44.000000+00:00 app[api]: Build started by user xxx@gmail.com
2020-06-05T17:33:09.232663+00:00 app[api]: Release v3 created by user xxx@gmail.com
2020-06-05T17:33:09.232663+00:00 app[api]: Deploy 5e76f3fe by user xxx@gmail.com
2020-06-05T17:33:09.252408+00:00 app[api]: Scaled to web@1:Free by user xxx@gmail.com
2020-06-05T17:33:18.820397+00:00 heroku[web.1]: Starting process with command `sh setup.sh && streamlit run dvh-app2.py`2020-06-05T17:33:26.600593+00:00 app[web.1]: Found invalid character in key name: '['. Try quoting the key name. (line 1 column 2 char 1)
2020-06-05T17:33:26.896489+00:00 heroku[web.1]: Process exited with status 255
2020-06-05T17:33:26.948655+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-05T17:33:26.950770+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-05T17:33:28.000000+00:00 app[api]: Build succeeded
2020-06-05T17:33:34.441164+00:00 heroku[web.1]: Starting process with command `sh setup.sh && streamlit run dvh-app2.py`2020-06-05T17:33:37.916979+00:00 app[web.1]: Found invalid character in key name: '['. Try quoting the key name. (line 1 column 2 char 1)
2020-06-05T17:33:38.070801+00:00 heroku[web.1]: Process exited with status 255
2020-06-05T17:33:38.122656+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-05T17:34:17.202049+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=young-fjord-43109.herokuapp.com request_id=0bc3422d-0718-4741-a062-dcd941990312 fwd="110.227.109.220" dyno= connect= service= status=503 bytes= protocol=https
2020-06-05T17:34:18.031087+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=young-fjord-43109.herokuapp.com request_id=c480e478-484c-417a-8b31-5a6c42128b6f fwd="110.227.109.220" dyno= connect= service= status=503 bytes= protocol=https

我的setup.sh文件如下:

mkdir -p ~/.streamlit/

echo “\
[general]\n\
email = \”xxx@gmail.com\”\n\
“ > ~/.streamlit/credentials.toml

echo “\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
“ > ~/.streamlit/config.toml

我的Procfile如下:

sh setup.sh && streamlit run dvh-app2.py

我的requirements.txt文件如下:

streamlit==0.49.0
bokeh==2.0.1
pandas==0.24.2
numpy==1.17.3

1 个答案:

答案 0 :(得分:5)

好的,我自己弄清楚了: 问题出在我的setup.sh文件上。像这样重新格式化后:

mkdir -p ~/.streamlit

echo "[server]
headless = true
port = $PORT
enableCORS = false
" > ~/.streamlit/config.toml

工作正常,没有任何问题。