Unable to get an MQTT broker launched onto fly. Tried following the appkata example from 2020 but it doesn’t seem to work any longer, and I’m not sure what needs to be done to fix it. Following the guide to a tee works until testing stages, where I run mosquitto_sub -L mqtts://<username>:<password>@server.fly.dev/# --cafile certs/rootCA.pem, and get back Error: Protocol error. Anyone successfully deployed a MQTT broker to Fly and wanna share?
I am having same issues. Tried with no SSL as well, different ports to no avail. I also made sure it is listening on all interfaces. Deploying the Dockerfile locally and exposing the ports work just as expected – it seems something is blocking the connection midway.
During deploy I get “WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.” and then there is a timeout waiting for the healthchecks to pass. “Health check on port 1883 has failed. Your app is not responding properly. Services exposed on ports [10000] will have intermittent failures until the health check passes.”
I got it working. Was tough though. It helped deleting the app a couple of times. It seems the issue was with the ipadresses that fly created. I kept both.
$ fly ips list
VERSION IP TYPE REGION CREATED AT
v4 109.105.216.169 public global 5m25s ago
v6 2a09:8280:1::69:a392 public global 5m6s ago
and I only added an mqtt listener on ipv4 like this:
listener 1883 0.0.0.0
listener 9001 0.0.0.0
and exposing those in the docker file (don’t know if that was important)
EXPOSE 1883
EXPOSE 9001
and then matching the port from services.ports with the internal_port.
And then there was a party when I saw this in the log (where I enabled verbose logging with -v and this in the mosquitto.conf file: log_type all