【发布时间】:2021-08-16 23:09:30
【问题描述】:
这个小容器在通过 Heroku CLI 手动部署时运行良好。只有当我尝试让 Github 执行此操作时,此错误才会出现在发布阶段:
2021-05-28T17:17:39.000000+00:00 app[api]: Build succeeded
2021-05-28T17:17:39.901704+00:00 app[api]: Starting process with command `/bin/sh -c 'if curl $HEROKU_RELEASE_LOG_STREAM --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then
2021-05-28T17:17:39.901704+00:00 app[api]: chmod u+x /tmp/log-stream
2021-05-28T17:17:39.901704+00:00 app[api]: /tmp/log-stream /bin/sh -c '"'"'app.py'"'"'
2021-05-28T17:17:39.901704+00:00 app[api]: else
2021-05-28T17:17:39.901704+00:00 app[api]: app.py
2021-05-28T17:17:39.901704+00:00 app[api]: fi'` by user charlesdwright@gmail.com
2021-05-28T17:17:56.070039+00:00 heroku[release.1657]: Starting process with command `/bin/sh -c 'if curl https://heroku-release-output.s3.amazonaws.com/log-stream?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3LIQ2SWG7V76SVQ%2F20210528%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210528T171739Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=3ee907467ee7082624e2521c3a9b2abd5dc10b05bb0e90386e48a1064fef375e --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then
2021-05-28T17:17:56.703967+00:00 heroku[release.1657]: State changed from starting to up
2021-05-28T17:17:58.397549+00:00 heroku[release.1657]: Process exited with status 1
2021-05-28T17:17:58.482629+00:00 heroku[release.1657]: State changed from up to complete
2021-05-28T17:17:58.335854+00:00 app[release.1657]: File "/bin/sh", line 1
2021-05-28T17:17:58.335867+00:00 app[release.1657]: SyntaxError: Non-UTF-8 code starting with '\x9c' in file /bin/sh on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
2021-05-28T17:17:59.747839+00:00 app[api]: Release v29 command failed by user blah@yadda.com
-
搜索
fi'的代码,一无所获。 -
已纠正 Intellij 在代码上抛出的所有警告。
-
已将此:
#coding=utf-8添加到 .py 文件中。 -
总体上梳理了 Stackoverflow 和 Web。
不确定日志中引用的 /bin/sh 文件在哪里(它不驻留在容器中),似乎是 Heroku 的东西。但是当然,当我尝试在那里开票时,他们会在这里推荐我,因为它是一个免费的应用程序。
提前感谢任何线索。
【问题讨论】:
标签: python-3.x docker flask heroku