mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
212 stars 196 forks source link

Security token haven't renewed #662

Open RudolfTheRedNode opened 7 months ago

RudolfTheRedNode commented 7 months ago

Hi @mikakaraila and All,

I got an issue my connection to opc UA suddenly got error like this. can anyone help me regarding this issue.

image

Best regards, Kenneth

mikakaraila commented 7 months ago

Are reading with interval that is more than token / session timeout? A bit more information when this happens would help to give more advices.

RudolfTheRedNode commented 7 months ago

The interval for request is every 1 second, using the trigger node.

On Fri, Feb 9, 2024 at 1:48 PM Mika Karaila @.***> wrote:

Are reading with interval that is more than token / session timeout? A bit more information when this happens would help to give more advices.

— Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/662#issuecomment-1935370748, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFXOJHIFWKSHY26R3HGD7GDYSW2DDAVCNFSM6AAAAABC7DOCECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGM3TANZUHA . You are receiving this because you authored the thread.Message ID: @.***>

mikakaraila commented 7 months ago

Hmm, still not enough context to help you... Is this happening immediately or after some minutes?

RudolfTheRedNode commented 7 months ago

Hi @mikakaraila,

Sorry to let you think hard, it turns out that the problem is the device not responding well ^^,

But I got a new scenario now that after reading so many nodes, I got a delay of around 2s to 4s then it will read again. Is this normal or a bug?

mikakaraila commented 7 months ago

Hmm, it can be that device cannot response faster. One reason I normally use subscription to get just updated values.

Another solution would be to split read smaller sizes. Critical data with 1s interval, less with 3s interval etc. or some meta data only when flow is started or just once a minute.

RudolfTheRedNode commented 7 months ago

Hi @mikakaraila ,

Thanks for advise but now I get this message from the console.

09:01:17.723Z :client_session_impl :709 [NODE-OPCUA-W21] Pending transactions: ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest ReadRequest 09:01:17.724Z :client_session_impl :710 [NODE-OPCUA-W22] Warning : your opcua client is sending multiple requests simultaneously to the server ReadRequest ... please fix your application code

What could be the solution for this?

mikakaraila commented 7 months ago

Are you using multiple client nodes? Use just one!

Now you inject multiple parallel read requests to server.

RudolfTheRedNode commented 7 months ago

Hi @mikakaraila,

This is my flow shown below. then I got the error which is shown below:

image

20 Feb 16:51:01 - [error] [OpcUa-Client:AMS OPC Client WRITE] Client node error on: AMS OPC Client WRITE error: ["Write multiple as array session is not active!"] 20 Feb 16:51:01 - [error] [OpcUa-Client:AMS OPC Client WRITE] Client node error on: AMS OPC Client WRITE error: ["Write multiple as array session is not active!"] 20 Feb 16:51:01 - [error] [OpcUa-Client:AMS OPC Client WRITE] Client node error on: AMS OPC Client WRITE error: ["Write multiple as array session is not active!"] 21 Feb 04:11:15 - [error] [OpcUa-Client:AMS OPC Client] Client node error on: AMS OPC Client error: ["AMS OPC Client error at active reading: Connection Break"] 21 Feb 04:11:15 - [error] [OpcUa-Client:AMS OPC Client] Client node error on: AMS OPC Client error: ["AMS OPC Client error at active reading: Invalid Channel BadConnectionClosed"] 21 Feb 04:11:15 - [error] [OpcUa-Client:AMS OPC Client] Client node error on: AMS OPC Client error: ["AMS OPC Client error at active reading: Invalid Channel BadConnectionClosed"] 21 Feb 04:11:15 - [error] [OpcUa-Client:AMS OPC Client] Client node error on: AMS OPC Client error: ["AMS OPC Client error at active reading: Invalid Channel BadConnectionClosed"] 21 Feb 04:11:15 - [error] [OpcUa-Client:AMS OPC Client] Client node error on: AMS OPC Client error: ["AMS OPC Client error at active reading: Invalid Channel BadConnectionClosed"]