mosquitto broker websockets no longer work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mosquitto (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Ubuntu 20.04.1 LTS
mosquitto 1.6.9-1
I have a MQTT-brokered weather station, which sends realtime updates to a webpage using paho to do MQTT over websockets
Everything worked fine until upgrade from bionic to focal
The mosquitto broker continued to work fine, but the websocket component stopped functioning
The relevant config section for mosquitto is like this:
listener 44444
ciphers EECDH+AESGCM:
certfile /etc/nginx/
cafile /etc/nginx/
keyfile /etc/nginx/
protocol websockets
---
The first issue, netstat confirmed that mosquitto was NOT listening on IPv4, but only on IPv6. IPv6 is not routed to the internet in my installation, so that was an undesirable change in functionality.
Adding this stanza:
socket_domain ipv4
...at least got netstat to report IPv4 listening on the websocket port
But the websocket server was not reachable from the Internet. It just didn't work, on either Chrome or Firefox, on ubuntu or Windows, though strangely it worked with Mobile Safari on iOS.
I made some discoveries...
focal uses mosquitto 1.6.9, on top of libwebsockets 3.2.1 [libwebsockets15]
bionic used mosquitto 1.4.15, on top of libwebsockets 2.0.3 [libwebsockets8]
I pulled down mosquitto 1.6.9 source and the source for both libwebsockets versions from packages.ubuntu.com
mosquitto 1.6.9 built against libwebsockets 3.2.1 misbehaved exactly as stock Ubuntu focal builds, which was reassuring
mosquitto 1.6.9 built against libwebsockets 2.0.3 functioned properly, as 1.4.15 did on bionic
Everything else was left identical. you may note in this report that /usr/sbin/mosquitto is altered - I have replaced it with my hand-built frankenversion, to get my server back in business
Cheers
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: mosquitto 1.6.9-1 [modified: usr/sbin/mosquitto]
ProcVersionSign
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckR
Date: Sun Oct 4 17:07:46 2020
InstallationDate: Installed on 2018-03-07 (942 days ago)
InstallationMedia: Lubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105)
ProcEnviron:
TERM=screen-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: mosquitto
UpgradeStatus: Upgraded to focal on 2020-10-04 (0 days ago)
Deafening silence
I upgraded to jammy 22.04.1, which comes with
mosquitto 2.0.11 built against libwebsockets 4.0.20 [libwebsockets16]
And, finally, this works fine