The issue of session in the 'Reactivating' state.

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
tonyqing
Jr. Member
Jr. Member
Posts: 2
Joined: 06 Jan 2015, 19:49

The issue of session in the 'Reactivating' state.

Post by tonyqing »

Occasionally got “The operation is not available because the session is in the 'Reactivating' state.
Stack Trace: at UnifiedAutomation.UaClient.Session.CheckSessionState(State state)”.
What does the “Reactivating state” mean at server side? How to debug the root cause which caused the TCP connection session aborted? When this happens, the client software is up and running but lost the connection with the server. Thanks for help.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: The issue of session in the 'Reactivating' state.

Post by Support Team »

Reactivating a session happens on the client side. The server keeps a session until the configured session lifetime expires.
If the connection was lost the client tries to recover the last session on the server by calling activate session.
If you turn on the trace on the client side you should see when the tcp connection was interupted:

12:56.44|0014|01|2|[Bad] Unexpected error during OnReadComplete,|SocketException|An existing connection was forcibly closed by the remote host.
12:56.44|0014|01|4|TCPCLIENTCHANNEL Shutdown Socket=00000638, ChannelId=1383583805, TokenId=1, Reason=[BadTcpInternalError]An existing connection was forcibly closed by the remote host.
12:56.49|0018|02|1|[BadDecodingError] Unexpected error during Session.WatchdogRead.|StatusException|Could not process OpenSecureChannelResponse.
12:56.54|0020|02|4|CONNECTION STATUS CHANGED: ConnectionErrorClientReconnect (OnWatchdogCycle) [BadConnectionClosed]

If you find this kind of information you know you have a network problem or the server has stopped working.

Best Regards,
Unified Automation Support Team

tonyqing
Jr. Member
Jr. Member
Posts: 2
Joined: 06 Jan 2015, 19:49

Re: The issue of session in the 'Reactivating' state.

Post by tonyqing »

Thanks Support Team!
How to turn on the trace log at the OPC UA? Couldn't find any document regarding the trace log.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: The issue of session in the 'Reactivating' state.

Post by Support Team »

There's an xml configuration file called App.config you can add to your project.
http://documentation.unified-automation ... ureProduct

In there you find all the trace settings.

Best Regards,
Unified Automation Support Team

spruitremco
Jr. Member
Jr. Member
Posts: 1
Joined: 14 Jul 2020, 20:46

Re: The issue of session in the 'Reactivating' state.

Post by spruitremco »

This is very helpful to find out why the connection was lost. I am interested in how to recover from this.

I got this error when debugging the application in Visual Studio. the watchdog timed out and the connection status is 'ConnectionErrorClientReconnect'. Can I test the 'Reactivating' state? What to do next?

Thanks,

Remco

MrIS
Full Member
Full Member
Posts: 7
Joined: 19 Jul 2018, 10:30

Re: The issue of session in the 'Reactivating' state.

Post by MrIS »

Hello Team,
Support Team wrote:
12 Aug 2015, 14:06
If you find this kind of information you know you have a network problem or the server has stopped working.
Is there any knowledgebase where possible network problems or server communication issues are described and published? If I use embedded OPC UA server, e.g. Siemens S7-1500, I'm not able to detect a reason of disconnection by remote host. The same thing applies in case of a network issue. When a session is closed an re-created, I can see it on the TCP layer in Wireshark, but how do I determine what is a root cause of network issue related to the session? The network communication works flawlessly at a given time for other applications.
Thanks in advance.

Post Reply