Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Connection failed at discoverEndpoints
May 31, 2024
20:10, EEST
Avatar
xinyu
Member
Members
Forum Posts: 3
Member Since:
May 31, 2024
sp_UserOfflineSmall Offline

Hi guys,
i am using the latest Prosys Opcua Client SDK (5.1.0-116) and try to connect an Inovance-ARM-Linux opcua server (AM403). But it is not working with the exception:
com.prosysopc.ua.client.ConnectException: Failed to retrieve endpoints. The server is not available: opc.tcp://172.18.19.127:4840 ServiceResult=Bad_ConnectionClosed (0x80AE0000) “The network connection has been closed.”
at com.prosysopc.ua.client.UaClient.discoverEndpoints(SourceFile:1235)
at com.prosysopc.ua.client.UaClient.discoverEndpoints(SourceFile:1165)
at com.prosysopc.ua.client.UaClient.getEndpoints(SourceFile:5999)
at com.prosysopc.ua.client.UaClient.cjf(SourceFile:6644)
at com.prosysopc.ua.client.UaClient.connect(SourceFile:1028)
at unit.OPCUADATestConnection2.connect(OPCUADATestConnection2.java:187)
at unit.OPCUADATestConnection2.main(OPCUADATestConnection2.java:123)
Caused by: com.prosysopc.ua.stack.common.ServiceResultException: Bad_ConnectionClosed (code=0x80AE0000, description=”Connection closed (graceful)”)
at com.prosysopc.ua.stack.transport.tcp.io.TcpConnection$b.run(SourceFile:824)
Caused by: java.io.EOFException
at com.prosysopc.ua.stack.utils.bytebuffer.InputStreamReadable.epW(SourceFile:192)
at com.prosysopc.ua.stack.utils.bytebuffer.InputStreamReadable.getInt(SourceFile:115)
at com.prosysopc.ua.stack.transport.tcp.io.TcpConnection$b.run(SourceFile:524)
I used the same code to connect other opcua server, it works fine.
I also try to connect this Inovance-ARM-Linux opcua server with both UA Expert Client and Prosys UA Browser, what strange is that I can connect to this server with UA Expert Client, but i can not connect to it with Prosys UA Browser.
Could you please help me with this issue ? Is this a issue at Prosys Opcua Client SDK ?

Thank you very much !

June 3, 2024
9:48, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 994
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Hard to say based on this info alone. There has been cases in the past where an OPC UA Server was implemented incorrectly, but was still connectable by UaExpert. Or could be our bug or a missing feature.

IF possible, please observe differences via https://prosysopc.com/blog/opc-ua-wireshark/ and let us know if any (use uajava-support@prosysopc.com if needed). IF you use Sign&Encrypt, note that then you cannot see traffic (contents) once the channel is encrypted, however here the failure happens before that. Thus check at least (the first) Hello message EndpointUrl field.
A typical OPC UA connection flow has the following messages:
(TCP socket opened)
Hello/Acknowledge
OpenSecureChannel (with NONE mode)
GetEndpoints
CloseSecureChannel
(TCP socket closed and a new one opened)
Hello/Acknowledge
OpenSecureChannel (with the chosen security mode)
CreateSession
ActivateSession
and so on

GetEndpoints gives EndpointDescriptions, which have the server certificate, which is needed for crypto operations. It is checked again once security is in place and server has proved itself to be real.

In this case the failure/difference is somewhere before GetEndpointsResponse i.e. in the (first) Hello, OpenSecureChannel (NONE) or GetEndpoints.

There has also been some recent cases that some server’s might not support NONE connection at all to the “main url” (i.e. you cannot even do GetEndpoints), but instead have a separate “/Discovery” endpoint for GetEndpoints. Our SDK design does ignore the EndpointUrl resulted from GetEndpoints and we keep connecting to the original addredss. This works with e.g. NATs where the server wouldn’t know it’s real address. But this fails when the main endpoint doesn’t support GetEndpoints. Thus, starting from 5.2.0 (thus please try with it) we support this case, but you must give the “opc.tcp://host:port/Discovery” (or equivalent) as the “real address” for UaClient. So basically 5.2.0 (https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_5_Release_Notes.html#version-5-2-0) does take (only) the ServerName component internally after GetEndpoints and uses the other parts as-is, thus it should work with a server like this. Rest of the address (i.e. the host:port part) comes still from the given address thus this should work with NATs. However, please note that based on the info it is not possible for me to know if this would be or not be the case here (but e.g. you/UaExpert could have obtained the so called EndpointDescription by the UaExpert menus depending how you configured the connection).

There is also a way to set the EndpointDescription manually, if you “magically know it” (this includes knowing the certificate of the server), by UaClient.setEndpoint, though note that set this way the url and security modes are taken as-is from it (so it might not work with NATs). If set, then the first connection (that would do GetEndpoints) is skipped and the second is started directly.

June 5, 2024
14:10, EEST
Avatar
xinyu
Member
Members
Forum Posts: 3
Member Since:
May 31, 2024
sp_UserOfflineSmall Offline

Hi,

thank you very much for your feedback. I am using “NONE Mode” to connect to the Server. I was tried with Wireshark and find that, the failure/difference happens at OpenSecureChannelRequest, so i did not get OpenSecureChannelResponse message.
I only got the following messages when tried to connect server:
114 Hello message
82 Acknowledge message
186 OpenSecureChannel message: OpenSecureChannelRequest

I have download the latest version (5.2.0-133) and try to connect again, tried both with “opc.tcp://host:port/Discovery” and “opc.tcp://host:port”, but it has the same issue, the connect can still not build.
I try to use another OPCUA client library (milo opcua sdk) to connect the same server and then got the typical OPC UA connection flow and the connection is working.
So i have no idea how can i solve this issue, if you need more details about the traffic packets i got from Wireshark, i can send also some screenshots per mail (uajava-support@prosysopc.com).

Thank you very much again for your help !

June 5, 2024
15:47, EEST
Avatar
Matti Siponen
Moderator
Members

Moderators
Forum Posts: 330
Member Since:
February 11, 2020
sp_UserOfflineSmall Offline

Hello,

Could you send your Wireshark log to uajava-support@prosysopc.com so that we could check it? If it is too large to send via email, you can use our web upload to send it to us. Please contact us via uajava-support@prosysopc.com if you would like credentials for using the web upload.

If you can’t send the entire Wireshark log to us, please do send screenshots that show the contents of the Hello message, Acknowledge message and OpenSecureChannel message: OpenSecureChannelRequest.

June 5, 2024
19:15, EEST
Avatar
xinyu
Member
Members
Forum Posts: 3
Member Since:
May 31, 2024
sp_UserOfflineSmall Offline

Hello,

thank you very much for your feedback !
The mail with wireshark log and screenshot is sent with title “Connection failed at discoverEndpoints”.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 142

pramanj: 86

Francesco Zambon: 83

rocket science: 82

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 704

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1482

Posts: 6316

Newest Members:

samui, TommyDab, wross, Jeremyknock, Pedromon, DonaldEdism, Miguelplese, Scotanine, katesalas95, Petertum

Moderators: Jouni Aro: 1015, Pyry: 1, Petri: 0, Bjarne Boström: 994, Jimmy Ni: 26, Matti Siponen: 330, Lusetti: 0

Administrators: admin: 1