FreeOpcUa / opcua-asyncio

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

TypeError: 'NoneType' object is not iterable raised from asyncua/common/structures.py #838

Closed lovasoa closed 1 year ago

lovasoa commented 2 years ago

Describe the bug
When connecting to a custom opcua server, the reader crashes with the following stack trace

Traceback (most recent call last):
  File "/home/olojkine/.local/lib/python3.10/site-packages/uaclient/uaclient.py", line 128, in connect
    self.client.load_enums()
  File "/home/olojkine/.local/lib/python3.10/site-packages/asyncua/sync.py", line 94, in wrapper
    result = self.tloop.post(aio_func(*args, **kwargs))
  File "/home/olojkine/.local/lib/python3.10/site-packages/asyncua/sync.py", line 52, in post
    return futur.result()
  File "/usr/lib64/python3.10/concurrent/futures/_base.py", line 446, in result
    return self.__get_result()
  File "/usr/lib64/python3.10/concurrent/futures/_base.py", line 391, in __get_result
    raise self._exception
  File "/home/olojkine/.local/lib/python3.10/site-packages/asyncua/client/client.py", line 684, in load_enums
    return await load_enums(self)
  File "/home/olojkine/.local/lib/python3.10/site-packages/asyncua/common/structures.py", line 306, in load_enums
    c = await _get_enum_values(enum_name, server.get_node(child_desc.NodeId))
  File "/home/olojkine/.local/lib/python3.10/site-packages/asyncua/common/structures.py", line 317, in _get_enum_values
    c.fields = [EnumeratedValue(enumval.DisplayName.Text, enumval.Value) for enumval in val]
TypeError: 'NoneType' object is not iterable

To Reproduce

Unfortunately, I cannot provide the source code for our opcua server, but it uses rust's opcua-server crate.

Expected behavior
Browsing the tree works

Screenshots
image

Version
Python-Version: 3.10
python-opcua: latest pypi version

deeTEEcee commented 2 years ago

@lovasoa did you mean to post in https://github.com/FreeOpcUa/opcua-asyncio/issues? Your stacktrace involves asyncua not python-opcua

lovasoa commented 2 years ago

Yes, sorry !

I don't have the permission to do it myself, but could an owner transfer the issue ?

image