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
The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse
July 15, 2024
17:59, EEST
Avatar
miti
Member
Members
Forum Posts: 5
Member Since:
January 26, 2024
sp_UserOfflineSmall Offline

Hi!

We changed to the latest version (5) of the client and also server in our simulator.

We get this error when logging into the simulator from our client after some time, about 45 minutes.
Restarting and it works again.

Caused by: com.prosysopc.ua.stack.common.ServiceResultException: Bad_UnexpectedError (code=0x80010000, description=”The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse”)
Stacktrace:
java.lang.RuntimeException: com.prosysopc.ua.client.InvalidServerEndpointException: Failed to create session channel to server: : opc.tcp://plc-two:52530/OPCUA/ServerPOC [http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256,SignAndEncrypt] ServiceResult=Bad_UnexpectedError (0x80010000) “An unexpected error occurred.”
at se.tf.saap.rest.opcua.FacilityPLCClient.connect(FacilityPLCClient.java:67)
at se.tf.saap.rest.opcua.OPCUASessionService.connectAndSubscribe(OPCUASessionService.java:191)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining(ConcurrentHashMap.java:3612)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at se.tf.saap.rest.opcua.OPCUASessionService.scheduledReconnectionAttempt(OPCUASessionService.java:165)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
at io.micrometer.observation.Observation.observe(Observation.java:499)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.prosysopc.ua.client.InvalidServerEndpointException: Failed to create session channel to server: : opc.tcp://plc-two:52530/OPCUA/ServerPOC [http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256,SignAndEncrypt]
at com.prosysopc.ua.client.UaClient.ciX(SourceFile:5767)
at com.prosysopc.ua.client.UaClient.connect(SourceFile:1066)
at se.tf.saap.rest.opcua.FacilityPLCClient.connect(FacilityPLCClient.java:63)
… 24 common frames omitted
Caused by: com.prosysopc.ua.stack.common.ServiceResultException: Bad_UnexpectedError (code=0x80010000, description=”The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse”)
at com.prosysopc.ua.stack.application.Client.a(SourceFile:1091)
at com.prosysopc.ua.stack.application.Client.createSession(SourceFile:647)
at com.prosysopc.ua.client.UaClient.ciX(SourceFile:5714)
… 26 common frames omitted

Haven’t seen this happening locally in development-environment at all.

What could be causing this?

/Mika

July 16, 2024
13:51, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1017
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Hmm odd..
Can you tell the precise 5.x version used (also from what version did you update from)? And also just to doublecheck, the Server side was also done using our SDK? And did you restart the client, the server or both? Did anything .. odd happen on the server’s machine (such as e.g. changing the computername/hostname)? Did this happen only once or are you able to reproduce this?

The exception itself happens if the check defined in https://reference.opcfoundation.org/Core/Part4/v105/docs/5.6.2 fails:


The Server returns its EndpointDescriptions in the response. Clients use this information to determine whether the list of EndpointDescriptions returned from the DiscoveryEndpoint matches the Endpoints that the Server has. If there is a difference then the Client shall close the Session and report an error. The Server returns all EndpointDescriptions for the serverUri specified by the Client in the request. The Client only verifies EndpointDescriptions with a transportProfileUri that matches the profileUri specified in the original GetEndpoints request. A Client may skip this check if the EndpointDescriptions were provided by a trusted source such as the Administrator.

The check can be disabled via UaClient.setValidateDiscoveredEndpoints(false).

There should be the following 3 ERROR level logs in the client side logs:
“The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse. Endpoint=…”
“GetEndpoints returned endpoints=…”
“CreateSessionResponse endpoints=…”
That should show the difference, it might provide some insight why did that happen. If not obivious or looks like SDK bug, please (if possible) send that part of the log to uajava-support@prosysopc.com and refer this discussion.

July 16, 2024
16:26, EEST
Avatar
miti
Member
Members
Forum Posts: 5
Member Since:
January 26, 2024
sp_UserOfflineSmall Offline

For the simulation server we use 5.2.2-139 updated from 4.11.0-41
And for client 5.2.0-133 updated from 4.11.0-41

We disabled the ValidateDiscoveredEndpoints and we don’t seem to have the problem any longer but is it safe to do so?
In simulator no problem but I guess we don’t want disabled it later when going to production?

The full log looks like this

java.lang.RuntimeException: com.prosysopc.ua.client.InvalidServerEndpointException: Failed to create session channel to server: : opc.tcp://plc-two:52530/OPCUA/ServerPOC [http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256,SignAndEncrypt] ServiceResult=Bad_UnexpectedError (0x80010000) “An unexpected error occurred.”
at se.tf.saap.rest.opcua.FacilityPLCClient.connect(FacilityPLCClient.java:67)
at se.tf.saap.rest.opcua.OPCUASessionService.connectAndSubscribe(OPCUASessionService.java:191)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.concurrent.ConcurrentHashMap$ValueSpliterator.forEachRemaining(ConcurrentHashMap.java:3612)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at se.tf.saap.rest.opcua.OPCUASessionService.scheduledReconnectionAttempt(OPCUASessionService.java:165)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)
at org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRunnable.java:124)
at io.micrometer.observation.Observation.observe(Observation.java:499)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:124)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.prosysopc.ua.client.InvalidServerEndpointException: Failed to create session channel to server: : opc.tcp://plc-two:52530/OPCUA/ServerPOC [http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256,SignAndEncrypt]
at com.prosysopc.ua.client.UaClient.ciX(SourceFile:5767)
at com.prosysopc.ua.client.UaClient.connect(SourceFile:1066)
at se.tf.saap.rest.opcua.FacilityPLCClient.connect(FacilityPLCClient.java:63)
… 24 common frames omitted
Caused by: com.prosysopc.ua.stack.common.ServiceResultException: Bad_UnexpectedError (code=0x80010000, description=”The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse”)
at com.prosysopc.ua.stack.application.Client.a(SourceFile:1091)
at com.prosysopc.ua.stack.application.Client.createSession(SourceFile:647)
at com.prosysopc.ua.client.UaClient.ciX(SourceFile:5714)
… 26 common frames omitted

July 17, 2024
12:38, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1017
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

I was talking about the application log (files), not the stacktrace of the exception. The 3 ERROR logs are logged by com.prosysopc.ua.stack.application.Client (this is used internally by the UaClient). Typically ERROR logs are logged from all packages, but doublecheck your applications logging configuration. Or alternatively if you can deploy the sampleconsoleserver example as-is to the server you could test vs. that to see if it happens with that as well (and that would log it by default on the console, with modifications to logback.xml you could also make it log to files).

Anyway, this is odd, I do not recall anything 4.11.0 -> 5.x that should affect this. There are changes in the encoding system and there is more localization support, but neither should matter. Thus preferably I would need to see the 3 log lines that would show the both service results and the mismatching EndpointDescription.

Explaining the flag is quite long, so I’ll do a separate post for it later if needed.

July 17, 2024
14:43, EEST
Avatar
miti
Member
Members
Forum Posts: 5
Member Since:
January 26, 2024
sp_UserOfflineSmall Offline

Sorry misunderstood what you asked for.
Hope these are what you are looking for.

CreateSessionResponse endpoints=[EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”None”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#None”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”0″], EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”Sign”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”1″], EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”SignAndEncrypt”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256″, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”2″], EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”SignAndEncrypt”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”2″], EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”Sign”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256″, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”1″], EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”Sign”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”1″], EndpointDescription [EndpointUrl=”opc.tcp://61f441fa9d5c:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”SignAndEncrypt”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”2″]]

GetEndpoints returned endpoints=[EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”None”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#None”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”0″], EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”Sign”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”1″], EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”SignAndEncrypt”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256″, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”2″], EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”SignAndEncrypt”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”2″], EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”Sign”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256″, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”1″], EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”Sign”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”1″], EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”SignAndEncrypt”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”2″]]

The endpoint received from GetEndpoints is not in the endpoints of CreateSessionResponse. Endpoint=EndpointDescription [EndpointUrl=”opc.tcp://5a55695bc41a:52530/OPCUA/ServerPOC”, Server=”null”, ServerCertificate=”null”, SecurityMode=”None”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#None”, UserIdentityTokens=”[UserTokenPolicy [PolicyId=”username_basic128″, TokenType=”UserName”, IssuedTokenType=”null”, IssuerEndpointUrl=”null”, SecurityPolicyUri=”http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15″]]”, TransportProfileUri=”http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary”, SecurityLevel=”0″

Besides changing versions on opc ua from 4 -> 5 we also changed JDK from 17 -> 21.

We received a license file for the simulator. Haven’t yet found in documentation where to place it. Is it in the rescources folder?

July 17, 2024
15:56, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1017
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Do you have some sort of “load-balanced container-environment” for the server side? Is this also new related to this change? Asking because the hostnames do look like ones typically in such environments and thus it might fail due to that i.e. because CreateSessionResponse has references to ‘opc.tcp://61f441fa9d5c:52530…’ which is different from the hostname where the GetEndpoints was made ‘opc.tcp://5a55695bc41a:52530…’. Skipping some details, but the GetEndpoints “query” is done on a separate connection. You must ensure those connections happen to the same instance e.g. based on the connection IP or something on the load balancer.

The SDK doesn’t use a license file, you just swap the evaluation jar with the one from the licensed edition .zips. But seems there might be some confusion so I’ll continue by mail.

July 17, 2024
17:11, EEST
Avatar
miti
Member
Members
Forum Posts: 5
Member Since:
January 26, 2024
sp_UserOfflineSmall Offline

We run in docker containers in a docker swarm cluster but it’s nothing new. Same as before when we had version 4.
I’ll discuss it with my collegue tomorrow how to achieve that is done on the same instance.

July 17, 2024
17:58, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1017
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

I’ll try to write more details as well tomorrow as this misses some details. I must note that we have limited experience with such environments. But basically as far as I’m aware, 4.x should have been no different than 5.x regarding this, thus that should have failed as well. But it could be just e.g. luck and depending how the load balancer works (e.g. 5.x has more datatypes, we read those on connect, thus 5.x connections would read/browse a bit more than 4.x etc. so maybe that affects … things). Or I could be missing something.

Technically here the failure was that the hostname was different for the instances. In Docker that is basically random if not set (and I think you can only have one per hostname?).

Additionally, if security is being used, if each instance has made their own certificate that could be an additional thing that could fail.

However, IF each instance loads the same certificate (i.e. that is made separately, either with the SDK or some 3rd party tool), there could maybe be a trick via static com.prosysopc.ua.ApplicationIdentity.setActualHostName(String). If you would use that at the “start of main” before other interactions with the SDK, that does override the hostname resolution. Use the FQN version of the hostname, if one exist. Then the endpointurl in the endpointdescriptions should be the same in all instances and it technically shouldn’t matter to which instance the GetEndpoints went. However please note that still I highly recommend to configure the load balancer in a such way that clients would retain the instance they initially connected to because otherwise if a reconnect happens the session must be always redone (and you will also lose any data for Subscriptions that could have collected data during the connection break, though depends one the needs of your case). Also some clients (not ours) do try to use the EndpointUrl for connection purposes after GetEndpoints (matters only if some other SDK clients are used) basically the scenario is equivalent to the server being behind a NAT (thus that is why we keep using the original defined connection address).

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 86

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 737

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1510

Posts: 6399

Newest Members:

helenmcrae1419, srijithvijay, tammyhillier, rodsFioravanti, Sairamreddy, wj, valentinafluhart, accusneds, Jamesses, DavidLarry

Moderators: Jouni Aro: 1019, Pyry: 1, Petri: 0, Bjarne Boström: 1017, Jimmy Ni: 26, Matti Siponen: 340, Lusetti: 0

Administrators: admin: 1