new JSON Reader in KNIME 4.4

Hello Community!
I read a json output from an internal http Adress. For the Request I must specify some parameters like
http://…index.php?key=XYZ&format=json
With the new JSON Reader I get an error, that the specific file ‘…/index.php’ does not exists. Calling index.php without the parameter will result in a http error 500 internal server error. The JSON Reader Node does not execute and shows the error "Execute failed. The specified file /…index.php does not exists. I asume this error is because of the http-500 error if I call index.php without parameters. Is there a work around?

thanks in advance
Matthias

Hello @Matthias_W,

and prior to v4.4. you were able to read JSON from same source as expected?

Br,
Ivan

1 Like

Hello @ipazin ,
yes, in v4.3 everything worked as expected. I entered the URL as String and did receive the JSON Data.
This is my current work around, leaving the JSON Reader (depreciated) untouched.
thanks
Matthias

1 Like

Hello @Matthias_W,

Have you tried to change the Input Location->Read from-> Custom/KNIME URL ? This should allow you to read a JSON file from a URL.

The JSON Reader in 4.4 uses the new file handling framework which introduces additional options related to the file (KNIME File Handling Guide).

Regards,
Moditha

3 Likes

I did not mention this, because this works fine. I use a node to make a path variable out of the string variable and forward it to the JSON node.
Thanks for your time & effort
Matthias

Hello @Matthias_W,

did you select Custom/KNIME URL when creating path flow variable from string flow variable? I assume you are using String to Path (Variable) node. If not which one are you using?

Br,
Ivan

Hello @ipazin !
Sorry for the late reply to your question. Here is my workflow with the old node and the not working new one:

As you see, I am using (as you asumed) String to Path (Variable) node. You also see, the old JSON Reader is working, the new claimes, that the index.php file des not exist.
best regards
Matthias

Hello @Matthias_W,

I see. Can you share configuration picture of your String to Path (Variable) node?

Br,
Ivan

Dear @ipazin
here you go:

1 Like

The string rest…_json contains something like:
http://abc.intern.<ourservername>.at/reportserver/index.php?user=XZY&ID=ABC

Hi @Matthias_W,

tnx. Seems everything is configured properly. One more thing to clarify. If you are not using flow variable in new JSON Reader node are you getting same error or it works as expected?

Br,
Ivan

Hy @ipazin !
If I paste the flow variable directly in the browser, I get a JSON result (So it is working). If I past the same string as text - instead of a flow variable - it results in the same error. So this is not a issue of using the flow variable.
thanks in advanced
Matthias

Hello @Matthias_W,

tnx for confirmation. Have opened up a ticket (Internal reference: AP-17329) for someone to take a deeper look at it. Upon news someone will update this topic.

Although you have a workaround by using deprecated JSON Reader another option might be GET Request node.

Br,
Ivan

Perfekt!
Thanks for your help
Matthias

1 Like

Hi @Matthias_W,

We are trying to reproduce the issue and it seems like something specific that happens with the URL that you are trying to read from.
Could you please run this command in your terminal with the actual URL and let us know the output?

curl -v -X GET "<your URL>"
1 Like

Hello @Moditha!
Here we go. I did 2 get requests. One with the parameter and one up to index.php.
For security reason I had to remove names, IP-Adr, and some of the parameters.
In the first request I get the JSON result set (which I truncated)

C:\Users\ABC>curl -v -X GET “http://XXX.YYY.ZZZ.at/reportserver/reportserver/httpauthexport/index.php?user=ABC&apikey=XXX&key=XXX&format=json&download=false&…”
Note: Unnecessary use of -X or --request, GET is already inferred.

  • Trying 10.X.X.x…
  • TCP_NODELAY set
  • Connected to XXX.YYY.ZZZ.at (10.X.X.x) port 80 (#0)

GET /reportserver/reportserver/httpauthexport/index.phpuser=WEM&apikey=XXX&key=XXX&format=json&download=false&…
HTTP/1.1
Host: XXX.YYY.ZZZ.at
User-Agent: curl/7.55.1
Accept: /

< HTTP/1.1 200 OK
< Content-Disposition: inline; filename=“202108130937_X_Y - A_B.json”; filename*=UTF-8’'202108130937%5FX%5FY%20%2D%20A%5FB%2Ejson
< Content-Length: 4233
< Content-Type: application/json;charset=UTF-8
< Date: Fri, 13 Aug 2021 09:37:48 GMT
< Set-Cookie: JSESSIONID=69AF861420F740121D1779B86F5D33B8; Path=/reportserver; HttpOnly
<
[{“firmanr”:1234,“Stichtag”:“2018-06-30”,“Umsatz”:123456000,…

C:\Users\ABC>curl -v -X GET “http://XXX.YYY.ZZZ.at/reportserver/reportserver/httpauthexport/index.php
Note: Unnecessary use of -X or --request, GET is already inferred.

  • Trying 10.X.X.XXX…
  • TCP_NODELAY set
  • Connected to XXX.YYY.ZZZ.at (10.X.X.x) port 80 (#0)

GET /reportserver/reportserver/httpauthexport/index.php HTTP/1.1
Host: reportserver.intern.ffg.at
User-Agent: curl/7.55.1
Accept: /

< HTTP/1.1 500 Internal Server Error
< Content-Language: en
< Content-Length: 2201
< Content-Type: text/html;charset=utf-8
< Date: Fri, 13 Aug 2021 09:38:45 GMT
<
<!doctype html>HTTP Status 500 – Internal Server Error…

HTTP Status 500 – Internal Server Error


…* Connection #0 to host XXX.YYY.ZZZ.at left intact

One thing I just found: I did a curl without surrounding "
e.g. curl - v http://XXX.YYY.ZZZ.at&user=ABC&apikey …
→ the curl command truncted the call at the first & which resulted in the same 500 error, as without parameters.
Maybe this helps
best regards
Matthias

Hello @Moditha !
Did you find out something about the failing request of the new JSON Reader?
The old one is deprecated, the new one is still not working in KNIME 4.5
thanks for a reply!
Matthias

Hello @ipazin, hello @Moditha !
I haven’t heard from you for awhile. Is there an update on this issue?
Thanks
Matthias

Hello @Matthias_W,

don’t know and can’t check unfortunately as I’m not in a role I used to be. Hope you’ll get some response.

Br,
Ivan