Closed didier-wenzek closed 3 months ago
@didier-wenzek Are you sure this is not actually a problem due to the mosquitto broker trying to bind too early to a network which isn't ready yet? e.g. https://github.com/eclipse/mosquitto/issues/2878
There are already suggestions to change the systemd target to network-online.target
instead of network.target
.
Thanks! Indeed, this has been fixed by changing the mosquitto systemd target to network-online.target instead of network.target.
Describe the bug
Restarting the device using a command sent over MQTT to the agent, let the device in a bad state when mTLS has been configured for MQTT.
mqtt_channel::connection: MQTT: failed to connect to broker at '192.168.1.20:8883': I/O: Connection refused (os error 111)
Failed to associate persisted user main-agent with ACLs, likely due to changed ports while using a per_listener_settings configuration.
This is fixed by restarting mosquitto.
To Reproduce
Configure the mosquitto instance to use certificates
For example if you have set everything up correctly, then your
tedge config list
should look something like this (exact paths might be different though, depending on how you set it up)Trigger a restart
tedge
can no more reconnect over MQTTExpected behavior
On reboot,
Screenshots
Environment (please complete the following information):
Additional context
I found no related mosquitto issue, only a related question: