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

mosquitto: 1.6.12 -> 2.0.10 #110863

Merged
merged 1 commit into from Apr 5, 2021
Merged

mosquitto: 1.6.12 -> 2.0.10 #110863

merged 1 commit into from Apr 5, 2021

Conversation

prusnak
Copy link
Member

@prusnak prusnak commented Jan 26, 2021

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkgs/servers/mqtt/mosquitto/2.x.nix Outdated Show resolved Hide resolved
pkgs/servers/mqtt/mosquitto/1.x.nix Outdated Show resolved Hide resolved
@SuperSandro2000

This comment has been minimized.

@prusnak prusnak force-pushed the mosquitto branch 3 times, most recently from 78a5c8c to f406990 Compare January 26, 2021 19:34
@SuperSandro2000

This comment has been minimized.

@SuperSandro2000

This comment has been minimized.

@fabaff
Copy link
Member

fabaff commented Jan 29, 2021

Just tow remarks:

@peterhoeg
Copy link
Member

I don't really think we need to keep both v1 and v2. The changes are relatively minor and therefore quite easy to work around in the nixos module.

@prusnak prusnak changed the title mosquitto-2: init at 2.0.5 mosquitto: 1.6.12 -> 2.0.6 Feb 1, 2021
@prusnak
Copy link
Member Author

prusnak commented Feb 1, 2021

I don't really think we need to keep both v1 and v2. The changes are relatively minor and therefore quite easy to work around in the nixos module.

Reworked the PR as a simple version update. Added cJSON to buildInputs.

@peterhoeg I haven't touched the nixos module, will you update nixos/modules/services/networking/mosquitto.nix?

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 110863 run on x86_64-darwin 1

2 packages marked as broken and skipped:
  • collectd
  • collectd-data
1 package failed to build and already failed to build on hydra master:
1 package built:
  • mosquitto

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 110863 run on x86_64-linux 1

4 packages built:
  • collectd
  • collectd-data
  • domoticz
  • mosquitto

@prusnak prusnak changed the title mosquitto: 1.6.12 -> 2.0.6 mosquitto: 1.6.12 -> 2.0.9 Mar 23, 2021
@prusnak prusnak changed the title mosquitto: 1.6.12 -> 2.0.9 mosquitto: 1.6.12 -> 2.0.10 Apr 5, 2021
@SuperSandro2000 SuperSandro2000 merged commit f07c81b into NixOS:master Apr 5, 2021
@mweinelt
Copy link
Member

mweinelt commented Apr 6, 2021

Authentication with Mosquitto broke (Connection refused: not authorized) in the nixosTests.home-assistant due to this upgrade. This is our setup:

services.mosquitto = {
enable = true;
users = {
"${mqttUsername}" = {
acl = [ "pattern readwrite #" ];
password = mqttPassword;
};
};
};

The credentials are being reused for home-assistant and mosquitto_sub:

mqtt = {
broker = "127.0.0.1";
username = mqttUsername;
password = mqttPassword;
};

with subtest("Toggle a binary sensor using MQTT"):
# wait for broker to become available
hass.wait_until_succeeds(
"mosquitto_sub -V mqttv311 -t home-assistant/test -u ${mqttUsername} -P '${mqttPassword}' -W 1 -t '*'"
)
hass.succeed(
"mosquitto_pub -V mqttv311 -t home-assistant/test -u ${mqttUsername} -P '${mqttPassword}' -m let_there_be_light"
)

Looking for advice.

@peterhoeg
Copy link
Member

I wanted to, but didn't have a chance to work through the module, so I suggest we do this.

  1. revert this
  2. introduce a new mosquitto2 with this version
  3. introduce mosquitto1 with the latest 1.6.x
  4. make mosquitto an alias for mosquitto1

1.6 is still maintained (and there are some security fixes we need) so we can then always add proper support in the nixos module.

@mweinelt
Copy link
Member

mweinelt commented Apr 8, 2021

hass # [    4.109957] mosquitto[761]: 1617846007: The 'bind_address' option is now deprecated and will be removed in a future version. The behaviour will default to true.
hass # [    4.110884] mosquitto[761]: 1617846007: The 'port' option is now deprecated and will be removed in a future version. Please use 'listener' instead.
hass # [    4.112071] mosquitto[761]: 1617846007: mosquitto version 2.0.10 starting
hass # [    4.112542] mosquitto[761]: 1617846007: Config loaded from /nix/store/mkrjj35ij3hld114h3gz4x2cmkiyxj2d-mosquitto.conf.
hass # [    4.114645] mosquitto[761]: 1617846007: Warning: ACL pattern '#' does not contain '%c' or '%u'.
hass # [    4.117063] mosquitto[761]: 1617846007: Opening ipv4 listen socket on port 1883.
hass # [    4.117545] mosquitto[761]: 1617846007: mosquitto version 2.0.10 running

Two deprecation warnings, which should probably have been addressed in this pull request. @prusnak @SuperSandro2000

And probably my issue: A warning for the ACL pattern topic readwrite #. Great.

eclipse/mosquitto@39170d1

@mweinelt
Copy link
Member

mweinelt commented Apr 9, 2021

image

So one problem was that checkPasswords was not set, so the password file was not included.

@mweinelt
Copy link
Member

mweinelt commented Apr 9, 2021

Second issue is, that the following command exits with 1 ("Timed out") since 2.0.

"mosquitto_sub -V mqttv311 -t home-assistant/test -u ${mqttUsername} -P '${mqttPassword}' -W 1 -t '*'"

Also not sure why -t was given twice, makes no sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants