FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.04k stars 345 forks source link

Parent node does not exist issue while starting using server-with-encryption.py #1610

Closed PVenkateshmurthy closed 2 months ago

PVenkateshmurthy commented 3 months ago

I am trying to run server-with-encryption.py and start the server via python server-with-encryption.py command from terminal. I got requested parent node does not exist issue.

I tried debugging by keeping a breaking point at

populating our address space

myobj = await server.nodes.objects.add_object(idx, "MyObject"), then I got the below debug report. It says OSError: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 4840): only one usage of each socket address (protocol/network address/port) is normally permitted.

C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\venv\Scripts\python.exe "C:/Program Files/JetBrains/PyCharm Community Edition 2022.3.3/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 59154 --file C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples\server-with-encryption.py Connected to pydev debugger (build 223.8836.43) INFO:asyncua.server.internal_session:Created internal session Internal INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=11715, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15958, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15959, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15960, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15961, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15962, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15963, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=15964, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=16134, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=16135, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.address_space:add_node: while adding node NumericNodeId(Identifier=16136, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>), requested parent node NumericNodeId(Identifier=15957, NamespaceIndex=0, NodeIdType=<NodeIdType.Numeric: 2>) does not exists INFO:asyncua.server.internal_server:starting internal server ERROR:asyncua.server.server:OPC UA Server(opc.tcp://0.0.0.0:4840/freeopcua/server/) error starting server Traceback (most recent call last): File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples..\asyncua\server\server.py", line 551, in start await self.bserver.start() File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples..\asyncua\server\binary_server_asyncio.py", line 139, in start self._server = await asyncio.get_running_loop().create_server(self._make_protocol, self.hostname, self.port) File "C:\Users\Prasad.DV\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1506, in create_server raise OSError(err.errno, 'error while attempting ' OSError: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 4840): only one usage of each socket address (protocol/network address/port) is normally permitted INFO:asyncua.server.internal_server:stopping internal server INFO:asyncua.server.internal_session:close session Internal INFO:asyncua.server.subscription_service:delete subscriptions: [] Traceback (most recent call last): File "C:\Users\Prasad.DV\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Prasad.DV\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 647, in run_until_complete return future.result() File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples\server-with-encryption.py", line 82, in main async with server: File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples..\asyncua\server\server.py", line 220, in aenter await self.start() File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples..\asyncua\server\server.py", line 555, in start raise exp File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples..\asyncua\server\server.py", line 551, in start await self.bserver.start() File "C:\Users\Prasad.DV\PycharmProjects\OPCUA_Client_Automation\examples..\asyncua\server\binary_server_asyncio.py", line 139, in start self._server = await asyncio.get_running_loop().create_server(self._make_protocol, self.hostname, self.port) File "C:\Users\Prasad.DV\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1506, in create_server raise OSError(err.errno, 'error while attempting ' OSError: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 4840): only one usage of each socket address (protocol/network address/port) is normally permitted python-BaseException

Process finished with exit code 1

Can somebody help me in resolving this issue

schroeder- commented 2 months ago

See this error: OSError: [Errno 10048] error while attempting to bind on address ('0.0.0.0', 4840): only one usage of each socket address (protocol/network address/port) is normally permitted