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.

BadSessionClosed causes disconnect and reconnect of server when subscribing

More
22 Jan 2019 12:45 #7018 by support
Hello,

are you subscribed to some monitored items when this happens, or are you only doing periodic reads (activity "driven" from your code)?

Thank you

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

More
22 Jan 2019 12:09 #7017 by veda
Hi

Currently reviewing your product. I have an application where I am connecting to several different OPC servers (with seperate instances of EasyUAClient). The application is running and retrieving values at defined interval, but I have some connection issue at regular intervals (typically approx every minute). The client disconnects and immediately connects again. Se below for output from EasyUAClient.LogEntry. Do you have any idea why this is happening? I connect to Siemens NET OPC servers and have removed all security (this is located in an isolated network).

Output:
[12:59:22 INF] Warning(2051): The OPC-UA client session with connect sequence number 51 on endpoint URL "opc.tcp://192.168.23.212:4845" has encountered a publish error with code 0x80260000 for subscription ID 0 and sequence number 0. The error might be from the Publish or the Republish service. Further publish errors with this code on this session will not be logged.
Service result: BadSessionClosed 'BadSessionClosed'.
[12:59:22 INF] Information(2024): The OPC-UA client session with connect sequence number 51 is disconnecting from endpoint URL "opc.tcp://192.168.23.212:4845".
[12:59:22 INF] opc.tcp://192.168.23.50:4840: Disconnecting
[12:59:22 INF] opc.tcp://192.168.23.249:55101: Disconnecting
[12:59:22 INF] Information(2026): The OPC-UA client session on endpoint URL "opc.tcp://192.168.23.212:4845" failed at tick 90495265 and will retry in 10000 milliseconds.
[12:59:22 INF] opc.tcp://192.168.23.50:4840: Disconnected
[12:59:22 INF] opc.tcp://192.168.23.249:55101: Disconnected
[12:59:22 INF] Information(2034): Failed to close the OPC-UA client session (with connect sequence number 51) to endpoint URL "opc.tcp://192.168.23.212:4845". This error is generally ignored.
OPC-UA service result - (no description available) = BadSessionIdInvalid.
---- SERVICE RESULT ----
Status Code: {BadSessionIdInvalid} = 0x80250000 (2149908480)

[12:59:22 INF] opc.tcp://192.168.23.212:4845: Disconnecting
[12:59:22 INF] opc.tcp://192.168.23.212:4845: Disconnected
[12:59:22 INF] Information(2025): The OPC-UA client session with connect sequence number 51 has disconnected from endpoint URL "opc.tcp://192.168.23.212:4845".
[12:59:22 INF] opc.tcp://192.168.23.61:55101: Disconnecting
[12:59:22 INF] opc.tcp://192.168.23.61:55101: Disconnected
[12:59:22 INF] Information(2026): The OPC-UA client session on endpoint URL "opc.tcp://192.168.23.212:4845" failed at tick 90495281 and will retry in 10000 milliseconds.
[12:59:22 INF] opc.tcp://192.168.23.211:4845: Disconnecting
[12:59:22 INF] opc.tcp://192.168.23.211:4845: Disconnected
[12:59:22 INF] Warning(3201): The status subscription for an OPC-UA session on endpoint URL "opc.tcp://192.168.23.212:4845" is in failure. Further such warnings on this session will not be logged.
OPC-UA service result - An error specific to OPC-UA service occurred.
---- SERVICE RESULT ----
Status Code: {BadSessionClosed} = 0x80260000 (2149974016)
Description: BadSessionClosed
Additional Info: <ExceptionTrace>

[12:59:32 INF] Information(2021): The OPC-UA client session with connect sequence number 52 is connecting to endpoint URL "opc.tcp://192.168.23.212:4845".
[12:59:32 INF] opc.tcp://192.168.23.249:55101: Connecting
[12:59:32 INF] opc.tcp://192.168.23.50:4840: Connecting
[12:59:32 INF] opc.tcp://192.168.23.212:4845: Connecting
[12:59:32 INF] opc.tcp://192.168.23.61:55101: Connecting
[12:59:32 INF] Information(2031): The OPC-UA client session with connect sequence number 52 for discovery URL "opc.tcp://192.168.23.212:4845" will use an endpoint selection policy that has warnings. The policy warnings are:
- An endpoint with obsolete security policy may be selected by this policy.

[12:59:32 INF] opc.tcp://192.168.23.211:4845: Connecting
[12:59:32 INF] Information(2001): OPC-UA endpoint selection on discovery URL "opc.tcp://192.168.23.212:4845" candidate report (2 entries) follows.
[0:AcceptedNotWinner(130), 1:Winner(1000+0)].
[12:59:32 INF] Warning(2002): The OPC-UA server endpoint URL "opc.tcp://MaintHMI:4845" with security policy URI "opcfoundation.org/UA/SecurityPolicy#None" and transport policy URI "opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary", selected using discovery on endpoint URL "opc.tcp://192.168.23.212:4845", has zero security level. Using this endpoint is not recommended and is only supported for backward compatibility. This happens when no other endpoints are available and eligible for selection.
[12:59:32 INF] Warning(2005): The preliminary OPC-UA server endpoint URL selected using discovery on endpoint URL "opc.tcp://192.168.23.212:4845/" differs in host name or port number from the discovery endpoint. The original endpoint URL "opc.tcp://MaintHMI:4845" has been replaced by "opc.tcp://192.168.23.212:4845/".
[12:59:32 INF] Information(2007): An OPC UA endpoint has been selected and normalized. Endpoint URL: "opc.tcp://192.168.23.212:4845/", security mode: 'None', security policy URI: "opcfoundation.org/UA/SecurityPolicy#None", transport profile URI: "opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"
[12:59:32 INF] Information(2032): The OPC-UA client session with connect sequence number 52 has preselected an OPC-UA endpoint for discovery URL "opc.tcp://192.168.23.212:4845" with following parameters:
Endpoint URL "opc.tcp://192.168.23.212:4845/", message security mode 'None', security policy URI "opcfoundation.org/UA/SecurityPolicy#None", transport profile URI "opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary, use binary encoding: yes.
[12:59:32 INF] Information(2011): The OPC-UA client session with connect sequence number 52 user token selection on endpoint URL "opc.tcp://192.168.23.212:4845" candidate report (2 entries) follows.
[0:Winner(""), 1:ValidNotEligible(NotApplicable("docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0"))].
[12:59:32 INF] Information(2013): The OPC-UA client session with connect sequence number 52 on endpoint URL "opc.tcp://192.168.23.212:4845" has been associated with user identity token type 'Anonymous', display name "Anonymous".
[12:59:32 INF] opc.tcp://192.168.23.50:4840: Connected
[12:59:32 INF] Information(2171): The OPC-UA server on endpoint URL "opc.tcp://192.168.23.212:4845" returned an empty list of software certificates.
[12:59:32 INF] opc.tcp://192.168.23.212:4845: Connected
[12:59:32 INF] Warning(2181): The OPC-UA server on endpoint URL "opc.tcp://192.168.23.212:4845" returned an empty server signature.
[12:59:32 INF] opc.tcp://192.168.23.249:55101: Connected
[12:59:32 INF] Information(2023): The OPC-UA client session with connect sequence number 52 has successfully connected to endpoint URL "opc.tcp://192.168.23.212:4845". The server-assigned session Id is "ns=1;g=777741a3-8de9-4f65-8ef7-f8833c665bb3".
[12:59:32 INF] opc.tcp://192.168.23.211:4845: Connected
[12:59:32 INF] Information(3002): The OPC-UA subscription on client session with connect sequence number 52 to endpoint URL "opc.tcp://192.168.23.212:4845" has been successfully created and checked, and given subscription ID 384. Revised publishing interval is 7500, keep-alive count is 11520 and lifetime count is 34560.
[12:59:32 INF] opc.tcp://192.168.23.50:4840: Connected
[12:59:32 INF] opc.tcp://192.168.23.212:4845: Connected
[12:59:32 INF] opc.tcp://192.168.23.249:55101: Connected
[12:59:32 INF] opc.tcp://192.168.23.61:55101: Connected
[12:59:32 INF] opc.tcp://192.168.23.61:55101: Connected
[12:59:32 INF] opc.tcp://192.168.23.211:4845: Connected
[12:59:32 INF] Information(3002): The OPC-UA subscription on client session with connect sequence number 52 to endpoint URL "opc.tcp://192.168.23.212:4845" has been successfully created and checked, and given subscription ID 385. Revised publishing interval is 50, keep-alive count is 1728000 and lifetime count is 5184000.
[13:00:42 INF] Warning(2051): The OPC-UA client session with connect sequence number 52 on endpoint URL "opc.tcp://192.168.23.212:4845" has encountered a publish error with code 0x80260000 for subscription ID 0 and sequence number 0. The error might be from the Publish or the Republish service. Further publish errors with this code on this session will not be logged.
Service result: BadSessionClosed 'BadSessionClosed'.

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

Moderators: support
Time to create page: 0.064 seconds