Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » "Error: Address already in use" when "per_listener_settings true" set(When I set the variable per_listener_settings to true the mosquitto service fails with an "Address already in use" error)
"Error: Address already in use" when "per_listener_settings true" set [message #1860895] Thu, 07 September 2023 14:48
Ezequiel Andrush is currently offline Ezequiel AndrushFriend
Messages: 1
Registered: September 2023
Junior Member
Hi community!
I am new to MQTT and I am playing with the broker to try to understand how things work.

I have found an issue using mosquitto 2.0.17 running on linux (debian bullseye)
I have set a testing environment on VMs using KVM and started the broker. The basic configuration worked well, but when I try to tweak it a bit I found some odd behavior.

If I set per_listener_settings true and restart the service mosquitto fails with the error code "Error: Address already in use"

I have checked if the port is still being used using netstat and if there is another instance of mosquitto runing but there is nothing there.

The port is available according to netstat
root@MQTT-Server:~#  netstat -anpe | grep "1883" | grep "LISTEN"
root@MQTT-Server:~# 


And there isn't any other mosquitto instance running according to ps.
root@MQTT-Server:~# ps -aux | grep mosqui
root       37606  0.0  0.0   6240   708 pts/1    S+   11:43   0:00 grep mosqui
root@MQTT-Server:~# 


My mosquitto.conf file is:

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.gz

pid_file /run/mosquitto/mosquitto.pid
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d

per_listener_settings true

allow_anonymous false
password_file /etc/mosquitto/mosquitto.passwd

persistence true
autosave_interval 60
retain_available true

listener 1883 192.168.100.10
socket_domain ipv4
allow_anonymous false

max_inflight_messages 1
#This will guarantee in-order message delivery (maybe needed to locks)

max_queued_messages 5
#The queue size



If I comment the line
per_listener_settings true
the service starts working again.
I also checked this using eclipse-mosquitto docker image. I found the same issue.

Am I doing something wrong?

Thanks in advance
Ezequiel
Previous Topic:Support for shared subscripition on EdgexFoundry Jatarka's release
Next Topic:MQTT with ESP32 and Android app
Goto Forum:
  


Current Time: Fri May 03 02:01:56 GMT 2024

Powered by FUDForum. Page generated in 0.02732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top