Professional Communication
Software Development Tools

OPC Foundation member and certified 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 or issues. You do not have to own a commercial license in order to use the OPC Labs support. Our team is actively monitoring the forums, and provides replies as soon as possible.

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.

OPC UA can't reconnect properly when server goes down and then up

More
23 Oct 2026 11:19 #14745 by Vosecky
Hello,

I will do more tests over the weekend and we will meet as planned.

Thanks for your support.

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

More
23 Oct 2026 10:59 #14744 by support
Hello,
thanks for the quick reply.

Yes, I meant 5.84.434, I do not know what my fingers were doing....

The "got stuck" case worries me and will look at it; but obviously there wasn't enough time to test the new build thoroughly. 

Should we meet as planned?

Regards
 

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

More
23 Oct 2026 08:12 #14743 by Vosecky
Hello,

I did a test with the latest available version in nuget 5.84.434. (I didnt find 5.84.384, probably typo?)

I can see it reconnects faster and stays connected, I can see it's more "calm" in the Output debug window in VS2026.
So I would say it looks much better.

I run the application 5x with starting/stopping opc server. But in one case it got stuck, it was not able to reconnect and I had to kill the process.

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

More
23 Oct 2026 06:06 #14742 by support
Hello,

I was finally able to reproduce the issue - or at least something that is close to it. And I have made a fix.

Can you please rebuild and retest with QuickOPC 5.84.384, now available on nuget.org and our Web site. If you cannot retest before our planned meeting, we should postpone the meeting,

Best regards
 

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

More
20 Oct 2026 12:59 - 20 Oct 2026 13:02 #14740 by support
Hello.

Unfortunately I am still unable to reproduce the issue, even with almost the same app. For record, it is not precisely the same, because
1) it does not use PackageReference and the packages were not included so I had to recreate all references
2) apparently the app from the video is slightly different because has some additional text output that is not in the source code.
3) Could not use "heslo" as my KepServerEX requires 14 characters minimum, so I changed it
4) [no KepServerEX config was provided so I had to hand-create the MAINPROGRAMNAME string tag]

I can see from the Wireshark logs that there is something that causes QuickOPC to cancel the requests and close the sessions by itself, *with precisely 30 seconds frequenccy:
Code:
22:40:43 ServiceFault (looks like server shutdown) 22:41:30 CreateSessionRequest 22:41:47 CancelRequest, CloseSessionRequest, ServiceFault 22:42:00 CreateSessionRequest 22:42:17 CancelRequest, CloseSessionRequest, ServiceFault 22:42:31 CreateSessionRequest 22:42:47 CancelRequest, CloseSessionRequest, ServiceFault 22:42:57 CreateSessionRequest 22:43:17 CancelRequest, CloseSessionRequest, ServiceFault 22:43:28 CreateSessionRequest 22:43:47 CancelRequest, CloseSessionRequest, ServiceFault -- 22:44:17 CancelRequest, CloseSessionRequest, ServiceFault 22:44:30 CreateSessionRequest 22:44:47 CancelRequest, CloseSessionRequest, ServiceFault 22:45:01 CreateSessionRequest 22:45:10 ServiceFault (looks like server shutdown) 22:45:17 CreateSessionRequest 22:46:17 ServiceFault (looks like server shutdown) 22:46:42 CreateSessionRequest 22:46:53 CancelRequest, CloseSessionRequest, ServiceFault 22:47:08 CreateSessionRequest 22:47:23 CancelRequest, CloseSessionRequest, ServiceFault

Do you have some setting that uses this frequency, OR something on your system that runs with this frequency?

Regards
Last edit: 20 Oct 2026 13:02 by support.

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

More
17 Oct 2026 19:50 #14735 by Vosecky
Hello,

here is the video where you can see version 5.80.347 vs 5.84.416 reconnect issue.
(as the verification I'm using prosys OPC client  )

5_80_vs_5_...ssue.mp4

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

More
16 Oct 2026 17:01 #14734 by Vosecky
Hello,

I can reproduce it with the simple command line app. Please see attachment.  

File Attachment:

File Name: TestOPC.zip
File Size:29,051 KB
  • Please Log in or Create an account to join the conversation.

    More
    16 Oct 2026 15:07 #14733 by Vosecky
    Hello,

    - yes it happens always when I shut down the OPC server (Kepserver EX6.6) 
    - it will never recover from this state
    - .NET4.8
    - it has started after update from 5.80.347 => to the latest
    - it happens only when I'm using subscribe mode

    code snippets:
    public void UASubscribeMultipleItems()
    {
     easyUAClient.DataChangeNotification += UAEventChanged;
     m_handleArray = easyUAClient.SubscribeMultipleMonitoredItems(m_UA_subscrArgumentsArray);
    }public void UAEventChanged(object sender, EasyUADataChangeNotificationEventArgs args)
    {
    Value val;
    m_newData = true;

    if (args.Succeeded)
    {
    for (int i = 0; i < m_allOPCValues.opcTags.Count; i++)
    {
    string opcTag = args.Arguments.NodeDescriptor.NodeId;
    int state = (int)args.Arguments.State;
    if (m_allOPCValues.state.ElementAt(i) == state)
    {
    string typeName = args.AttributeData.ValueType.Name;

    if (args.AttributeData.ValueType.IsArray)
    val = new Value((System.Array)args.AttributeData.Value);
    else
    val = new Value(args.AttributeData.Value.ToString());

    m_allOPCValues.errValue = "";
    m_allOPCValues.hasValue = 1;
    m_allOPCValues.value = val;
    }
    }
    }
    else
    {
    for (int i = 0; i < m_allOPCValues.opcTags.Count; i++)
    {
    string opcTag = args.Arguments.NodeDescriptor.NodeId;
    int state = (int)args.Arguments.State;

    if (m_allOPCValues.state.ElementAt(i) == state)
    {
    m_allOPCValues.errValue = args.Exception.ToString();
    m_allOPCValues.hasValue = 0;
    m_allOPCValues.value = new Value("");
    }
    }
    }
    }
    Thank you for your help.
     

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

    More
    16 Oct 2026 14:39 #14732 by support
    Hello.

    I tried to reproduce the issue, but unfortunately I could not. I used our OpcCmd, and then I made my own simple application. 
    I can, however, confirm weird things in the files you have sent. The WireShark trace actually appears OK (the application succeeds in reading and subscribing), while at the same time, an error appears to be reported to your code.

    Questions:

    1. Does the problem happen always (i.e. every time you shut down the server and then start it again, you get the problem), or just sometimes?
    2. If you wait longer time (e.g. half an hour), does it ever recover, or is an application restart needed?
    3. Which .NET runtime are you on?
    4. Can you reproduce with my code? (file attached).
    5. If not, can you modify the code or provide additional information, or steps needed, for making the problem reproducible?

    Best regards

     

    File Attachment:

    File Name: Program_2026-10-16.cs
    File Size:1 KB
  • Please Log in or Create an account to join the conversation.

    More
    15 Oct 2026 21:09 #14731 by Vosecky
    Hello,

    after update to the latest version (5.84.416) I can see that subscribed client can't reconnect properly.
    Race condition: is to stop the OPC server and then start it again.
    Result: opc clients reconnects but is keep getting exceptions.
       

    File Attachment:

    File Name: opclogwire...2.pcapng
    File Size:2,482 KB
     

    File Attachment:

    File Name: opclog_wir...k.pcapng
    File Size:6,269 KB
     

    File Attachment:

    File Name: sessionparams.txt
    File Size:0 KB
     

    File Attachment:

    File Name: Applicatio...CLOG.txt
    File Size:70 KB

    .48.31.0483:2054: OPC Client: OPC ERR:  <ns=2;s=Channel1.Device1.MAINPROGRAMNAME || OpcLabs.EasyOpc.UA.Engine.UAEngineException: OPC-UA client session is not available when connecting the client subscription. Session error: "OPC UA service result - {BadConnectionClosed}. The network connection has been closed.
    + The client method called (or event/callback invoked) was 'DataChangeNotification'."
    + The client method called (or event/callback invoked) was 'DataChangeNotification'.>
    D:23.48.34.0540:3057: OPC Client: OPC ERR:  <ns=2;s=Channel1.Device1.MAINPROGRAMNAME || OpcLabs.EasyOpc.UA.UAServiceException: OPC UA service result - {BadConnectionClosed}. The network connection has been closed.
    + The client method called (or event/callback invoked) was 'DataChangeNotification'.>
    D:23.48.36.0586:2046: OPC Client: OPC ERR:  <ns=2;s=Channel1.Device1.MAINPROGRAMNAME || OpcLabs.EasyOpc.UA.Engine.UAEngineException: OPC-UA client session is not available when connecting the client subscription. Session error: "OPC UA service result - {BadConnectionClosed}. The network connection has been closed.
    + The client method called (or event/callback invoked) was 'DataChangeNotification'."
    + The client method called (or event/callback invoked) was 'DataChangeNotification'.>

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

    Moderators: support, vaclav.zaloudek
    Time to create page: 0.149 seconds