我正在尝试Bluemix中的物联网基础入门样板。以下是我要遵循的步骤:
在第2步之后,我已在日志中看到这些错误:
2015-05-14T16:05:10.31-0400 [App/0] OUT ←[34m[2015-05-14 20:05:10.316] [TRACE] [default] - ←[39m1 iot-2/type/+/id//evt/+/fmt/json
2015-05-14T16:05:10.31-0400 [App/0] OUT ←[34m[2015-05-14 20:05:10.316] [TRACE] [default] - ←[39mResubscribing:
2015-05-14T16:05:10.31-0400 [App/0] OUT ←[34m[2015-05-14 20:05:10.318] [TRACE] [default] - ←[39mRetry count = 1
2015-05-14T16:05:12.32-0400 [App/0] OUT ←[34m[2015-05-14 20:05:12.320] [TRACE] [default] - ←[39mCONNECTED......:
2015-05-14T16:05:12.32-0400 [App/0] OUT Subscription Count = 1
2015-05-14T16:05:12.32-0400 [App/0] OUT ←[34m[2015-05-14 20:05:12.320] [TRACE] [default] - ←[39m1 iot-2/type/+/id//evt/+/fmt/json
2015-05-14T16:05:12.32-0400 [App/0] OUT ←[34m[2015-05-14 20:05:12.320] [TRACE] [default] - ←[39mResubscribing:
2015-05-14T16:05:12.32-0400 [App/0] OUT ←[34m[2015-05-14 20:05:12.322] [TRACE] [default] - ←[39mRetry count = 1
2015-05-14T16:05:13.32-0400 [App/0] OUT ←[34m[2015-05-14 20:05:13.328] [TRACE] [default] - ←[39mCONNECTED......:
2015-05-14T16:05:13.32-0400 [App/0] OUT Subscription Count = 1
在错误发生后的第5步之后,我看到以下错误:
2015-05-14T16:05:17.35-0400 [App/0] OUT ←[34m[2015-05-14 20:05:17.355] [TRACE] [default] - ←[39m1 iot-2/type/+/id//evt/+/fmt/json
2015-05-14T16:05:17.35-0400 [App/0] OUT 14 May 20:05:17 - [red] Uncaught Exception:
2015-05-14T16:05:17.35-0400 [App/0] OUT 14 May 20:05:17 - Error: This method cannot be called until MQTT client has been initialized (see connectMqtt() method)
2015-05-14T16:05:17.35-0400 [App/0] OUT at IoTAppClient.checkMqtt (/home/vcap/app/node_modules/node-red-contrib-scx-ibmiotapp/node_modules/iotclient/application/IoTAppClient.
js:340:9)
2015-05-14T16:05:17.35-0400 [App/0] OUT at MqttClient.<anonymous> (/home/vcap/app/node_modules/node-red-contrib-scx-ibmiotapp/node_modules/iotclient/application/IoTAppClient.
js:120:9)
2015-05-14T16:05:17.35-0400 [App/0] OUT at MqttClient.emit (events.js:117:20)
2015-05-14T16:05:17.35-0400 [App/0] OUT at MqttClient._handleConnack (/home/vcap/app/node_modules/node-red-contrib-scx-ibmiotapp/node_modules/iotclient/node_modules/mqtt/lib/
client.js:521:10)
2015-05-14T16:05:17.35-0400 [App/0] OUT at Connection.<anonymous> (/home/vcap/app/node_modules/node-red-contrib-scx-ibmiotapp/node_modules/iotclient/node_modules/mqtt/lib/cli
ent.js:191:10)
2015-05-14T16:05:17.35-0400 [App/0] OUT at Connection.emit (events.js:95:17)
2015-05-14T16:05:17.35-0400 [App/0] OUT at Connection._write (/home/vcap/app/node_modules/node-red-contrib-scx-ibmiotapp/node_modules/iotclient/node_modules/mqtt/lib/connecti
on.js:176:12)
2015-05-14T16:05:17.35-0400 [App/0] OUT at doWrite (_stream_writable.js:226:10)
2015-05-14T16:05:17.35-0400 [App/0] OUT at writeOrBuffer (_stream_writable.js:216:5)
2015-05-14T16:05:17.35-0400 [App/0] OUT at Connection.Writable.write (_stream_writable.js:183:11)
2015-05-14T16:05:17.35-0400 [App/0] OUT at write (_stream_readable.js:602:24)
2015-05-14T16:05:17.35-0400 [App/0] OUT at flow (_stream_readable.js:611:7)
2015-05-14T16:05:17.38-0400 [App/0] ERR
2015-05-14T16:05:17.41-0400 [RTR] OUT testiotsd.mybluemix.net - [14/05/2015:20:04:40 +0000] "GET /red/comms HTTP/1.1" 101 0 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Ge
cko/20100101 Firefox/31.0" 75.126.70.46:60509 x_forwarded_for:"75.126.70.46" vcap_request_id:231a532e-d89e-4236-49e7-7d00a803cd18 response_time:MissingFinishedAt app_id:4cc323b6-d2
48-4fd3-b8ac-c046539a6c2b
2015-05-14T16:05:17.48-0400 [API] OUT App instance exited with guid 4cc323b6-d248-4fd3-b8ac-c046539a6c2b payload: {"cc_partition"=>"default", "droplet"=>"4cc323b6-d248-4fd3-b8a
c-c046539a6c2b", "version"=>"2778c52b-ac6d-4845-8077-761927982233", "instance"=>"288976a131434a34b033c7d1fd0e812e", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_descrip
tion"=>"app instance exited", "crash_timestamp"=>1431633917}
现在,如果我重新启动应用程序,一切正常。但是我每次都可以通过以下步骤一致地重新创建上述场景:
需要帮助弄清楚为什么会发生这种情况以及如何预防。
由于
答案 0 :(得分:1)
沙希尔
已经在Bluemix的npmjs和Internet of Things Foundation Starter样板中上传了一个永久修复程序,它解决了这个问题。