Skip to content

Cannot connect to MQTT after installationΒ #5352

@larsony99

Description

@larsony99

βœ… Have you read and understood the above guidelines?

yes

πŸ“œ What is the name of the script you are using?

MQTT

πŸ“‚ What was the exact command used to execute the script?

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/mqtt.sh)"

βš™οΈ What settings are you using?

  • Default Settings
  • Advanced Settings

πŸ–₯️ Which Linux distribution are you using?

Debian 12

πŸ“ Provide a clear and concise description of the issue.

Hello all. I am unable to connect to MQTT after installation (from a remote machine). I think it has something to do with the configuration file (/etc/mosquitto/conf.d/default.conf) and the passwd file and/or directory. I'll preface this next part with the fact that I'm pretty new to all of this, so I don't quite understand how we get from A to B, but...

I've found in the actual MQTT installation script that it writes the following to the default.conf file:

cat <<EOF >/etc/mosquitto/conf.d/default.conf
allow_anonymous false
persistence true
password_file /etc/mosquitto/passwd
listener 1883

However, I can see that nothing exists at /etc/mosquitto/passwd:

root@mqtt:/etc/mosquitto# ls
ca_certificates certs conf.d mosquitto.conf

I found passwd in /etc, so I modified the default.conf to that location. I also changed allow_anonymous to true and I added 0.0.0.0 after listener 1883:

allow_anonymous true
persistence true
password_file /etc/passwd
listener 1883 0.0.0.0

However, it still refuses to connect. It does, however, at least start/restart the MQTT service after making the change to the password_file location (before it crashed attempting to read the non-existent /etc/mosquitto/passwd.

I also tried installing MQTT using the default settings, and I'm getting the same results.

I feel like I'm close(?) to figuring out the issue, but can't quite get it. All help is very much appreciated!

πŸ”„ Steps to reproduce the issue.

  • Run the command bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/mqtt.sh)"
  • Attempt to connect from external machine to the server URL (in my case it's 10.69.20.21:1883).

❌ Paste the full error output (if available).

From browser:

This site can’t be reached
The connection was reset.
Try:

  • Checking the connection
  • Checking the proxy and the firewall

ERR_CONNECTION_RESET

πŸ–ΌοΈ Additional context (optional).

I've also verified that the port is open:

[user]@Mac ~ % nc -zv 10.69.20.21 1883
Connection to 10.69.20.21 port 1883 [tcp/ibm-mqisdp] succeeded!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions