oracledb-contrib node not working in http request/response flow (no response object)

590 views
Skip to first unread message

ctlem...@gmail.com

unread,
Apr 17, 2018, 5:01:39 AM4/17/18
to Node-RED
I have installed oracle client & oracledb on my node-red host, I have installed the node node-red-contrib-oracledb in the node palette.
I can use the oracle node to select information from an Oracle database.

I now want to create a resftul webservice (web request by a url parameter passing an id to the oracle node, and outputting the results as json string to a http response).
This is not working. Node-red always tells me "no response object" and the webclient never ends properly & keeps running without getting a response.
The debug node does show the correct information so the oracle db node is working & retrieving the data correctly, but the flow is not returning it to a http response.

Is this a problem of my flow or is this a bug of the node-red-contrib-oracledb  node?



Nick O'Leary

unread,
Apr 17, 2018, 5:04:10 AM4/17/18
to Node-RED Mailing List
Hi,

Somewhere in your flow, the msg.res property is being lost.

From that screenshot, there are two possible places - the Oracle node or your Function node. Before we can say its the Oracle node, you should check your Function node isn't responsible.

Nick

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/10002678-abb1-4e76-9427-db07dee21242%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ctlem...@gmail.com

unread,
Apr 17, 2018, 5:16:26 AM4/17/18
to Node-RED
The content of the function node is :

msg.payload =  [msg.payload.empsapnr];
return msg;


Nick O'Leary

unread,
Apr 17, 2018, 5:17:49 AM4/17/18
to Node-RED Mailing List
In which case, yes, it appears the oracle node is dropping msg.res and breaking your flow.

Nick

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Apr 17, 2018, 5:28:47 AM4/17/18
to node...@googlegroups.com
To workaround this you could save msg.res to a flow context var in your fn node and put another fn node after the json node that adds it back into the message.

Colin

ctlem...@gmail.com

unread,
Apr 17, 2018, 5:29:48 AM4/17/18
to Node-RED
Thank you, is there any way to fix this myself, or should I try to contact the node contributor?


On Tuesday, April 17, 2018 at 11:17:49 AM UTC+2, Nick O'Leary wrote:
In which case, yes, it appears the oracle node is dropping msg.res and breaking your flow.

Nick
On 17 April 2018 at 10:16, <ctlem...@gmail.com> wrote:
The content of the function node is :

msg.payload =  [msg.payload.empsapnr];
return msg;


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

ctlem...@gmail.com

unread,
Apr 17, 2018, 6:06:16 AM4/17/18
to Node-RED
Apparently this issue was already raised on the Github for the oracle node:

ctlem...@gmail.com

unread,
Apr 17, 2018, 7:52:45 AM4/17/18
to Node-RED
The problem was fixed by Colin's approach:

 

Nick O'Leary

unread,
Apr 17, 2018, 7:54:44 AM4/17/18
to Node-RED Mailing List
Just be aware that this workaround means you can only have one active request at any time. If two requests arrive, the second one will overwrite the req/res properties in flow context and the first request will send its response to the second request...

Nick

On 17 April 2018 at 12:52, <ctlem...@gmail.com> wrote:
The problem was fixed by Colin's approach:

 

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

ctlem...@gmail.com

unread,
Apr 17, 2018, 8:11:03 AM4/17/18
to Node-RED
OK... so that is no solution at all :(

Colin Law

unread,
Apr 17, 2018, 9:09:31 AM4/17/18
to node...@googlegroups.com
Good point.  That makes it a little trickier.  I see from the issue report that the problem has been fixed but presumably not released. So if you install the node directly from github then it should be ok. Something like this should do it I think (with -g if you need to install as global, which I see is suggested in the readme)

npm install git://github.com/abreits/node-red-contrib-oracledb.git

Colin

ctlem...@gmail.com

unread,
Apr 17, 2018, 9:25:41 AM4/17/18
to Node-RED
I see that nick asked the node contributor to update the package in npm to be able to do this with the palette functions. I see the update in npm, but not in the palette yet. Let's wait a while.
Thanks for all the help. 

ctlem...@gmail.com

unread,
Apr 17, 2018, 10:12:13 AM4/17/18
to Node-RED
Updated node-red-contrib-oracledb to 0.5.0, but the http request/response nodes are still not returning a response object. Posted that to github too.




ctlem...@gmail.com

unread,
Apr 18, 2018, 4:55:57 AM4/18/18
to Node-RED
I checked the bin\oracledb.js file for version 0.5.0, but the changes to pass the msg object inside these functions that were done by an intermediate update are not anymore in version 0.5.0...

Colin Law

unread,
Apr 18, 2018, 6:13:28 AM4/18/18
to node...@googlegroups.com
On npm [1] it says the latest is 0.5.0 but on github [2] package.json is still showing 0.4.2 so something is not right somewhere.

Colin


On 18 April 2018 at 09:55, <ctlem...@gmail.com> wrote:
I checked the bin\oracledb.js file for version 0.5.0, but the changes to pass the msg object inside these functions that were done by an intermediate update are not anymore in version 0.5.0...

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Nick O'Leary

unread,
Apr 18, 2018, 6:16:02 AM4/18/18
to Node-RED Mailing List
My guess is the maintainer (who in previous comments has said their time is limited to maintain the node), has updated package.json locally and published without having pulled down the latest code on github that includes the fix.

An easy mistake to make when trying to do something in a rush - I know I have.

Nick



ctlem...@gmail.com

unread,
Apr 18, 2018, 7:41:52 AM4/18/18
to Node-RED
The maintainer has now updated once again, I will check the new version later this afternoon and post back the results.

ctlem...@gmail.com

unread,
Apr 18, 2018, 8:43:08 AM4/18/18
to Node-RED

I can confirm now that version 0.5.1 fixes the problem and now passes the original message correctly.
Http request/response nodes can now be used correctly in combination with the oracledb node.

Thanks everybody for the quick help & analysis. Keep up the good work!

Reply all
Reply to author
Forward
0 new messages