Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Unable to reconnect to OPC Server

More
11 Mar 2019 13:09 #7195 by veda
1. We are running on .NET Core 2.2 on Windows 10 x64. The reason why this was filtrated from the log was because I only wrote log entries containing the actual server address with connection issues. My application is connecting to several servers, and this was to avoid "noise" in the log file. If this is a problem, I can try to generate the problem once more.

2. Using the latest NuGet package of version 5.54.1026.

3. Have noticed that many events are written several times. Do not know the reason for this. We see that e.g. ServerConditionChanged are called more than once for each new server status on the same server (ref. earlier post where we are filtrating in ServerConditionChanged on the correct server. One server per instance of EasyUAClient).

4. Running with debugger attached. Could this be realated to www.opclabs.com/forum/ua-connections/2588-badsessionclosed-c...f-server-when-subscribing#7193?

5. Logging all information from LogEntry, but filtrated with server (ref. 1).

6. Noticed the 10 minute limit. Not exactly sure how long, but passed 10 mins with good margin. No change.

Please Log in or Create an account to join the conversation.

More
09 Mar 2019 16:23 #7187 by support
Hello,
thank you for the files.

I have some questions:

1. Are you running on .NET Core, or .NET Framework? If on .NET Core, which operating system? I have to ask because you have also not provided the LogEntry notifications from the start of the program, which contain all of this. [note to myself: this question relates to the appearance of BadNotConnected status code]

2. Please confirm that you are running QuickOPC version 2018.3. Again that would be in the log entries at the beginning, but I do not have them.

3. It seems that each notification is written exactly 5 times in the files. I can "filter it" out, but I just want to not whether you are aware of it, and why is it. Aren't you hooking multiple times to the same static event?

4. When the logs were taken, were you running with debugger attached, or without?

5. Are you logging just Warning/Error kinds of notifications in LogEntry, or are Information notifications also included? (I do not see them, so I do not know whether they were not generated, or whether they were generated but not included in the log file).

6. Have you tried to wait very long (such as over 20 minutes) to see if there is still no recovery? What happens then? The reason I am asking this is that there are various timeout periods, and most of them are quite short, but the default for the so-called OperationTimeout is 10 minutes I believe, so under rare circumstances this can slow down things. I am almost sure that this is not the case here, but want to verify it anyway.

[Note to myself for possible next troubleshooting step, depending on the answers: deadlock analysis, extended tracing + wireshark]

Please Log in or Create an account to join the conversation.

More
06 Mar 2019 19:23 #7184 by veda
Attached are new log without filtrating out information from exceptions. The "PC-UA client session is not available when connecting the client subscription" exception keeps coming without stopping, but the server does not reconnect.

Timeline for logfile:
20.13 -> Connect all ok
20.14 -> Disconnect from VPN
20.16 -> Reconnect VPN

Please Log in or Create an account to join the conversation.

More
06 Mar 2019 18:00 #7183 by support
I know you have already posted the logs; but if you want to email something in the future, you can send it to support09 (at) opclabs.com.

Best regards

Please Log in or Create an account to join the conversation.

More
06 Mar 2019 17:59 #7182 by support
Thank you, but you have removed precisely the part I wanted to analyze.
For the decision on further troubleshooting direction, I need to know whether new events, event with ""OPC-UA client session is not available when connecting the client subscription", continue to come without ever stopping, or whether that have stopped as well.

Please Log in or Create an account to join the conversation.

More
06 Mar 2019 14:24 #7181 by veda
Attached are a log file with the following information:
[Warning] -> Output from EasyUAClient.LogEntry
[Error] -> Exception text from DataChangeNotification and ServerConditionChanged filtrated to not show "OPC-UA client session is not available when connecting the client subscription"

Timeline:
09.49 -> Startup and subscription OK
09.50 -> VPN disconnected (lost connection to OPC Server)
09.52 -> Connected VPN client (connection to OPC Server available), but no new entries in the log except "OPC-UA client session is not available when connecting the client subscription". Never got any new data from that server. After restart of EasyUAClient everything works as expected.

Please Log in or Create an account to join the conversation.

More
06 Mar 2019 09:01 #7179 by veda
Have now done a couple of more tests. When the error occours the Exception from DataChangeNotification is "stuck" with the message "OPC-UA client session is not available when connecting the client subscription" after reconnecting the VPN client. This is not related to a specific OPC server (it was a different server today compared to yesterday).

Have a log file with all exceptions from DataChangeNotification and ServerConditionChanged when disconnecting. Can I send this by email (not sure if I would like the file to be on an online forum).

Please Log in or Create an account to join the conversation.

More
06 Mar 2019 03:14 #7177 by support
Can you please provide more information - specifically this:

What are you seeing in the DataChangeNotification event notifications observed when this happens?
- What is the first exception sent through DataChangeNotification when you disconnect in this case?
- Do you get further notifications (with different exceptions possibly) after the first one, or do they stop altogether (on the particular EasyUAClient instance)?
- Please confirm that connections through other EasyUAClient objects are behaving normally even if this happens.

Ideally, send a log that shows all DataChangeNotification-s, all ServerConditionChanged notificitaions, and also the static EasyUAClient.LogEntry notifications, when this happens.

Regarding the ServerConditionChanged : What you described is by design. The EasyUAClient object, in its default configuration (when its Isolated property equals to 'false'), acts as a broker, so in fact, if you had EasyUAClient instances A and B, and instance A connects to servers 1 and 2 and instance B connects to servers 2 and 3, there will be just one connection to server 2 from both. This, however, also means that they notifications about connections and disconnections are common and affect them both. Of course you can say they if you are not sharing, that is you have instance A connecting to just server 1 and instance B connecting to just server 2, that such behavior does not seem logical, but it has to be that way due to the possibility of sharing. If you set the Isolated property on the EasyUAClient to 'true', it will always maintain its own connections - and also it will only see its "own" ServerConditionChanged notifications. But, if two or more such instances with Isolated = true connect to the same server, you will end up with two or more OPC UA sessions to that server, which is not efficient and can cause problems.

Best regards

Please Log in or Create an account to join the conversation.

More
05 Mar 2019 08:12 #7164 by veda
We have an application that connects to several OPC Servers, and we have one instance of EasyUAClient per server. On my development computer I connect to the OPC servers via VPN connection. I am doing some stability verification and disconnect and reconnect the VPN connection several times to verify that the EasyUAClient reconnects to all the OPC servers automatically. Normally all servers are reconnected within a reasonable time, but I have seen several cases where the EasyUAClient fails to connect to one of the OPC servers (random which server). Typically one of the servers get "stuck" in Connecting state (have waited 20 minutes for reconnect without success). If I restart my application, all connections are working. Do you have any idea how to fault find on this issue?

Note: The ServerConditionChanged callback is set on an instance of EasyUAClient, but acts like a static function. We (sometimes) get callback on the wrong EasyUAClient object and needs to verify the EasyUAServerConditionChangedEventArgs.EndpointDescriptor to perform the correct state change on the correct object.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.060 seconds