2016-11-15 151 views
0

我试图部署一个我在教程中找到的Python应用程序,但它无法启动。Bluemix Python应用程序启动失败

这是错误我得到:
0 1的情况下运行,1倒
0 1个实例上运行,1倒
0 1个实例上运行,1倒
0 1个实例运行,1下降1个实例
0运行,1向下
0 1个实例的运行时,1向下
0 1个实例的运行时,1向下
0 1个实例的运行时,1向下
0 1个实例的运行,1下跌运行1个实例 0,1开始1个实例
0运行,1向下
0 1个实例的运行时,1向下
0 1个实例的运行时,1向下
0 1个实例的运行时,1向下1个实例运行,1倒
0 1个实例运行,1失败

0失败
错误重新启动应用程序:启动不成功

这是应用程序:

import json 
from os.path import join, dirname 
from os import environ 
from watson_developer_cloud import VisualRecognitionV3 

visual_recognition = VisualRecognitionV3(VisualRecognitionV3.latest_version, api_key='myapikey') 

with open(join(dirname(__file__), 'hearts.zip'), 'rb') as hearts, \ 
    open(join(dirname(__file__), 'diamonds.zip'), 'rb') as diamonds, \ 
    open(join(dirname(__file__), 'clubs.zip'), 'rb') as clubs, \ 
    open(join(dirname(__file__), 'spades.zip'), 'rb') as spades : 
print "Uploading files..." 
print(json.dumps(visual_recognition.create_classifier('Suits', \ 
    hearts_positive_examples=hearts, \ 
    diamonds_positive_examples=diamonds, \ 
    clubs_positive_examples=clubs, \ 
    spades_positive_examples=spades), indent=2)) 

日志:

API/1App实例退出,GUID 3ae2d9a1-28d9-47af-a7b4-2e311bd763af有效载荷:{ “cc_partition”=> “缺省”, “液滴”=>“3ae2d9a1-28d9 -47af-a7b4-2e311bd763af“,”version“=>”948e02de-d579-4058-8e89-8573af7ca886“,”instance“=>”2f471496fee143cea8e95eb16a05c9e6“,”index“=> 0,”reason“=>”CRASHED“ “exit_status”=> 1,“exit_description”=>“无法启动”,“crash_timestamp”=> 1479457233} 2016-11-18T10:20:33.805 + 0200
API/1App实例已退出,并使用guid 3ae2d9a1-28d9-47af -a7b4-2e311bd763af payload:{“cc_partition”=>“default”,“droplet”=>“3ae2d9a1-28d9-47af-a7b4-2e311bd763af”,“version”=>“948e02de-d579-4058-8e89-8573af7ca886”, “出师表ance“=>”2f471496fee143cea8e95eb16a05c9e6“,”index“=> 0,”reason“=>”CRASHED“,”exit_status“=> 1,”exit_description“=>”app instance exited“,”crash_timestamp“=> 1479457233} 2016 -11-18T10:20:33.805 + 0200
DEA/154使用guid启动应用实例(索引0)3ae2d9a1-28d9-47af-a7b4-2e311bd763af2016-11-18T10:20:26.727 + 0200
API/4App实例退出guid 3ae2d9a1-28d9-47af-a7b4-2e311bd763af payload:{“cc_partition”=>“default”,“droplet”=>“3ae2d9a1-28d9-47af-a7b4-2e311bd763af”,“version”=>“948e02de-d579-4058 “exit_status”=> 1,“exit_description”=>“应用程序实例退出”,“退出应用程序实例”,“退出应用程序实例” crash_timestamp“=> 1479457126} 2016-11-18T10:18:46.849 + 0200
DEA/186使用guid启动应用实例(索引0)3ae2d9a1-28d9-47af-a7b4-2e311bd763af2016-11-18 T10:18:41.744 + 0200
使用guid退出API/5App实例3ae2d9a1-28d9-47af-a7b4-2e311bd763af有效内容:{“cc_partition”=>“default”,“droplet”=>“3ae2d9a1-28d9-47af-a7b4 2e311bd763af“,”version“=>”948e02de-d579-4058-8e89-8573af7ca886“,”instance“=>”0c345d386b924d949255d7a8de0482bc“,”index“=> 0,”reason“=>”CRASHED“,”exit_status“=” > 1,“exit_description”=>“应用程序实例退出”,“crash_timestamp”=> 1479457067} 2016-11-18T10:17:47.179 + 0200
DEA/133启动应用程序实例(索引0)3ae2d9a1-28d9-47af -a7b4-2e311bd763af2016-11-18T10:17:41。725 + 0200
使用guid退出API/9App实例3ae2d9a1-28d9-47af-a7b4-2e311bd763af有效内容:{“cc_partition”=>“default”,“droplet”=>“3ae2d9a1-28d9-47af-a7b4-2e311bd763af”, “version”=>“948e02de-d579-4058-8e89-8573af7ca886”,“instance”=>“7a8caf7bea6b4de6a45cce7cdc601ded”,“index”=> 0,“reason”=>“CRASHED”,“exit_status”=> 1, exit_description“=>”app instance exited“,”crash_timestamp“=> 1479457006} 2016-11-18T10:16:46.720 + 0200
DEA/201启动应用实例(索引0),带guid 3ae2d9a1-28d9-47af-a7b4-2e311bd763af2016 -11-18T10:16:41.710 + 0200
使用guid退出API/3App实例3ae2d9a1-28d9-47af-a7b4-2e311bd763af payload:{“cc_partition”=>“default”,“droplet”=>“3ae2d9a1-28d9- 47af-a7b4-2e311bd763af“,”version“=>”948e02de-d579-4058-8e89-8573af7ca886“,”instance“=>”af4e6ebb4787454b99fdbedef268f5e9“,”index“=> 0,”reason“=>”崩溃“,”exit_status“=> 1,”exit_description“=>”应用程序实例退出“,”crash_timestamp“=> 1479456961} 2016-11-18T10:16:01.387 + 0200
DEA/145启动应用程序实例(索引0)与guid 3ae2d9a1-28d9-47af-a7b4-2e311bd763af2016-11-18T10:15:55.778 + 0200
API/0带有guid的已更新应用程序3ae2d9a1-28d9-47af-a7b4-2e311bd763af({“state”=>“STARTED”})

+0

在将问题发布到堆栈溢出之前,您应该删除您的api_key。现在它已发布到此处,您应该请求一个新的API密钥。 –

+0

你可以发布你的日志? –

+0

@DanielGrim下次我一定会把它藏起来,非常感谢 –

回答

1

Bluemix正在对您的应用程序运行运行状况检查,希望它正在侦听由$PORT环境变量指定的端口。由于您的应用程序不在监听此端口,并且因为它完成执行和退出,Bluemix认为您的应用程序崩溃了,这就是为什么它显示无法启动。

如果您运行cf logs <app name> --recent,用您的应用程序的名称替换<app name>,则应该在日志中看到您的print语句的输出。

如果要在Bluemix上运行此类应用程序,可以使用cf push <app name> --no-route来指定应用程序不会侦听$PORT环境变量中指定的端口。您还需要以某种方式修改代码,以确保它在这些打印语句执行后继续运行(例如:在末尾添加无限循环)。这将允许Bluemix将您的应用程序视为处于运行状态,并且可通过cf logs <app name> --recent命令获得应用程序的输出。

+0

尝试使用--no-route运行它仍然是同样的问题。还cf日志 - 最近给我“错误拨号trafficcontroller服务器”,所以我不能以这种方式得到日志。获取日志的唯一方法是使用bluemix中的应用程序。 –

+0

您发布的错误日志只是在每次尝试启动时显示应用程序崩溃,在临时任务完成后,日志中可能会有更多有用的信息进一步回溯到日志中。 –

相关问题