-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference in clocks between client and server cause problems #1349
Comments
https://reference.opcfoundation.org/Core/Part4/v104/docs/5.5.2 Clients should request a new SecurityToken after 75 % of its lifetime has elapsed. This should ensure that Clients will receive the new SecurityToken before the old one actually expires. and Clients should accept Messages secured by an expired SecurityToken for up to 25 % of the token lifetime. This should ensure that Messages sent by the Server before the token expired are not rejected because of network delays. in opc ua utc is used! |
Also interesting article: https://reference.opcfoundation.org/Core/Part6/v105/docs/6.3 A server that cannot connect to the NTP time sync could interact with the Discovery server to update its time and correct time drift. I haven't seen this implemented |
Should be fixed in node-opcua@2.123.0 , please confirm |
@erossignon Looks good! Now it warns of the time discrepancy and continue working as expected. |
Current behavior
When connected to a OPC UA server where the clock is out of sync with the client (node-opcua) there seems to be a problem when connecting to the device and when renewing the security token (see details below). The client reports the error message:
requestData not found for requestId = <n> try with <n+1>
Describe the bug
How the clocks differ seems to matter, meaning if the device clock is behind my client's clock by more than 30 minutes, I am getting the error immediately when I activate the session. If the device clock is either ahead or behind my device by a couple of minutes, I am able to activate a session with the server and it works for a while, then seemingly when the security token is renewed, the error message appear and the client crashes.
Step by step instruction to reproduce
Immediate crash:
Crash after security token renewal:
Expected behavior
I expect the client not to crash even though the clocks between client and server are different (even by a lot). UA Expert seems to handle the situation without issue.
Log output leading up to crash
node-opcua-crash.log
Stack trace:
Context
My setup:
node --version
=v20.9.0
Device info:
OPCUA system I am trying to connect to:
The text was updated successfully, but these errors were encountered: