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] Docker container lacks modules #1196

Closed
LukaszDuss opened this issue Oct 16, 2023 · 0 comments · Fixed by #1202
Closed

[BUG] Docker container lacks modules #1196

LukaszDuss opened this issue Oct 16, 2023 · 0 comments · Fixed by #1202
Assignees
Labels

Comments

@LukaszDuss
Copy link
Contributor

LukaszDuss commented Oct 16, 2023

Describe the bug
Docker install gives me errors
|ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - No module named 'pymodbus'
|ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - No module named 'packaging'

Error traceback:

2023-10-16 08:14:50 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - No module named 'packaging'
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 20, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'
2023-10-16 08:14:50 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/connectors/modbus/slave.py", line 18, in <module>
    from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
2023-10-16 08:14:50 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/grpc_connectors/modbus/modbus_connector.py", line 31, in <module>
    from thingsboard_gateway.grpc_connectors.modbus.slave import Slave
  File "/thingsboard_gateway/grpc_connectors/modbus/slave.py", line 18, in <module>
    from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
2023-10-16 08:14:50 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/grpc_connectors/modbus/slave.py", line 18, in <module>
    from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
2023-10-16 08:14:50 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - __init__ - 54 - Remote Configurator started

after installing pymodbus & packaging with pip inside container and restarting container

2023-10-16 08:18:04 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - No module named 'twisted'
Traceback (most recent call last):
  File "/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 51, in <module>
    from twisted.internet import reactor
ModuleNotFoundError: No module named 'twisted'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/connectors/modbus/modbus_connector.py", line 54, in <module>
    from twisted.internet import reactor
ModuleNotFoundError: No module named 'twisted'
2023-10-16 08:18:04 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/connectors/modbus/slave.py", line 18, in <module>
    from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
2023-10-16 08:18:04 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/grpc_connectors/modbus/modbus_connector.py", line 31, in <module>
    from thingsboard_gateway.grpc_connectors.modbus.slave import Slave
  File "/thingsboard_gateway/grpc_connectors/modbus/slave.py", line 18, in <module>
    from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
2023-10-16 08:18:04 - |ERROR| - [tb_loader.py] - tb_loader - import_module - 72 - cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
Traceback (most recent call last):
  File "/thingsboard_gateway/tb_utility/tb_loader.py", line 65, in import_module
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/thingsboard_gateway/grpc_connectors/modbus/slave.py", line 18, in <module>
    from pymodbus.constants import Defaults
ImportError: cannot import name 'Defaults' from 'pymodbus.constants' (/usr/local/lib/python3.11/site-packages/pymodbus/constants.py)
2023-10-16 08:18:04 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - __init__ - 54 - Remote Configurator started

after installing twisted and container restart

2023-10-16 08:19:28 - |INFO| - [tb_loader.py] - tb_loader - import_module - 68 - Import ModbusConnector from /thingsboard_gateway/connectors/modbus.
2023-10-16 08:19:28 - |INFO| - [tb_gateway_remote_configurator.py] - tb_gateway_remote_configurator - __init__ - 54 - Remote Configurator started

Connector name:
MODBUS

Versions (please complete the following information):

  • OS: Ubuntu 22.04.3
  • Thingsboard IoT Gateway version 3.4.1
  • Docker + portainer
@LukaszDuss LukaszDuss added the bug label Oct 16, 2023
@samson0v samson0v linked a pull request Oct 26, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants