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
Address error while starting server
June 12, 2013
13:57, EEST
Avatar
TimK
Member
Members
Forum Posts: 41
Member Since:
June 27, 2012
sp_UserOfflineSmall Offline

I’ve been running the server on Debian Linux with one machine name for months, and now I have changed my machine name from storm to stormy. Before the change, I see this while starting up:

2013-06-12 09:26:44,237[CommandHandler-18] 39 INFO – TCP/IP Socket bound to localhost/127.0.0.1:52520
2013-06-12 09:26:44,246 [CommandHandler-18] 40 INFO – Endpoint bound opc.tcp://localhost:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,246 [CommandHandler-18] 41 INFO – Server endpoint bound to opc.tcp://localhost:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,249 [CommandHandler-18] 42 INFO – Endpoint bound opc.tcp://localhost:52520
2013-06-12 09:26:44,249 [CommandHandler-18] 43 INFO – Discovery endpoint bound to opc.tcp://localhost:52520
2013-06-12 09:26:44,256 [CommandHandler-18] 44 INFO – TCP/IP Socket bound to /192.168.1.222:52520
2013-06-12 09:26:44,256 [CommandHandler-18] 45 INFO – Endpoint bound opc.tcp://192.168.1.222:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,256 [CommandHandler-18] 46 INFO – Server endpoint bound to opc.tcp://192.168.1.222:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,257 [CommandHandler-18] 47 INFO – Endpoint bound opc.tcp://192.168.1.222:52520
2013-06-12 09:26:44,258 [CommandHandler-18] 48 INFO – Discovery endpoint bound to opc.tcp://192.168.1.222:52520
2013-06-12 09:26:44,259 [CommandHandler-18] 49 INFO – Endpoint bound opc.tcp://storm:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,259 [CommandHandler-18] 50 INFO – Server endpoint bound to opc.tcp://storm:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,260 [CommandHandler-18] 51 INFO – Endpoint bound opc.tcp://storm:52520
2013-06-12 09:26:44,260 [CommandHandler-18] 52 INFO – Discovery endpoint bound to opc.tcp://storm:52520
2013-06-12 09:26:44,267 [CommandHandler-18] 53 INFO – TCP/IP Socket bound to /172.16.0.190:52520
2013-06-12 09:26:44,267 [CommandHandler-18] 54 INFO – Endpoint bound opc.tcp://172.16.0.190:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,268 [CommandHandler-18] 55 INFO – Server endpoint bound to opc.tcp://172.16.0.190:52520/OPCUA/OldiOPCServer
2013-06-12 09:26:44,269 [CommandHandler-18] 56 INFO – Endpoint bound opc.tcp://172.16.0.190:52520
2013-06-12 09:26:44,269 [CommandHandler-18] 57 INFO – Discovery endpoint bound to opc.tcp://172.16.0.190:52520

After changing the machine name (and rebooting), I’m seeing this error when trying to start the server:

2013-06-12 09:36:53,180 [CommandHandler-17] 27 INFO – TCP/IP Socket bound to localhost/127.0.0.1:52520
2013-06-12 09:36:53,187 [CommandHandler-17] 28 INFO – Endpoint bound opc.tcp://localhost:52520/OPCUA/OldiOPCServer
2013-06-12 09:36:53,187 [CommandHandler-17] 29 INFO – Server endpoint bound to opc.tcp://localhost:52520/OPCUA/OldiOPCServer
2013-06-12 09:36:53,189 [CommandHandler-17] 30 INFO – Endpoint bound opc.tcp://localhost:52520
2013-06-12 09:36:53,189 [CommandHandler-17] 31 INFO – Discovery endpoint bound to opc.tcp://localhost:52520
2013-06-12 09:36:53,233 [CommandHandler-17] 32 INFO – Endpoint unbound opc.tcp://localhost:52520/OPCUA/OldiOPCServer
2013-06-12 09:36:53,234 [CommandHandler-17] 33 INFO – Server Server urn:stormy:UA:OldiOPCServer closed
2013-06-12 09:36:53,235 [CommandHandler-17] 34 ERROR – Error while starting server
com.prosysopc.ua.server.UaServerException: Failed to initialize server endpoint: opc.tcp://stormy:52520/OPCUA/OldiOPCServer
at com.prosysopc.ua.server.UaServer.a(Unknown Source)
at com.prosysopc.ua.server.UaServer.start(Unknown Source)
at com.oldi.opcuaserver.OPCServer.setMode(OPCServer.java:388)
at com.oldi.opcuaserver.commands.RTOPCSetModeCommand.Execute(RTOPCSetModeCommand.java:32)
at com.oldi.eATM.common.commbase.ConfigBase.ExecuteCommand(ConfigBase.java:221)
at com.oldi.eATM.common.commbase.CommandHandler.CommandThread(CommandHandler.java:92)
at com.oldi.eATM.common.commbase.CommandHandler.access$0(CommandHandler.java:72)
at com.oldi.eATM.common.commbase.CommandHandler$1.run(CommandHandler.java:42)
Caused by: org.opcfoundation.ua.common.ServiceResultException: Bad_UnexpectedError (code=0x80010000, description=”Cannot assign requested address”)
at org.opcfoundation.ua.transport.BindingFactory.bind(Unknown Source)
at org.opcfoundation.ua.application.Server.bind(Unknown Source)
… 8 more
Caused by: java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:344)
at sun.nio.ch.Net.bind(Net.java:336)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.opcfoundation.ua.utils.asyncsocket.ListenableServerSocketChannel.bind(Unknown Source)
at org.opcfoundation.ua.utils.asyncsocket.AsyncServerSocket.bind(Unknown Source)
at org.opcfoundation.ua.transport.tcp.nio.UATcpServer.bind(Unknown Source)
at org.opcfoundation.ua.transport.tcp.nio.UATcpServer.(Unknown Source)
… 10 more

I’m not sure why this would happen. What does it mean to bind to endpoint URLs with different machine names? Isn’t this just listening on port 52520?

June 12, 2013
14:59, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

It will try to convert the hostname to an IP address and fails. Or that’s what I assume: it fails to bind to the specified address (stormy)

Have you added/changed the hostname in /etc/hosts? Can you ping with the name?

June 13, 2013
13:19, EEST
Avatar
TimK
Member
Members
Forum Posts: 41
Member Since:
June 27, 2012
sp_UserOfflineSmall Offline

My server has two network adapters. One is set to a static IP – 172.16…, and the other is received from DHCP – 192.168…

I’m already adding the endpoint for the static address manually – on Linux, the toolkit doesn’t seem to find that one on its own.

If I put the hostname with the DHCP address into the hosts file, then everything works okay – I see bindings for stormy, localhost, 192.168…, and 172.16…
I don’t like this because the address is dynamic, and doesn’t really belong in the hosts file.

If I leave it out, then I get the exception above. I also tried adding an endpoint manually for the DHCP address, but that didn’t help either.

June 14, 2013
7:24, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

OK, does not sound very optimal. We are changing the bindings to SDK 2.0, which should enable more flexibility.

Can you configure your DHCP server to provide a fixed address for this computer?

I wonder why it worked with your older hostname – have you configured the DNS server with the change?

June 14, 2013
13:16, EEST
Avatar
TimK
Member
Members
Forum Posts: 41
Member Since:
June 27, 2012
sp_UserOfflineSmall Offline

The reason it worked with the older hostname was a fluke – it turns out my ISP has a machine with the same name in DNS. I wasn’t using the machine name to connect, but having the other machine out there kept the lookup from failing.

For local testing, I can do anything I want with the settings, but our customers expect to be able to use DHCP. Our product is an appliance, so they don’t have direct access to the OS, and I don’t want to get into a situation where they can’t start the server up if the DNS server is down.

How hard would it be to change the startup code so that when a lookup fails, the server goes ahead and starts up with the rest of the bindings? My server has two adapters, so if DNS is down on one network, I would like the other network to still allow access to the server.

June 14, 2013
15:13, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

I will check it.

June 18, 2013
9:41, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

I added a new property, UaServer.failOnBindError, which can be set to false to omit binding errors. The drawback is that it will hide all binding errors, e.g. if the port is already in use.

But you can try it and see if it helps. I sent you a download link to a beta.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
49 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_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1