Closed GoetzGoerisch closed 1 year ago
For me the Error is still present when trying to import on sync or on async server. I attached a log file to this post for the importing procedure.
Version
Python-Version: 3.7.9
opcua-asyncio Version: _0.9.92
This issue is still up-to-date:
Exception: ('Error no extension class registered ', 'PIDParametersDataType', NodeId(Identifier=3023, NamespaceIndex=4, NodeIdType=<NodeIdType.Numeric: 2>))
This DataType was not added to the extension_objects_by_typeid
while importing, which .
Do you have any clue what could be the cause @oroulet ?
@swamper123 maybe this recent patch helps here: #947.
Thank you @schroeder- Tried with the latest commit: https://github.com/umati/Sample-Server-asyncio/pull/40/commits/f8da71ec2e6e823aef4222832aee3724f59422a5
Still no luck.
WARNING:asyncua.common.xmlimporter:failure adding node NodeData(nodeid:NodeId(Identifier=6318, NamespaceIndex=8, NodeIdType=<NodeIdType.Numeric: 2>)) maximum recursion depth exceeded while calling a Python object
WARNING:asyncua.common.xmlimporter:Model is missing: http://opcfoundation.org/UA/PlasticsRubber/GeneralTypes/ - Version: 1.03.01 - PublicationDate: 2022-07-13T00:00:00Z or newer
Traceback (most recent call last):
File "/src/server.py", line 300, in <module>
Start setup...
Setup done! 1.9531893730163574s
Importing companion spec. XML...
UpdateBehavior = ua.UInt32
Handle = ua.UInt32
maximum recursion depth exceeded while calling a Python object
Server doesn't satisfy required XML-Models. Import them first!
asyncio.run(main())
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/src/server.py", line 137, in main
pr_imm2mes_idx = await server.get_namespace_index("http://opcfoundation.org/UA/PlasticsRubber/IMM2MES/")
File "/src/asyncua/asyncua/server/server.py", line 499, in get_namespace_index
return uries.index(uri)
ValueError: 'http://opcfoundation.org/UA/PlasticsRubber/IMM2MES/' is not in list
You have to to add the parameter: strict_mode=False
So this should be the call:
await server.import_xml(os.path.join(BASE_DIR, "nodeset", "Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml"), strict_mode=False)
Then all errors are converted to warnings. Maybe this helps to load the nodeset until we fix the underlying issue.
Thank you @schroeder- It works a bit further, at least it starts to import 40077 but throws a lot of Error due to ExtensionObjects. Still does not start the server.
I checked it and found the following:
This modified nodeset loads: Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.txt
Thanks @schroeder- still don't work for me. See above. Now the max recursion depth is exceeded. e2c1f39
With #1259 everything works without any changes or strict_mode=False
Can confirm from my side: https://github.com/umati/Sample-Server-asyncio/commit/b257fb489ecc757c344f994083f4526102a80c50
Describe the bug
While importing the nodeset 40083 GeneralTypes the importer fails with:
As per discussion with @AndreasHeine we might need to create structs on the fly, while importing.
To Reproduce
Steps to reproduce the behavior incl code: Implement server as per: https://github.com/umati/Sample-Server-asyncio/pull/40 with
logging.basicConfig(level=logging.DEBUG)
Expected behavior
The the companion spec is imported and instanciated correctly.
Screenshots
The PR above.
Version
Python-Version: 3.9
opcua-asyncio Version (e.g. master branch, 0.9): 0.9.90