Bluemix IoT Foundation Starter给出错误:与服务器的连接丢失

时间:2015-05-14 20:23:41

标签: ibm-cloud iot

我正在尝试Bluemix中的物联网基础入门样板。以下是我要遵循的步骤:

  1. 使用样板
  2. 创建新应用
  3. 应用程序启动后,我会转到URL并查看NodeRED主页
  4. 我点击按钮将我带到NodeRED编辑器
  5. 在另一个浏览器窗口中,我在此处提供了IoT传感器:https://quickstart.internetofthings.ibmcloud.com/iotsensor/启动并运行
  6. 我使用IoT传感器的地址配置“IoT App In Node”。我删除了“:”并将字母设为小写。
    1. 当我在NodeRED编辑器中单击Deploy时,我看到以下错误:“错误:丢失与服务器的连接”
  7. 在第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}
    

    现在,如果我重新启动应用程序,一切正常。但是我每次都可以通过以下步骤一致地重新创建上述场景:

    1. 从样板创建新应用
    2. 转到NodeRED编辑器
    3. 配置IoT in-node
    4. 部署
    5. 得到错误
    6. 停止并启动运行时
    7. 一切正常
    8. 需要帮助弄清楚为什么会发生这种情况以及如何预防。

      由于

1 个答案:

答案 0 :(得分:1)

沙希尔
已经在Bluemix的npmjs和Internet of Things Foundation Starter样板中上传了一个永久修复程序,它解决了这个问题。