0

Trying to use Watson Document Conversion service from Node-Red with following payload setup and to feed into 'Convert' node, it always returns "Error: Lost connect to server". I'd think the setup is right per the document, but hardly find a way to make it works.

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":["*"]
   }
}

Could someone provides help/advise for this? Thank you so much in advance!

Here is information from the command "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}
hardillb
  • 54,545
  • 11
  • 67
  • 105
nyker
  • 57
  • 4

2 Answers2

1

Problem was indeed with the node and not with your code. It has been fixed and will be soon published to NPM, make sure that you restart Node-RED in order to get the last version of the Watson nodes.

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

Edit: Released in 0.4.8

Arlemi
  • 413
  • 5
  • 10
0

This is most likely a problem with a http proxy, make sure you access the site via HTTPS

EDIT:

This looks like a problem in the document conversion node, you should raise a issue on their github page (github.com/watson-developer-cloud/node-red-node-watson) and include the log output.

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • After via https, same problem. Do you have a sample code which working for you to share? – nyker Jul 14 '16 at 01:13
  • To be clear I mean access Node-RED via. If this still fails then you will need to update your question with the Node-RED logs (`cf logs `) so we can see what is causing it to crash – hardillb Jul 15 '16 at 09:53
  • Great, here is logs, it seems the call crashing the server itself and make it to restart afterward. Please reference orginal question and i modified it to add logs when issue happened. – nyker Jul 15 '16 at 18:09
  • This looks like a problem in the document conversion node, you should raise a issue on their github page (https://github.com/watson-developer-cloud/node-red-node-watson) and include the log output. – hardillb Jul 15 '16 at 18:18