mosquitto broker websockets no longer work

Bug #1898492 reported by Rick Sayre
6
This bug affects 1 person
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:EDH+AESGCM:AES256+EECDH:AES256+EDH
certfile /etc/nginx/ssl/acme/site.crt
cafile /etc/nginx/ssl/acme/site.fullchain
keyfile /etc/nginx/ssl/acme/site.key
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]
ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckResult: skip
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-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: mosquitto
UpgradeStatus: Upgraded to focal on 2020-10-04 (0 days ago)

Revision history for this message
Rick Sayre (whorfin) wrote :
Revision history for this message
Rick Sayre (whorfin) wrote :

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

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Hello, please try 2.0.15 or newer from mantic (23.10) and set back the status to new if still an issue. thanks!

Changed in mosquitto (Ubuntu):
status: New → Incomplete
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

nice that 22.04 works!

Changed in mosquitto (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.