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

Error-Log #1

Open
trombose009 opened this issue Jan 7, 2025 · 5 comments
Open

Error-Log #1

trombose009 opened this issue Jan 7, 2025 · 5 comments

Comments

@trombose009
Copy link

trombose009 commented Jan 7, 2025

Hi,

thanks a lot for this project. I wanna run it in docker an get this error log:

`DEBUG:root:Starting MQTT
Traceback (most recent call last):
  File "/fronius2mqtt/./fronius2mqtt", line 333, in <module>
    main()
    ~~~~^^
  File "/fronius2mqtt/./fronius2mqtt", line 326, in main
    mqtt_client = init_mqtt()
  File "/fronius2mqtt/./fronius2mqtt", line 205, in init_mqtt
    mqtt_client.connect(daemon_args.mqtt_host, daemon_args.mqtt_port, daemon_args.mqtt_keepalive)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 1435, in connect
    return self.reconnect()
           ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 1598, in reconnect
    self._sock = self._create_socket()
                 ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 4612, in _create_socket
    sock = self._ssl_wrap_socket(sock)
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 4671, in _ssl_wrap_socket
    ssl_sock.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/ssl.py", line 1372, in do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
ConnectionResetError: [Errno 104] Connection reset by peer
Exception ignored in: <function _DeleteDummyThreadOnDel.__del__ at 0xb679f078>
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/threading.py", line 1383, in __del__
TypeError: 'NoneType' object does not support the context manager protocol`

config file:


{
    "mqtt_host": "192.168.178.44",
    "mqtt_port": "1883",
    "mqtt_clientid": "fronius2mqtt",
    "mqtt_topic": "fronius",
    "mqtt_tls": "false",
    "mqtt_tls_version": "TLSv1.2",
    "mqtt_verify_mode": "CERT_NONE",
    "mqtt_tls_no_verify": "false",
    "http_host": "192.168.178.121",
    "http_port": 80,
    "mqtt_keepalive": "300",
    "verbose": "false"
}


@gbeine
Copy link
Owner

gbeine commented Jan 8, 2025

It seems, you're missing the credentials for MQTT.

If mqtt_tls is false, you should leave out mqtt_tls_version, mqtt_verify_mode, mqtt_tls_no_verify - they will have no effect.
I'm not quite sure why there is a reference to _ssl_wrap_socket in the output.

But what you might need are mqtt_user and mqtt_password.

You can also try to set verbose to true to get some more information.

@trombose009
Copy link
Author

trombose009 commented Jan 8, 2025

thanks for answering. I modyfied the conf file as u said but there is still an error.

DEBUG:root:Starting MQTT
Traceback (most recent call last):
  File "/fronius2mqtt/./fronius2mqtt", line 333, in <module>
    main()
    ~~~~^^
  File "/fronius2mqtt/./fronius2mqtt", line 326, in main
    mqtt_client = init_mqtt()
  File "/fronius2mqtt/./fronius2mqtt", line 205, in init_mqtt
    mqtt_client.connect(daemon_args.mqtt_host, daemon_args.mqtt_port, daemon_args.mqtt_keepalive)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 1435, in connect
    return self.reconnect()
           ~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 1598, in reconnect
    self._sock = self._create_socket()
                 ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 4612, in _create_socket
    sock = self._ssl_wrap_socket(sock)
  File "/usr/local/lib/python3.13/site-packages/paho/mqtt/client.py", line 4671, in _ssl_wrap_socket
    ssl_sock.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/ssl.py", line 1372, in do_handshake
    self._sslobj.do_handshake()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
ConnectionResetError: [Errno 104] Connection reset by peer
Exception ignored in: <function _DeleteDummyThreadOnDel.__del__ at 0xb670a078>
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/threading.py", line 1383, in __del__
TypeError: 'NoneType' object does not support the context manager protocol

@gbeine
Copy link
Owner

gbeine commented Jan 8, 2025

For some reason, your MQTT client is trying to connect via SSL which is not configured.
Are there any SSL/TLS related config options in your config file?
If yes, try to remove them.

If that does not solve the issue, please have a look on your docker network configuration.

@gbeine
Copy link
Owner

gbeine commented Jan 10, 2025

Good news - I've located the problem an can fix it this weekend.

@gbeine
Copy link
Owner

gbeine commented Jan 10, 2025

@trombose009 I've fixed the problem with config parsing.
A new version of the docker image is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants