node-red-contrib-opcua icon indicating copy to clipboard operation
node-red-contrib-opcua copied to clipboard

Reconnect problematic of opcua client

Open TheeeEnding opened this issue 11 months ago • 18 comments

Hey Mika, unfortunately I noticed a change from v0.2.320 to v0.2.321 that resulted in some opcua servers to not reconnect correctly after a downtime of the server (they show an active session on the UI but the node-red opcua client is getting no new messages from the server). I'm talking about this keepSessionAlive line that you commented out because of the issue #599 and reactived in v0.2.321.

image

Would it be possible to comment the line out again or do you know if there would be another workaround for me if this line is essential? It seems to mess with the keepAlive of the opcua client and I can't go back to the v0.2.320 as it does not include the correct configuration of transportSettings that another opcua server needs...

Thanks a lot in advance!

TheeeEnding avatar Mar 25 '24 14:03 TheeeEnding

Can confirm that we have the same issue again... would be glad if you could take a look, thank you!

fanbel avatar Apr 05 '24 06:04 fanbel

Same problem here, have someone find a solution?

PLCs7 avatar Apr 09 '24 13:04 PLCs7

I will update to latest node-opcua in next release as it contains fixes.

mikakaraila avatar Apr 12 '24 08:04 mikakaraila

Thanks a lot @mikakaraila ! Just fyi, I've done a few tests in the meantime and was able to nail down the problem to the code line that I mentioned above. With the current version a short downtime of the server is not a problem but when there is a longer downtime (e.g. 4h) the client cannot reconnect successfully. I did these tests also with a locally forked version where I commented the keepAlive line out and the reconnect was working even when there was a longer downtime. I hope the update will fix this issue! thank you!

TheeeEnding avatar Apr 12 '24 09:04 TheeeEnding

I just made & published new version. Not fully tested, so I will fix if there is something...

mikakaraila avatar Apr 12 '24 10:04 mikakaraila

I tested the new version overnight in order to see the reconnect/keepAlive after a longer downtime and unfortunately the problem is not fixed! The client did not reconnect successfully after the opcua server was down for a few hours

TheeeEnding avatar Apr 16 '24 06:04 TheeeEnding

OK, what is server that client tries to reconnect? Can you see what happens when server comes back online?

I have to check node-opcua release notes and perhaps ask if Etienne has some experience...

mikakaraila avatar Apr 16 '24 09:04 mikakaraila

I will take a look that keepAlive can be disabled...

mikakaraila avatar Apr 16 '24 09:04 mikakaraila

Thanks a lot!!

TheeeEnding avatar Apr 16 '24 09:04 TheeeEnding

I'm experiencing the same issue. When the server goes down for long time the node continue to keepalive even if the server is unreachable and will never reconnect. The only workaround i found is by restarting the flow. immagine

integratec avatar May 09 '24 18:05 integratec

I'm experiencing the same issue. When the server goes down for long time the node continue to keepalive even if the server is unreachable and will never reconnect. The only workaround i found is by restarting the flow. immagine

Hi, take a look at this solution https://github.com/mikakaraila/node-red-contrib-opcua/issues/638

regrog avatar May 14 '24 08:05 regrog

@regrog Hi, how would that help? It seems that the solution from https://github.com/mikakaraila/node-red-contrib-opcua/issues/638 only works if the node throws an BadConnection Error. In this example the node does not show any errors but stays in the "keepalive" status

TheeeEnding avatar May 14 '24 08:05 TheeeEnding

I'm currently on version 0.2.328 I'm having long downtime during the night but yes my node throws BadConnection Error. Did you try to upgrade to the last version?

regrog avatar May 14 '24 10:05 regrog

I've tested with the 0.2.327 and it still doesnt throw an error. The change from v0.2.327 to 0.2.328 only affects the opcua server node - so I didnt test it

TheeeEnding avatar May 14 '24 11:05 TheeeEnding

I'm on version 0.2.328, unfortunately no BadConnection errors raised. I already tried the solution at #638 but no luck, may be because the node still stuck in keepalive status like it's not aware the server isn't online anymore.

I think it should be considered normal/expected behaviour that a machine will no longer be accessible... this happens at least every day when a department ends its work. I whould say thanks to @mikakaraila for it's work but sorry... I believe this issue should be labeled as a bug instead of enhancement ;-).

integratec avatar May 14 '24 17:05 integratec

Hey, can we expect any update on this? It is still an ongoing problem.... Thank you!

TheeeEnding avatar Jul 29 '24 15:07 TheeeEnding

Sorry I am on vacation back to business after two weeks

On Mon, Jul 29, 2024, 18:00 TheeeEnding @.***> wrote:

Hey, can we expect any update on this? It is still an ongoing problem.... Thank you!

— Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/677#issuecomment-2256179770, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHRYDF46RXWQWIO4KV6OI3ZOZKJJAVCNFSM6AAAAABFHD2H4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJWGE3TSNZXGA . You are receiving this because you were mentioned.Message ID: @.***>

mikakaraila avatar Jul 29 '24 16:07 mikakaraila