OctoPrint / OctoPrint-MQTT

An OctoPrint Plugin that adds support for MQTT.
GNU Affero General Public License v3.0
155 stars 53 forks source link

OctoPrint disconnects immediately from MQTT broker #131

Open cerebrate opened 1 year ago

cerebrate commented 1 year ago

What were you doing?

The problem occurs immediately on OctoPrint start/restart, with no actions required.

(This started happening - I believe - a few days ago, but unfortunately I can't pin it down to a specific event.)

What did you expect to happen?

OctoPrint-MQTT to successfully connect to the MQTT broker and supply information as normal.

What happened instead?

No OctoPrint-MQTT messages are sent (other than the "last will" message). The error:

octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1

appears repeatedly in the log. Based on tests done, there are no network connectivity issues between the OctoPrint host and the broker.

Version of OctoPrint

1.8.6

Version of the MQTT plugin

0.8.13

Used MQTT broker and its version

mosquitto version 2.0.15

Link to octoprint.log

https://gist.github.com/cerebrate/066c5ee8aac5fd7435b7853a98bc4d01

I also took the liberty of setting debug on the MQTT broker, which produced the following output when OctoPrint-MQTT attempted to connect:

1675195957: New client connected from 10.42.0.211:38832 as octoprint_ender (p2, c0, k60).                                                                                                                  
1675195957: Will message specified (12 bytes) (r1, q1).                                                                                         
1675195957:     octoPrint/mqtt                                                                                                                  
1675195957: Sending CONNACK to octoprint_ender (1, 0)                                                                                           
1675195957: Client octoprint_ender closed its connection.