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
Prosys OPC UA simulation server not running in my local machine
October 8, 2021
14:18, EEST
Avatar
murugan1991info
Member
Members
Forum Posts: 7
Member Since:
October 1, 2021
sp_UserOfflineSmall Offline

Hi Team,

I have installed free version of Opc UA simulation server in my machine(windows 10) and it was able to run early. But now after restarting my machine It’s not running,

In a “Server Status” it’s showing “ERROR: Failed to initialize server endpoint: opc.tcp:” . Please guide me to solve this.Cry

October 8, 2021
15:30, EEST
Avatar
Markus Johansson
Moderator
Members

Moderators
Forum Posts: 42
Member Since:
August 6, 2019
sp_UserOfflineSmall Offline

Hi,

You can try to resolve this by removing the file “serverSettings.xml” at C:\Users\[USERNAME]\.prosysopc\prosys-opc-ua-simulation-server and then restart the application.

August 1, 2022
19:15, EEST
Avatar
IanL
New Member
Members
Forum Posts: 1
Member Since:
August 1, 2022
sp_UserOfflineSmall Offline

I have just encountered the same problem (In “Server Status” it’s showing “ERROR: Failed to initialize server endpoint: opc.tcp…:” )

I’ve been using the Prosys OPC UA Simulation Server free edition for an online learning course for some months, so wonder if my license might have expired?

I was able to use the Simulation Server earlier today, but when I stopped and restarted it the error appeared.

I tried reinstalling, and removing the file “serverSettings.xml” , but that did not help.

I notice in the log that the bind is failing (see below).

Can you help recover use of Prosys OPC UA Simulation Server?

08/01/2022 17:04:03.411 ERROR [b STARTING] com.prosysopc.ua.stack.transport.tcp.nio.f [] – Failed to bind address /0:0:0:0:0:0:0:0:53530
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:461) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:453) ~[?:?]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) ~[?:?]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80) ~[?:?]
at com.prosysopc.ua.stack.utils.asyncsocket.g.b(SourceFile:130) ~[app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.stack.utils.asyncsocket.c.a(SourceFile:130) ~[app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.stack.transport.tcp.nio.f.a(SourceFile:397) [app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.stack.a.e.a(SourceFile:228) [app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.server.aq.cn(SourceFile:2189) [app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.server.aq.Ao(SourceFile:2236) [app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.server.aq.start(SourceFile:2097) [app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.app.simserver.server.d.start(SourceFile:186) [app-5.1.2-358.jar:5.1.2-358]
at com.prosysopc.ua.app.simserver.server.d$b.startUp(SourceFile:96) [app-5.1.2-358.jar:5.1.2-358]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:61) [guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:119) [guava-29.0-jre.jar:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
08/01/2022 17:04:03.424 INFO [b STARTING] com.prosysopc.ua.stack.transport.tcp.nio.f [] – null closed

UPDATE: I changed the OCP/TCP port in serverSettings.xml, and the Simulation Server started OK.
52520

I haven’t found why it started having problems with the default port 53530, which doesn’t seem to be in use by anything else.

August 2, 2022
11:56, EEST
Avatar
Markus Johansson
Moderator
Members

Moderators
Forum Posts: 42
Member Since:
August 6, 2019
sp_UserOfflineSmall Offline

Hi,

Good to hear that you got it working. The issue does indeed point to the port not being available. Are you possibly using Docker in Windows? You can also check for any port exclusion ranges with the command “netsh interface ipv4 show excludedportrange protocol=tcp”. Ports inside the exclusion ranges are also unavailable for applications and these ranges can change between system restarts.

August 10, 2022
12:41, EEST
Avatar
in-fke
Member
Members
Forum Posts: 26
Member Since:
June 8, 2016
sp_UserOfflineSmall Offline

The auto-discovery of endpoints should be excluding the host “host.docker.internal” automatically, which it doesn’t.
@Prosys this is a feauture request to you guys.

Apparently the Servers tries to bind to the same port twice which let’s the whole start fail.

08/10/2022 10:59:00.661 ERROR [SimulationServer] com.prosysopc.ua.app.simserver.i [] – Could not start the application.
java.lang.IllegalStateException: Expected the service f [FAILED] to be RUNNING, but the service has FAILED
at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:379) ~[guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:303) ~[guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.AbstractIdleService.awaitRunning(AbstractIdleService.java:164) ~[guava-29.0-jre.jar:?]
at com.prosysopc.ua.app.simserver.i.b(SourceFile:94) ~[app-5.2.2-9.jar:5.2.2-9]
at com.prosysopc.ua.app.simserver.SimulationServer.main(SourceFile:32) ~[app-5.2.2-9.jar:5.2.2-9]
at com.prosysopc.ua.app.Main.main(Main.java:13) ~[prosys-opc-ua-simulation-server-5.2.2-9.jar:5.2.2-9]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) ~[i4jruntime.jar:?]
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94) ~[i4jruntime.jar:?]
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25) ~[i4jruntime.jar:?]
Caused by: java.lang.IllegalStateException: Expected to be healthy after starting. The following services are not running: {FAILED=[b [FAILED]]}
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.checkHealthy(ServiceManager.java:782) ~[guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.ServiceManager$ServiceManagerState.awaitHealthy(ServiceManager.java:594) ~[guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.ServiceManager.awaitHealthy(ServiceManager.java:322) ~[guava-29.0-jre.jar:?]
at com.prosysopc.ua.app.simserver.services.f.startUp(SourceFile:77) ~[app-5.2.2-9.jar:5.2.2-9]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:61) ~[guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:119) ~[guava-29.0-jre.jar:?]
at java.lang.Thread.run(Thread.java:834) ~[?:?]
Suppressed: com.google.common.util.concurrent.ServiceManager$FailedService: b [FAILED]
Caused by: com.prosysopc.ua.server.ar: Failed to initialize server endpoint: opc.tcp://host.docker.internal:53530/OPCUA/SimulationServer
at com.prosysopc.ua.server.aq.cq(SourceFile:2239) ~[app-5.2.2-9.jar:5.2.2-9]
at com.prosysopc.ua.server.aq.AO(SourceFile:2254) ~[app-5.2.2-9.jar:5.2.2-9]
at com.prosysopc.ua.server.aq.start(SourceFile:2115) ~[app-5.2.2-9.jar:5.2.2-9]
at com.prosysopc.ua.app.simserver.server.d.start(SourceFile:186) ~[app-5.2.2-9.jar:5.2.2-9]
at com.prosysopc.ua.app.simserver.server.d$b.startUp(SourceFile:96) ~[app-5.2.2-9.jar:5.2.2-9]
at com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:61) ~[guava-29.0-jre.jar:?]
at com.google.common.util.concurrent.Callables$4.run(Callables.java:119) ~[guava-29.0-jre.jar:?]
at java.lang.Thread.run(Thread.java:834) ~[?:?]

Deleting serverSettings.xml would not help.
It got generated with.

I tried
false
and it would not help.
I tried

127.0.0.1

and it would not help.

I tried

localhost

and it would not help.

I tried pausing Docker Desktop and it would not help.
I tried quitting Docker Desktop and it would not help.
(always the exception with trying to bind to host.docker.internal)

I noticed this section in my hosts file:
# Added by Docker Desktop
10.254.81.31 host.docker.internal
10.254.81.31 gateway.docker.internal
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal

commenting these out, I still get
ERROR: Failed to initialize server endpoint: opc.tcp://:53530/OPCUA/SimulationServer

I gues workaround should be limiting the auto-discovery, but I don’t know how to configure it properly. Please advise.

I am willing to set up a Remote Call, feel free to get in touch with me.
I also have some code I could borrow, that I use for my own OPC UA Server (stuff in conjunction with NetworkInterface.getNetworkInterfaces()).

August 10, 2022
13:04, EEST
Avatar
in-fke
Member
Members
Forum Posts: 26
Member Since:
June 8, 2016
sp_UserOfflineSmall Offline

Sorry for the bad formatting of the previous post. Some XML tags got gobbled because the forum does not like that markup? Is there a way to escape preformatted text in this forum?

August 10, 2022
13:58, EEST
Avatar
Markus Johansson
Moderator
Members

Moderators
Forum Posts: 42
Member Since:
August 6, 2019
sp_UserOfflineSmall Offline

You can try adding “opcTcpAddress” tag with the IP value you wish to use inside “opcTcpAddresses” along with setting “useAllIPAddresses” to false in serverSettings.xml.

Thanks for reporting the issue and we will see if we can get some improvements in future releases. And yes the forum does not like XML.

August 10, 2022
14:07, EEST
Avatar
in-fke
Member
Members
Forum Posts: 26
Member Since:
June 8, 2016
sp_UserOfflineSmall Offline

Thank you for the quick reply Markus, I tried fiddeling with serverSettings.xml but could not get it to work.
My offer stands that we make an online session (GMT+1) you should have my contact data.

August 11, 2022
12:17, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 860
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

This is sort of a known problem (it is basically SDK-related in a way), but maybe everyone who had it managed to make do with a workaround. Regardless we must investigate this more. It is somewhat complicated (unless this is a different problem) as the issue is not per se the binding, but instead the process we try to resolve the FQN version of the hostname (i.e. endpoint url is separate from the server socket bind addresses).

So, we do use basically ‘InetAddress.getLocalHost()’ and then try to also check the canonical version (the only way as far as I’m yet aware to get the FQN hostname, though that is best-effort as well). These codes behave differently depending on the OS and the contents of the hosts files. Java basically (internally) does a reverse-DNS for the IP when we ask the canonical form (unless on some OS+settings it already was FQN in which case it is not needed). Since Docker does edit the hosts file, if it so happens in this case that Java happens to give us the IP which would in this case be 10.254.81.31 and then on the reverse lookup it would be resolved to the docker.host.internal. This might not be the proper address to begin with, it could e.g. just be the first adapter etc., but is the reason why that happens.

Anyway, there was a workaround I think that you could just add a line before the docker.host.internal that has the same IP and then your hostname as the value, then the reverse-DNS would pick up that instead of the docker internal address (as it just takes the first match). In theory I guess a 3rd line might be needed if it is then problem that the hostname itself resolves to that address (thus a 3rd line before that has the real IP address and then the hostname again might help, not sure).

We are not yet sure of a better way (also it must work in Java 6, as that is the baseline, or like in the apps we have 11 or 17, but preferably it should work the same way as with the SDK as the apps also showcase the SDK in a way). (Like in the SDK we do have a way to set the value outside of the SDK if known via ApplicationIdentity.setActualHostname(…))

If you want you can send code to uajava-support@prosysopc.com, but per se it shouldn’t be binding related here I think. Though that is a separate topic (i.e. if you can, by defaults we should be binding to the 0.0.0.0 wildcard or IPv6 equivalent, that by itself solves a number of problems, but skipping details for now…).

September 12, 2022
14:59, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 860
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline
October 19, 2022
10:50, EEST
Avatar
willmackey
New Member
Members
Forum Posts: 1
Member Since:
October 18, 2022
sp_UserOfflineSmall Offline

This is still happening in the 5.3 version.

October 19, 2022
14:32, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 860
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

(Will be continued/answered via email, but I’ll note that this is not related to docker, but while investigating there might still be some issues regarding the “host.docker.internal” on windows)

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 124

pramanj: 86

ibrahim: 74

rocket science: 65

kapsl: 57

Sabari: 51

gjevremovic: 49

Xavier: 43

fred: 41

TimK: 41

Member Stats:

Guest Posters: 0

Members: 1759

Moderators: 15

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1323

Posts: 5649

Newest Members:

LenkaLok, seoninet, justinevillanuev, namtrott5457, DonaldWibip, AlfredoEthix, andreidla, everangel7021, Larryhed, agustincatts6

Moderators: Jouni Aro: 960, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 860, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 222, Lusetti: 0

Administrators: admin: 1