14:18, EEST
October 1, 2021
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.
15:30, EEST
August 6, 2019
19:15, EEST
August 1, 2022
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.
11:56, EEST
August 6, 2019
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.
12:41, EEST
June 8, 2016
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()).
13:58, EEST
August 6, 2019
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.
12:17, EEST
April 3, 2012
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…).
14:59, EEST
April 3, 2012
This is now fixed in Simulation Server version 5.3.0:
https://downloads.prosysopc.com/opcua/simulationserver/Prosys_OPC_UA_Simulation_Server_5_Release_Notes.html#version-5-3-0
10:50, EEST
October 18, 2022
14:32, EEST
April 3, 2012
13:47, EET
June 8, 2016
Just as a heads up, this still does not seem to be solved with 5.4.6-148
I was using 2.2.2 because of this, but then I ran into Bind problems with 2.2.2 from one day to another.
There is nothing listening on 53530 as far as I can tell with “netstat” and PowerShell Get-NetTCPConnection.
Unfortunately, the UI stays empty if this initial Bind problem occurs, and I need to edit serverSettings.xml manually.
What is the syntax for this? the following does not have any effect? (trying to restrict the bind addresses to listen to)
127.0.0.1:53530
false
12:17, EEST
April 16, 2024
Same as the post of in-fke, I can confirm this issue still exists in 5.4.16-148 and is not related to docker.
Simulation server has been working fine for several months no, and sundelly this error came up:
ERROR: Failed to initialize server endpoint: opc.tcp://:53531/OPCUA/SimulationServer
– Windows 10 64-bits
– I have no docker installed on my machine
– DNS & reverseDNS resolving is working fine
– nothing listening on port 53530 or 4840
– Tried to remove serversettings.xml
– Added opcTcpAddress tag with fixed ipv4 address inside opcTcpAddresses
– Tried other TCP ports
Log extracts:
04/16/2024 11:14:35.785 ERROR [b STARTING] com.prosysopc.ua.stack.transport.tcp.nio.f [] – Failed to bind address /[0:0:0:0:0:0:0:0]:53531
java.net.BindException: Address already in use: bind
Thanks
13:08, EEST
April 3, 2012
Hi,
Since the last posts, there is one additional candidate: Hyper-V (and possibly some other software) does reserve some ports on Windows.
See https://stackoverflow.com/questions/54010365/how-to-see-what-is-reserving-ephemeral-port-ranges-on-windows see the first 2 answers (in the second one there is “netsh int ip show excludedportrange protocol=tcp”), that should hopefully be able first see that the port was reserved (explains the issue) and then adding it to the excludes causes it to not be reserved anymore (you probably need to restart after adding the port number to the excludes).
Does that help?
Most Users Ever Online: 1919
Currently Online:
36 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1