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

[MQTT] Mosquitto 2.0 and Configuration #1071

Closed
VonOx opened this issue Feb 7, 2021 · 13 comments
Closed

[MQTT] Mosquitto 2.0 and Configuration #1071

VonOx opened this issue Feb 7, 2021 · 13 comments

Comments

@VonOx
Copy link
Contributor

VonOx commented Feb 7, 2021

Mosquitto 2.0 need a new option to work ( eclipse/mosquitto#2040 )

listener 1883

Related thread in forum => https://community.gladysassistant.com/t/tutoriel-flasher-et-configurer-un-sonoff/4526/57?u=vonox


For newly created configuration no problem ( if we update the shell script ), but for existing configuration there is not check.
All current Gladys running instance with configured MQTT integration can be impacted.

@atrovato FYI

@atrovato
Copy link
Contributor

atrovato commented Feb 7, 2021

Nice to know. I will try. For more, my MQTT network suddendly dies... not relation with Gladys, I use separated broker for now.

@VonOx
Copy link
Contributor Author

VonOx commented Feb 7, 2021

Nice to know. I will try. For more, my MQTT network suddendly dies... not relation with Gladys, I use separated broker for now.

Me too, may be related to listener option

@atrovato
Copy link
Contributor

atrovato commented Feb 7, 2021

Ok, listener 1883 fixes the issue.
In both cases we'll have to update Gladys shell script.

We may add a param to service to check if new option is already set.
Something like EMBEDDED_MQTT_PORT = 1883,
at startup, we'll check for this, if Gladys use embedded MQTT and param is not set, we automaticcly update shell script (and set the param).

What do you think?

@Pierre-Gilles
Copy link
Contributor

What about finding another MQTT Docker image that just supports environment variables instead of a config file?

Right now, the process seems "flaky", mostly because there are several source of truth (the mosquitto container + the file + Gladys DB) that can be easily out of sync between themselves.

On top of that, as the DB is no longer the only source of truth, backing up the DB do not backup everything.

@VonOx
Copy link
Contributor Author

VonOx commented Feb 9, 2021

Env variable can change too , I think that doesn't solve the problem

Mosquitto problem come from major release 1.X to 2.X. ( Yes breaking change 😟 )
Our mistake was to use latest tag.

Right now we need to check at gladys startup conf file for missing options ( like @atrovato said )
And ensure container use major tag ( eclipse-mosquitto:2

What about that => https://www.npmjs.com/package/aedes ?

@Pierre-Gilles
Copy link
Contributor

Env variable can change too , I think that doesn't solve the problem

It doesn't solve this problem, but improve the overall stability of all this :)

Agree, for this problem, if we keep the same docker image, we need to update the file at startup with listener 1883. It could just be done in a migration !

@Pierre-Gilles
Copy link
Contributor

For Aedes, I don't think it's a short term solution to fix this issue !

@VonOx
Copy link
Contributor Author

VonOx commented Feb 9, 2021

For Aedes, I don't think it's a short term solution to fix this issue !

Yes I agree , just a question. Another topic for another day 😅

@atrovato
Copy link
Contributor

@VonOx

And ensure container use major tag ( eclipse-mosquitto:2

do you mean we force mosquitto version?

@VonOx
Copy link
Contributor Author

VonOx commented Feb 13, 2021

@atrovato yes right, so mosquitto is updated ( bug fix ) and next major release ( v3 or something ) will not break gladys integration

@atrovato
Copy link
Contributor

Ok, so I will have to force remove / re-creation of the mosquitto container (only for already configured containers) to force image version to 2 and not latest.

atrovato added a commit to atrovato/Gladys that referenced this issue Feb 13, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 13, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 13, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 14, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 14, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 16, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 19, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 20, 2021
atrovato added a commit to atrovato/Gladys that referenced this issue Feb 20, 2021
Pierre-Gilles added a commit that referenced this issue Feb 22, 2021
@atrovato
Copy link
Contributor

@VonOx @Pierre-Gilles can we close this?

@VonOx VonOx closed this as completed Feb 22, 2021
@snagulap
Copy link

snagulap commented Jan 15, 2024

Hello,
In my case it showing address not available
mosquitto version 2.0.18 starting
1705326773: Config loaded from /mosquitto/config/mosquitto.conf.
1705326773: Starting in local only mode. Connections will only be possible from clients running on this machine.
1705326773: Create a configuration file which defines a listener to allow remote access.
1705326773: For more details see https://mosquitto.org/documentation/authentication-methods/
1705326773: Opening ipv4 listen socket on port 1883.
1705326773: Opening ipv6 listen socket on port 1883.
1705326773: Error: Address not available
1705326773: mosquitto version 2.0.18 running

can someone explain how to remove that error?

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

4 participants