While using document conversion with html in node-red, getting Error: Lost connection to server

While using document conversion with html in node-red, getting Error: Lost connection to server

尝试通过以下负载设置使用 Node-Red 的 Watson 文档转换服务并将其馈送到 'Convert' 节点,它总是 returns "Error: Lost connect to server"。我认为根据 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":["*"]
   }
}

有人可以为此提供 help/advise 吗?提前致谢!

这是来自命令 "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}

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

编辑:

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

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

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

编辑:Released in 0.4.8