简体   繁体   中英

I got an error while Bluemix was deploying a python flask project

I added bootstrap .css and .js files into my project in GitHub. At Bluemix, the build process is successfully done, but the deploy is not. I got an error, and here are the deploying process logs:

Started by user cemalturkoglu
Building remotely on jenkins-deploy-slave-eda13aeb1278 (.*Deploy) in workspace /home/jenkins/workspace/44919572-1001-f01d-cdb7-8de2ad9d78a6/a904f930-8fef-42ac-97af-0b2e80cc3743
Unable to access upstream artifacts area /jenkins/jobs/44919572-1001-f01d-cdb7-8de2ad9d78a6/jobs/49689c68-d0d9-4488-9113-6b9603542bc6/builds/2015-10-27_19-53-32/archive. Does source project archive artifacts?
Downloading artifacts ...
DOWNLOAD SUCCESSFUL
Total time: 2 seconds
[a904f930-8fef-42ac-97af-0b2e80cc3743] $ /bin/bash /tmp/hudson1326255167701331280.sh
+ cat /etc/lsb-release /etc/os-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
NAME="Ubuntu"
VERSION="14.04.2 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.2 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
+ cf --version
/usr/bin/cf-orig/cf version 6.7.0-IDS-2014-12-04T10:56:46+00:00
+ echo 'Target: https://api.ng.bluemix.net'
Target: https://api.ng.bluemix.net
+ source _deploy.sh
++ cf push itucsdb1525
Using manifest file /home/jenkins/workspace/44919572-1001-f01d-cdb7-8de2ad9d78a6/a904f930-8fef-42ac-97af-0b2e80cc3743/manifest.yml

Updating app itucsdb1525 in org turkogluc@itu.edu.tr / space dev as turkogluc@itu.edu.tr...
OK

Using route itucsdb1525.mybluemix.net
Uploading itucsdb1525...
Uploading app files from: /home/jenkins/workspace/44919572-1001-f01d-cdb7-8de2ad9d78a6/a904f930-8fef-42ac-97af-0b2e80cc3743
Uploading 112.1K, 46 files


Done uploading
OK

Stopping app itucsdb1525 in org turkogluc@itu.edu.tr / space dev as turkogluc@itu.edu.tr...
OK

Starting app itucsdb1525 in org turkogluc@itu.edu.tr / space dev as turkogluc@itu.edu.tr...
-----> Downloaded app package (132K)
-----> Downloaded app buildpack cache (39M)
-------> Buildpack version 1.3.1
-----> Installing dependencies with pip
       You are using pip version 6.1.0.dev0, however version 7.1.2 is available.
       You should consider upgrading via the 'pip install --upgrade pip' command.
You are using pip version 6.1.0.dev0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
-----> Uploading droplet (39M)

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 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
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 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
0 of 1 instances running, 1 down
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 down
0 of 1 instances running, 1 failing
FAILED
Start unsuccessful

TIP: use 'cf logs itucsdb1525 --recent' for more information
Build step 'Execute shell' marked build as failure
Finished: FAILURE

in runtime logs :

10/28/2015 9:24:07 AM   ERR App * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
10/28/2015 9:58:09 AM   ERR App * Restarting with stat
10/28/2015 9:24:00 AM   OUT DEA Starting app instance (index 0) with guid 496de9a2-8ab4-4248-b988-5cb103c49631
10/28/2015 9:58:02 AM   OUT DEA Starting app instance (index 0) with guid 496de9a2-8ab4-4248-b988-5cb103c49631
10/28/2015 10:02:37 AM  OUT DEA Stopping app instance (index 0) with guid 496de9a2-8ab4-4248-b988-5cb103c49631
10/28/2015 9:57:47 AM   OUT STG -----> Uploading droplet (39M)
10/28/2015 9:59:45 AM   OUT DEA Starting app instance (index 0) with guid 496de9a2-8ab4-4248-b988-5cb103c49631
10/28/2015 10:06:38 AM  OUT API App instance exited with guid 496de9a2-8ab4-4248-b988-5cb103c49631 payload: {"cc_partition"=>"default", "droplet"=>"496de9a2-8ab4-4248-b988-5cb103c49631", "version"=>"0d251841-0184-4aab-8f3a-c6033e6d6cba", "instance"=>"ff29229ce4eb470c9dcad7d49d67b994", "index"=>0, "reason"=>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1446026798}
10/28/2015 9:58:09 AM   ERR App * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
10/28/2015 9:59:57 AM   ERR App * Restarting with stat
10/28/2015 9:57:34 AM   OUT STG You should consider upgrading via the 'pip install --upgrade pip' command.
10/28/2015 9:57:34 AM   ERR STG You should consider upgrading via the 'pip install --upgrade pip' command.
10/28/2015 9:59:09 AM   ERR DEA Instance (index 0) failed to start accepting connections
10/28/2015 9:57:09 AM   OUT API Updated app with guid 496de9a2-8ab4-4248-b988-5cb103c49631 ({"state"=>"STOPPED"})
10/28/2015 10:03:00 AM  OUT DEA Starting app instance (index 0) with guid 496de9a2-8ab4-4248-b988-5cb103c49631
10/28/2015 10:09:55 AM  OUT App 

Thanks for your help.

Problem may be related to hardcoded port number . Your log shows that server is listening on 5000.

10/28/2015 9:58:09 AM ERR App * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

When you are running your application on Bluemix, you can't request for a specific port . You have to use the port assigned for your application by the platform.

Please review : Flask code sample [1]

Port is defined here : [2]

[1] https://github.com/IBM-Bluemix/bluemix-python-flask-sample

[2] https://github.com/IBM-Bluemix/bluemix-python-flask-sample/blob/master/welcome.py#L28

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM