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

*.conf file in share/mosquitto on homeassistant is not recognized anymore in 6.2.0 - except if it is named mosquitto.conf #2776

Open
raphael303 opened this issue Mar 28, 2023 · 24 comments

Comments

@raphael303
Copy link

Hi

I have mosquitto on homeassistant. I had a file named "Cerbobridge.conf" in the folder share/mosquitto in homeassistant. With the the file contained:
connection CerboGX
address 192.168.1.104
topic # both 0 CerboGX/

Which bridged the brokers.
It worked fine until I updated to 6.2.0

After that the bridge did not work anymore.

After a little trouble shooting and restarting without success I simply renamed the file to: mosquitto.conf - A restart later the bridge worked again.

I don't know if this is a bug or a feature, but either way it will cause headaches. So I hope this helps others.

@fjarvis
Copy link

fjarvis commented Mar 28, 2023

Hi @raphael303,

Thanks you!! I have had this exact same issue today with Mosquitto bridging to my Victron CerboGX broker, I was also able to resolve the issue by renaming the file to mosquitto.conf

Definitely caused some headaches as Home Assistant controls my Victron inverter for charge / discharge rates etc.

Thank again!

@dsl10007
Copy link

I renamed the file and restarted HA.

This did not solve the problem for me sadly for the "Solar Assistant" integration.

I still have sensors "Unknown".

@cpuks
Copy link

cpuks commented Mar 29, 2023

I renamed the file and restarted HA.

This did not solve the problem for me sadly for the "Solar Assistant" integration.

I still have sensors "Unknown".

Try debug: true in addon settings then restart addon and should work.

@dsl10007
Copy link

I renamed the file and restarted HA.
This did not solve the problem for me sadly for the "Solar Assistant" integration.
I still have sensors "Unknown".

Try debug: true in addon settings then restart addon and should work.

Like this in Mosquitto broker "Customize" settings ?

active: true
folder: mosquitto
debug: true

If so, i tried doing this and restarting HA after saving, but sadly still the same :(

@ChristoffBo
Copy link

I Also tried the EMQX Broker, it will not allow solarassistant in bridge mode just gives a massive error with a bunch of jibberish

@dsl10007
Copy link

Do we know if the developer of the Mosquitto is actively working to get this fixed, it seems like it is affecting everyone using it.

@ralight
Copy link
Contributor

ralight commented Apr 1, 2023

Mosquitto uses whatever config file it is instructed to, I would suggest that this is a homeassistant problem not a mosquitto problem.

@haarkop
Copy link

haarkop commented Apr 3, 2023

I have restored the old version and deactivated the auto-update, I will wait until something changes.

@raphael303
Copy link
Author

Mosquitto uses whatever config file it is instructed to, I would suggest that this is a homeassistant problem not a mosquitto problem.

Nevertheless it happened after the mosquitto update NOT after the HA update. Also, as you see above, restoring to the old version of mosquitto solves the problem.
What do you deduce from this?
You write "Mosquitto uses whatever config file it is instructed to" maybe this is the point. In HA, so far, I have not instructed mosquitto to use any config file. The behavior was: Any *.conf file which was in the folder shared/mosquitto was used by mosquitto. There was no need for instructing it.
In my case the problem was solved by the renaming to mosquitto.conf. However others were not so lucky.

So, maybe another workaround would be to instruct mosquitto to use a specific .conf file. But where would that have to be done?

@ralight
Copy link
Contributor

ralight commented Apr 6, 2023

@raphael303 The latest version of mosquitto is 2.0.15, which was released in August last year. There has not been a recent update provided by this project that could have had this effect.

Mosquitto has loaded a config file by running in the style mosquitto -c /path/to/mosquitto.conf since version 0.2, back in December 2009. This has not changed.

Finally, there is no such thing as mosquitto 6.2.0 in this project. I presume that is the version number of the homeassistant integration that makes use of mosquitto.

@cpuks
Copy link

cpuks commented Apr 6, 2023

The problem is that all bridges used in previous versions stopped working immediately after updating. Some guys report changing bridge conf name helped some reported enabling debug option helped and some had to get back to 6.1.3 (add-on versions) so something is wrong here. I had exactly same behaviour on HA Yello and bare metal...

@ralight
Copy link
Contributor

ralight commented Apr 7, 2023

@cpuks That must be very frustrating. I am very sympathetic to your situation. Unfortunately the mosquitto project cannot help, because the component that has changed version from 6.1.3 to 6.2.0 is not part of this project. Even if I knew where the related code was, I couldn't make a change to it because I am not part of whatever project it resides in.

@cpuks
Copy link

cpuks commented Apr 7, 2023

Well that has to be something inside HA, should be doable to deploy two containers and compare in one environment, so far I only have latest version running by enabling debug mode. Also it's wierd as sometimes after HA upgrade I have to restart addon to get bridge working. Hopefully devs will look into that issue.

@dsl10007
Copy link

dsl10007 commented Apr 7, 2023

Well that has to be something inside HA, should be doable to deploy two containers and compare in one environment, so far I only have latest version running by enabling debug mode. Also it's wierd as sometimes after HA upgrade I have to restart addon to get bridge working. Hopefully devs will look into that issue.

I got my Home Assistant working again by renaming the folder, but just like you, sometimes if i restart Home Assistant, i need to manually restart Mosquitto otherwise my sensors will not show up.

I dont know if this is a Mosquitto problem or a Home Assistant problem. Normally it is shown who is the maintainer of a certain integration, but not for Mosquitto.

The changelog between the version working and the one that does it, says the following

Update mosquitto to 2.0.15
Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)

So in reality this integration was running Mosquitto 2.0.11 until the latest update, where it was bumped to 2.0.15

So it is either that Mosquitto 2.0.15 does not play nice with Home Assistant or it is the update of libwebsockets that is the problem.

@ralight
Copy link
Contributor

ralight commented Apr 7, 2023

@dsl10007 ok, that's useful. I've also found that the way in which both mosquitto and libwebsockets are being added is different - before it was using versions from an apt repo, now they are being compiled from source. So it could be that there are different flags being used when compiling that make a difference. I'm not sure what they could be though! I've also looked through the mosquitto changelog and nothing jumps out as something that could cause this. Likewise, I don't see how libwebsockets changes would affect loading the config.

It seems there is another issue with the addon that suggests is not quite building/being installed properly: home-assistant/addons#2948

@cpuks
Copy link

cpuks commented Apr 7, 2023

Well that has to be something inside HA, should be doable to deploy two containers and compare in one environment, so far I only have latest version running by enabling debug mode. Also it's wierd as sometimes after HA upgrade I have to restart addon to get bridge working. Hopefully devs will look into that issue.

I got my Home Assistant working again by renaming the folder, but just like you, sometimes if i restart Home Assistant, i need to manually restart Mosquitto otherwise my sensors will not show up.

I dont know if this is a Mosquitto problem or a Home Assistant problem. Normally it is shown who is the maintainer of a certain integration, but not for Mosquitto.

The changelog between the version working and the one that does it, says the following

Update mosquitto to 2.0.15
Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)

So in reality this integration was running Mosquitto 2.0.11 until the latest update, where it was bumped to 2.0.15

So it is either that Mosquitto 2.0.15 does not play nice with Home Assistant or it is the update of libwebsockets that is the problem.

What steps did you do to get this working? Change folder path in addon config and move mosquitto folder to that new path?

@dsl10007
Copy link

dsl10007 commented Apr 7, 2023

Well that has to be something inside HA, should be doable to deploy two containers and compare in one environment, so far I only have latest version running by enabling debug mode. Also it's wierd as sometimes after HA upgrade I have to restart addon to get bridge working. Hopefully devs will look into that issue.

I got my Home Assistant working again by renaming the folder, but just like you, sometimes if i restart Home Assistant, i need to manually restart Mosquitto otherwise my sensors will not show up.
I dont know if this is a Mosquitto problem or a Home Assistant problem. Normally it is shown who is the maintainer of a certain integration, but not for Mosquitto.
The changelog between the version working and the one that does it, says the following

Update mosquitto to 2.0.15
Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)

So in reality this integration was running Mosquitto 2.0.11 until the latest update, where it was bumped to 2.0.15
So it is either that Mosquitto 2.0.15 does not play nice with Home Assistant or it is the update of libwebsockets that is the problem.

What steps did you do to get this working? Change folder path in addon config and move mosquitto folder to that new path?

In the "Share/mosquitto" i had the config for Solar Assistant "SolarAssistant.conf"

This had worked before, but after updating to 6.20 i had to just rename the config file to "mosquitto.conf" instead.

It appears that Mosquitto now only accepts "Mosquitto.conf" where it accepted any *.conf file

@cpuks
Copy link

cpuks commented Apr 7, 2023

Well that does not work for me unless I'll set debug -> true.
What's filename as it might be case sensitive like everything in Linux?

@dsl10007
Copy link

dsl10007 commented Apr 7, 2023

Well that does not work for me unless I'll set debug -> true. What's filename as it might be case sensitive like everything in Linux?

This is copy pasted directly from my HA File explorer

/share/mosquitto/mosquitto.conf

@PablaV
Copy link

PablaV commented Apr 11, 2023

Myself and other users who were using MQTT to connect to a hydro monitoring bridge all noticed it stopped working after the 6.2 update to the addon. I tried renaming the config file to mosquitto.conf but it did not work, then I tried enabling debugging on the addon - that didn't work either.

Edit: seems like I got things back up and working, changing the config name and/or debugging did the trick!

@Fayyaadh
Copy link

I also have an issue related to Solar Assistant and Mosquitto 6.2.1 in Home Assistant.

Previously, the conf file that bridges to the Solar Assistant broker worked fine. It used the local hostname as the address to connect to. After updating, none of the Solar Assistant sensors made it into Mosquitto so I tried changing the conf file to connect to it using IP address and that fixed things.

Anyone else had this issue?

Are you guys able to bridge brokers by connecting using hostnames?

@raphael303
Copy link
Author

I also have an issue related to Solar Assistant and Mosquitto 6.2.1 in Home Assistant.

Previously, the conf file that bridges to the Solar Assistant broker worked fine. It used the local hostname as the address to connect to. After updating, none of the Solar Assistant sensors made it into Mosquitto so I tried changing the conf file to connect to it using IP address and that fixed things.

Anyone else had this issue?

Are you guys able to bridge brokers by connecting using hostnames?

I had the issue, but I had the IP address in the .conf file all along.

I suspect we are all missing the point here. We did changes to the file or filename, then restartet mosquitto and it worked, then we thought this was the solution.

However, in my case and some others, the problem persists after restarting home assistant. After restarting the .conf file is not recognized. Restart mosquitto, it works. I suspect we could have our .conf file still named whatever we want and have in it whatever we want, but it is really about the .conf file not being recognized on startup.

So, I think this is some home assistant or container problem.

What I wonder though is: Is there a workaround to give mosquitto the .conf information another way?

@raphael303
Copy link
Author

raphael303 commented Apr 28, 2023

I have opened a bug report on HA: home-assistant/addons#3014

@sleyshaw24
Copy link

sleyshaw24 commented Jun 24, 2023

I have opened a bug report on HA: home-assistant/addons#3014

An automation script was shared in that bug report that restarts the addon 10s after HA starts. That seems to be a workaround for now. I needed longer than 10 seconds though... 30 seconds seemed to work for me. home-assistant/addons#3014 (comment)

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

10 participants