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

Recognising errors/terminations in the container #54

Open
z-master42 opened this issue Jul 31, 2024 · 0 comments
Open

Recognising errors/terminations in the container #54

z-master42 opened this issue Jul 31, 2024 · 0 comments

Comments

@z-master42
Copy link

Is there a way to register errors/script aborts within the container?

I occasionally have the problem that the connection to the Zendure Broker fails (as far as I can tell, it tries to reconnect for a while) and the script then stops working.

Unfortunately, the container just keeps running and doesn't exit, so I don't notice it directly.

2024-07-31 11:00:46,256:ERROR: Connecting to Zendure's MQTT broker failed!
Traceback (most recent call last):
  File "//solarflow-status.py", line 296, in zendure_mqtt_background_task
    client = connect_zendure_mqtt(auth.clientId)
  File "//solarflow-status.py", line 242, in connect_zendure_mqtt
    zendure_client.connect(broker, port)
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/usr/local/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
2024-07-31 11:00:46,372:ERROR: Connecting to Zendure's MQTT broker failed!
Traceback (most recent call last):
  File "//solarflow-status.py", line 296, in zendure_mqtt_background_task
    client = connect_zendure_mqtt(auth.clientId)
  File "//solarflow-status.py", line 242, in connect_zendure_mqtt
    zendure_client.connect(broker, port)
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/usr/local/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Or

2024-07-23 02:43:03,577:ERROR: Connecting to Zendure's MQTT broker failed!
Traceback (most recent call last):
  File "//solarflow-status.py", line 296, in zendure_mqtt_background_task
    client = connect_zendure_mqtt(auth.clientId)
  File "//solarflow-status.py", line 242, in connect_zendure_mqtt
    zendure_client.connect(broker, port)
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/usr/local/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
TimeoutError: timed out
2024-07-23 02:43:04,500:ERROR: Connecting to Zendure's MQTT broker failed!
Traceback (most recent call last):
  File "//solarflow-status.py", line 296, in zendure_mqtt_background_task
    client = connect_zendure_mqtt(auth.clientId)
  File "//solarflow-status.py", line 242, in connect_zendure_mqtt
    zendure_client.connect(broker, port)
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.10/socket.py", line 845, in create_connection
    raise err
  File "/usr/local/lib/python3.10/socket.py", line 833, in create_connection
    sock.connect(sa)
TimeoutError: timed out
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

1 participant