Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TypeError in OPC-UA Connector: Unsupported Operand 'NoneType' + 'str' Since v3.7.0 #1680

Open
SamuelHelbling opened this issue Feb 18, 2025 · 1 comment
Assignees
Labels
bug can be closed Label uses when issue is fixed or feature is added and will be available in the next release.

Comments

@SamuelHelbling
Copy link
Contributor

SamuelHelbling commented Feb 18, 2025

Describe the bug
When running the OPC-UA Connector in ThingsBoard Gateway, an error occurs due to an unsupported operation between NoneType and str. The error originates from the _find_nodes function when attempting to concatenate a NoneType value with a string. This issue started occurring in version 3.7.0, whereas previous versions did not have this problem.

Recent changes in version 3.7.0, particularly in the _find_nodes function within opcua_connector.py, may have introduced scenarios where child_node.Name can be None, leading to this error. Reviewing the changes between versions 3.6.3 and 3.7.0 suggests that handling of child_node.Name was modified, potentially omitting necessary checks for None values.

Connector name (If bug in the some connector):
OPC-UA Connector

Error traceback (If available):

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
2025-02-18 13:25:34 - INFO  - [opcua_connector.py] - opcua_connector - _find_nodes - 504 - Found node: admin
2025-02-18 13:25:34 - ERROR - [tb_logger.py] - tb_logger - exception - 185 - unsupported operand type(s) for +: 'NoneType' and 'str'
Traceback (most recent call last):
  File "/thingsboard_gateway/connectors/opcua/opcua_connector.py", line 674, in _load_devices_nodes
  File "/thingsboard_gateway/connectors/opcua/opcua_connector.py", line 537, in find_node_name_space_index
    return await self.find_nodes(unresolved, current_parent_node=parent_node, nodes=resolved)
  File "/thingsboard_gateway/connectors/opcua/opcua_connector.py", line 510, in _find_nodes
    path_path + '.' + f'{child_node.Name}')

Versions (please complete the following information):

  • OS: Docker
  • ThingsBoard IoT Gateway version: 3.7.0
@imbeacon
Copy link
Member

Hi @SamuelHelbling,

Thank you for your interest in ThingsBoard IoT Gateway.
There was added path to display map of the server, please find attached commit, it contains changes to the default value and the error should not appear after applying it.

@imbeacon imbeacon added the can be closed Label uses when issue is fixed or feature is added and will be available in the next release. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can be closed Label uses when issue is fixed or feature is added and will be available in the next release.
Projects
None yet
Development

No branches or pull requests

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy