Open DamianFlynn opened 4 years ago
This is by design. There is a lot of state information that is stored in the broker via Retained messages and the only way to “restore” some of that information without some overly complex logic to handle reconnect etc is restarting the ozwdaemon.
You should probably set a docker policy to restart the ozwdaemon container automatically to handle this.
is it possible this happens because a username and password is required? Is it possible to add these to the initial build command?
Searching for a solution to my problem I stumbled upon this bugreport.
This has nothing to do with username/password. My mqtt broker has no username/password, but still I need to restart qt-openzwave after the connection to mqtt has been lost...
Unfortunately, automatically restarting ozwdaemon is not really possible in my environment as I have the ozwdaemon container running on a completely different host than most of my other stuff (mqtt, hass, etc.).
I'm not really sure what the current state of this issue is: not fixable, or (because the labels 'enhancement' and 'help wanted' were added) not fixable yet, but if there is a solution it might possibly get done?
Unfortunately, automatically restarting ozwdaemon is not really possible in my environment as I have the ozwdaemon container running on a completely different host than most of my other stuff (mqtt, hass, etc.).
@vloris Why does it matter where the container is running? A Docker restart policy of on-failure
or always
will keep restarting the container until it can reach the MQTT server again. There is a requirement that the container be up for 10 seconds in order to be restarted. In my testing that was true, but it could vary case by case. I kept the MQTT server down for several minutes, and after starting it again ozwd was eventually able to connect again.
If not Docker, systemd and other supervisors can restart containers on failure, with configurable restart timers, etc.
It is definitely undesirable for the entire Z-Wave network to be restarted for this situation though, so perhaps that is where the enhancement tag comes into play.
Just noticed you were asking about this in the HA forums. In response there was this interesting suggestion about bridging an mqtt broker that is local to the ozwd host to your main mqtt broker. As long as the local broker is running (which should be simpler to achieve), ozwd won't restart. In fact, the HA supervisded addon is already implementing this method, although all the brokers are local to the same host, but are in different containers.
I think I wrote it not clear enough. What I was trying to say is that I don’t want ozwdaemon to continuously try to restart until finally MQTT is available again. The ‘automation’ I was referring to was a way to only have ozwdaemon restart after the MQTT broker was online again.
The bridging suggestion on the HA forum sounds like a really good idea, I will try that soon.
Noticed that when I reboot the node running the MQTT broker
this is what i see, no crash dump is generated in this scenario