我目前正在尝试将我的本地Django App推送到IBM Bluemix服务器。我正在使用Cloud-foundry来执行它和cf命令。
以下是我使用以下命令时遇到的错误: cf push my-app
$ python manage.py collectstatic --noinput
test os1913
55 static files copied to '/tmp/app/backoffice2/static'.
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (155M)
Uploaded droplet (223.8M)
Uploading complete
Destroying container
Successfully destroyed container
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful
我尝试使用cf日志来查看我的推送中的错误但是徒劳无功。您可以在下面看到此cf日志的结果。
2017-10-19T08:14:07.05+0000 [STG/0] OUT $ python manage.py collectstatic --noinput
2017-10-19T08:14:07.46+0000 [STG/0] OUT test os1913
2017-10-19T08:14:08.57+0000 [STG/0] OUT 55 static files copied to '/tmp/app/backoffice2/static'.
2017-10-19T08:16:37.61+0000 [STG/0] OUT Exit status 0
2017-10-19T08:16:37.61+0000 [STG/0] OUT Staging complete
2017-10-19T08:16:37.61+0000 [STG/0] OUT Uploading droplet, build artifacts cache...
2017-10-19T08:16:37.61+0000 [STG/0] OUT Uploading build artifacts cache...
2017-10-19T08:16:37.61+0000 [STG/0] OUT Uploading droplet...
2017-10-19T08:16:45.42+0000 [STG/0] OUT Uploaded build artifacts cache (155M)
2017-10-19T08:16:54.71+0000 [STG/0] OUT Uploaded droplet (223.8M)
2017-10-19T08:16:54.75+0000 [STG/0] OUT Uploading complete
2017-10-19T08:16:54.86+0000 [STG/0] OUT Destroying container
2017-10-19T08:16:57.68+0000 [STG/0] OUT Successfully destroyed container
2017-10-19T08:17:05.38+0000 [CELL/0] OUT Creating container
2017-10-19T08:17:06.47+0000 [CELL/0] OUT Successfully created container
2017-10-19T08:17:23.66+0000 [CELL/0] OUT Starting health monitoring of container
2017-10-19T08:17:25.93+0000 [APP/PROC/WEB/0] ERR bash: normal-start-command: No such file or directory
2017-10-19T08:17:25.93+0000 [APP/PROC/WEB/0] OUT Exit status 1
2017-10-19T08:17:25.97+0000 [CELL/0] OUT Exit status 0
2017-10-19T08:17:26.00+0000 [CELL/0] OUT Destroying container
2017-10-19T08:17:26.02+0000 [API/0] OUT Process has crashed with type: "web"
2017-10-19T08:17:26.03+0000 [API/0] OUT App instance exited with guid d470d027-d5c6-48e5-9883-c4e950e4c7b8 payload: {"instance"=>"93c5bc85-71b6-475b-486d-66e7", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>1, "crash_timestamp"=>1508401045980916586, "version"=>"81113fa3-598a-495c-97a8-2032968858cd"}
2017-10-19T08:17:27.99+0000 [CELL/0] OUT Successfully destroyed container
2017-10-19T08:17:35.12+0000 [CELL/0] OUT Creating container
2017-10-19T08:17:36.51+0000 [CELL/0] OUT Successfully created container
2017-10-19T08:17:56.99+0000 [CELL/0] OUT Starting health monitoring of container
2017-10-19T08:17:59.60+0000 [APP/PROC/WEB/0] ERR bash: normal-start-command: No such file or directory
2017-10-19T08:17:59.66+0000 [APP/PROC/WEB/0] OUT Exit status 1
2017-10-19T08:17:59.75+0000 [CELL/0] OUT Exit status 0
2017-10-19T08:17:59.78+0000 [CELL/0] OUT Destroying container
2017-10-19T08:17:59.80+0000 [API/1] OUT Process has crashed with type: "web"
2017-10-19T08:17:59.81+0000 [API/1] OUT App instance exited with guid d470d027-d5c6-48e5-9883-c4e950e4c7b8 payload: {"instance"=>"2c057e8c-0955-43e5-6e97-b61f", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>2, "crash_timestamp"=>1508401079759915860, "version"=>"81113fa3-598a-495c-97a8-2032968858cd"}
2017-10-19T08:18:01.75+0000 [CELL/0] OUT Creating container
2017-10-19T08:18:02.39+0000 [CELL/0] OUT Successfully destroyed container
2017-10-19T08:18:03.69+0000 [CELL/0] OUT Successfully created container
2017-10-19T08:18:29.97+0000 [CELL/0] OUT Starting health monitoring of container
2017-10-19T08:18:32.30+0000 [APP/PROC/WEB/0] ERR bash: normal-start-command: No such file or directory
2017-10-19T08:18:32.31+0000 [APP/PROC/WEB/0] OUT Exit status 1
2017-10-19T08:18:32.49+0000 [CELL/0] OUT Exit status 0
2017-10-19T08:18:32.50+0000 [CELL/0] OUT Destroying container
2017-10-19T08:18:32.52+0000 [API/2] OUT Process has crashed with type: "web"
2017-10-19T08:18:32.53+0000 [API/2] OUT App instance exited with guid d470d027-d5c6-48e5-9883-c4e950e4c7b8 payload: {"instance"=>"cb2d7d3c-6c89-4f4a-762f-054f", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>3, "crash_timestamp"=>1508401112496966489, "version"=>"81113fa3-598a-495c-97a8-2032968858cd"}
2017-10-19T08:18:34.87+0000 [CELL/0] OUT Successfully destroyed container
非常感谢您提前:))
答案 0 :(得分:0)
您需要有3个关键文件才能正确使用。第一个是manifest.yml,它设置了云代工构建包,第二个是requirements.txt,它定义了你的app依赖,第三个是runtime.txt,它声明了python版本。
其中一个是不对的。
答案 1 :(得分:0)
这是一篇展示Python + Django + Bluemix组合的文章 - https://www.ibm.com/developerworks/cloud/library/cl-worldbank-charting-app/index.html
你需要让manifest.yml正确。
请仔细阅读文章并希望它有所帮助。