在节点红色中使用带有html的文档转换时,获取错误:丢失与服务器的连接

时间:2016-07-10 15:44:16

标签: ibm-cloud node-red document-conversion

尝试使用Node-Red中的Watson文档转换服务并进行以下有效负载设置并输入'转换节点,它始终返回"错误:丢失连接到服务器" 。我认为document的设置是正确的,但很难找到使其有效的方法。

msg = {  
   payload:'http://www.nbcnews.com/tech/tech-news/got-parking-ticket-yup-there-s-app-n602566',
   normalized_html:{  
      "exclude_tags_completely":["script", "sup"],
      "exclude_tags_keep_content":["font", "em", "span"],
      "keep_content":{"xpaths":["//body/div[@id='content']"]},
      "exclude_content":{"xpaths":["//*[@id='footer']","//*[@id='navigation']"]},
      "keep_tag_attributes":["*"]
   }
}

有人可以为此提供帮助/建议吗?非常感谢你!

以下是来自命令" cf logs":

的信息
OUT 15 Jul 18:07:10 - [red] Uncaught Exception:
2016-07-15T14:07:10.92-0400 [App/0]      OUT 15 Jul 18:07:10 - TypeError: Cannot read property 'ext' of null
2016-07-15T14:07:10.92-0400 [App/0]      OUT     at /home/vcap/app/node_modules/node-red-node-watson/services/document_conversion/v1.js:76:23
2016-07-15T14:07:10.92-0400 [App/0]      OUT     at fs.js:334:14
2016-07-15T14:07:10.92-0400 [App/0]      OUT     at /home/vcap/app/node_modules/node-red/node_modules/fs-extra/node_modules/graceful-fs/graceful-fs.js:43:10
2016-07-15T14:07:10.92-0400 [App/0]      OUT     at FSReqWrap.oncomplete (fs.js:95:15)
2016-07-15T14:07:10.94-0400 [App/0]      ERR 
2016-07-15T14:07:10.94-0400 [RTR/0]      OUT xxxxxxxxx.mybluemix.net - [15/07/2016:18:06:54.207 +0000] "GET /red/comms HTTP/1.1" 101 0 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Firefox/45.0" 169.54.202.25:16319 x_forwarded_for:"70.104.132.164, 169.54.202.25" x_forwarded_proto:"http" vcap_request_id:e0eb77fb-8233-4f81-456a-4594e27f8009 response_time:16.741139964 app_id:245fccec-0a2b-406e-972d-59501a236cd6 x_global_transaction_id:"378048561"
2016-07-15T14:07:11.05-0400 [API/0]      OUT App instance exited with guid 245fccec-0a2b-406e-972d-59501a236cd6 payload: {"cc_partition"=>"default", "droplet"=>"245fccec-0a2b-406e-972d-59501a236cd6", "version"=>"c16f4838-a8b3-4e6c-8a5c-ce880f9ee23d", "instance"=>"e5deb0a3704e4f3e9108c4cf920d20f1", "index"=>0, "reason"=>"CRASHED", "exit_status"=>1, "exit_description"=>"app instance exited", "crash_timestamp"=>1468606031}

2 个答案:

答案 0 :(得分:1)

问题确实存在于节点而不是您的代码。 它已被修复并将很快发布到NPM,请确保重新启动Node-RED以获取Watson节点的最新版本。

参考:https://github.com/watson-developer-cloud/node-red-node-watson/pull/164

修改:Released in 0.4.8

答案 1 :(得分:0)

这很可能是http代理的问题,请确保您通过HTTPS访问该网站

编辑:

这看起来像文档转换节点中的一个问题,你应该在他们的github页面上引发一个问题(github.com/watson-developer-cloud/node-red-node-watson)并包含日志输出。