OctoPrint/OctoPrint-MQTT

Plugin is incompatible with paho-mqtt 2

Aneurin opened this issue · 1 comments

In setup.py, dependencies are declared as plugin_requires = ["OctoPrint>=1.3.5", "six", "paho-mqtt"]. This just gets the latest version of paho-mqtt, but version 2 was recently released, which is a breaking change: https://github.com/eclipse/paho.mqtt.python/blob/master/docs/migrations.rst. This plugin therefore crashes on startup.

I'm guessing that a short-term solution could be as simple as plugin_requires = ["OctoPrint>=1.3.5", "six", "paho-mqtt<2"], though I haven't tried it.

What were you doing?

Installed plugin on a fresh Octopi image, and configured.

What did you expect to happen?

Messages are sent via MQTT

What happened instead?

In the UI: nothing.

In the log:

2024-02-10 17:05:53,537 - octoprint.plugin - ERROR - Error while calling plugin mqtt
Traceback (most recent call last):
  File "/home/nye/oprint/lib/python3.9/site-packages/octoprint/plugin/__init__.py", line 275, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/nye/oprint/lib/python3.9/site-packages/octoprint/util/__init__.py", line 1686, in wrapper
    return f(*args, **kwargs)
  File "/home/nye/oprint/lib/python3.9/site-packages/octoprint_mqtt/__init__.py", line 86, in on_startup
    self.mqtt_connect()
  File "/home/nye/oprint/lib/python3.9/site-packages/octoprint_mqtt/__init__.py", line 325, in mqtt_connect
    self._mqtt = mqtt.Client(client_id=client_id, protocol=protocol, clean_session=clean_session)

Version of OctoPrint

1.9.3

Version of the MQTT plugin

0.8.14

Used MQTT broker and its version

N/A - crashes before even trying to connect.

Thanks for your report, new version released that pins version of paho-mqtt to less than 2