Data360 Analyze

 View Only
  • 1.  JSON Node Unexpected characters error

    Employee
    Posted 04-12-2021 17:14

    Hello,
    I have noticed this error occurred couple of times with our Data360 workflow.
    JSON node gets failed because of unexpected characters as per error message.This happens when Mobile Defect node(HTTP "GET method from URL) prior to JSON either takes longer time to make connection with ALM application API or incase when access is denied to alm. This error gets resolved by itself after couple of minutes or sometimes after 3-4 long hours. Is there any workaround to fix this error or something we could do to only feed good data to JSON node and avoid bad/unexpected characters data coming from API (HTTP node that is prior to JSON)?

    xecution Error: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number (or 'NaN'/'INF'/'+INF'), Array, Object or token 'null', 'true' or 'false') at [Source: (sun.nio.ch.ChannelInputStream); line: 1, column: 2] At Line 1, Column 2. com.lavastorm.brain.nodes.json.input.JsonDataNode.parseData(JsonDataNode.java:165) com.lavastorm.brain.nodes.ldr.StructuredDataNode.parseRecordData(StructuredDataNode.java:1546) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processMetadata(StructuredDataNode.java:1409) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processMultiMetadata(StructuredDataNode.java:1171) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processMultiPass(StructuredDataNode.java:877) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processAll(StructuredDataNode.java:730) com.lavastorm.brain.execution.java.node.NodeWrapper.nodeProcess(NodeWrapper.java:555) com.lavastorm.brain.execution.java.node.NodeWrapper.run(NodeWrapper.java:814) com.lavastorm.brain.execution.java.node.NodeWrapper.main(NodeWrapper.java:1653) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.lavastorm.util.app.SimpleAppWrapper.invokeMainMethod(SimpleAppWrapper.java:115) com.lavastorm.util.app.SimpleAppWrapper.run(SimpleAppWrapper.java:143) com.lavastorm.util.app.AbstractAppWrapperFactory.main(AbstractAppWrapperFactory.java:57)

    Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number (or 'NaN'/'INF'/'+INF'), Array, Object or token 'null', 'true' or 'false') at [Source: (sun.nio.ch.ChannelInputStream); line: 1, column: 2] At Line 1, Column 2. com.lavastorm.brain.nodes.json.input.JsonDataNode.parseData(JsonDataNode.java:165) com.lavastorm.brain.nodes.ldr.StructuredDataNode.parseRecordData(StructuredDataNode.java:1546) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processMetadata(StructuredDataNode.java:1409) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processMultiMetadata(StructuredDataNode.java:1171) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processMultiPass(StructuredDataNode.java:877) com.lavastorm.brain.nodes.ldr.StructuredDataNode.processAll(StructuredDataNode.java:730) com.lavastorm.brain.execution.java.node.NodeWrapper.nodeProcess(NodeWrapper.java:555) com.lavastorm.brain.execution.java.node.NodeWrapper.run(NodeWrapper.java:814) com.lavastorm.brain.execution.java.node.NodeWrapper.main(NodeWrapper.java:1653) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) com.lavastorm.util.app.SimpleAppWrapper.invokeMainMethod(SimpleAppWrapper.java:115) com.lavastorm.util.app.SimpleAppWrapper.run(SimpleAppWrapper.java:143) com.lavastorm.util.app.AbstractAppWrapperFactory.main(AbstractAppWrapperFactory.java:57)

    Created:
    Apr 12, 2021 at 1:11:12 PM
    Error code:
    com.lavastorm.brain.nodes.json.input.JsonDataNode$LocationBasedExceptionProvider
     
     


  • 2.  RE: JSON Node Unexpected characters error

    Employee
    Posted 04-13-2021 05:29

    The API endpoint will return an HTTP status code alongside its response. The HTTP status code can be captured by specifying an output field within the HTTP node's StatusCodeOutputField property. If the API call was successful, it will return a code of 200. If it is returning an error, it will return a different code, such as 401 for unauthorized, 403 for forbidden or 500 for a generic API-side error. Specifying an output field for StatusMessageOutputField may also provide additional details for the error. Immediately after the HTTP node, you can add a Split or Filter node to separate the successful API calls.

     



  • 3.  RE: JSON Node Unexpected characters error

    Employee
    Posted 04-13-2021 06:03

    Thank you <x-zendesk-user data-user-name="Gerard Cafaro">364945807128</x-zendesk-user>. It's a wonderful idea to add a Split or Filter node to separate the successful API calls. Also, is there any way to view the bad data with codes 401,403 0r 500 and any workaround to fix this API  error code immediately? I see we have got a combination of status code output messages of 200 & 401.



  • 4.  RE: JSON Node Unexpected characters error

    Employee
    Posted 04-13-2021 06:37

    The HTTP 401 error looks like a username and password weren't provided to the endpoint. There are several ways to authenticate an API request, and a particular API may only support a subset of ways. The two most common ways is using the ServerUsername and ServerPassword properties within the HTTP node or using header-based authentication, which has varying syntax by API endpoint. Most commonly, this is set by adding a base64 representation of "username:password" (username and password may be literal or tokens, but the semicolon is always there) and then appending that to the string "Authorization: Basic ". For example, a user "sampleuser" and password "samplepassword" would become the string below. This is then inserted into the HTTP node's header property:

    Authorization: Basic c2FtcGxldXNlcjpzYW1wbGVwYXNzd29yZA==

    Although to answer your question more generically, if the Message field doesn't give enough details, for example, it just returns "invalid syntax," then checking the API response itself may contain more details. In the screenshot above, the response is written to a file, which can be read in via a subsequent node.

     



  • 5.  RE: JSON Node Unexpected characters error

    Employee
    Posted 04-13-2021 11:25

    I am not clear with the same API URL used in the HTTP node, why we got 2 different status code of 200 (good API call) and 401 (Bad request) at the same time? Also, we have used Authorization at HTTP node Header's property.



  • 6.  RE: JSON Node Unexpected characters error

    Employee
    Posted 04-13-2021 11:42

    Each record fed into the HTTP node will trigger its own API call. Does the header property come from a data flow property or a field? If it comes from a field, does the input match on all of the records? 



  • 7.  RE: JSON Node Unexpected characters error

    Employee
    Posted 04-13-2021 12:31

    We got error on HTTP node now (screenshot). I also notice slow API call performance this week with all our workflows. Sorry, I was wrong for this HTTP( mobile defects node)-2nd screenshot, we aren't using Authorization. Server username and password are coming from 1 credentials node then it goes to Sign-in node (3rd screenshot).Another thing is how to improvise API call performance?

    This error of 401 or any failure gets resolved by itself when I run again after 5-10 mins, this I am not understanding.