0

尝试使用来自 Node-Red 的 Watson Document Conversion 服务和以下有效负载设置并输入“Convert”节点,它总是返回"Error: Lost connect to server"。我认为按照文档的设置是正确的,但很难找到使它起作用的方法。

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}
4

2 回答 2

1

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

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

编辑:发布于 0.4.8

于 2016-07-21T07:33:00.047 回答
0

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

编辑:

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

于 2016-07-13T14:52:13.657 回答