Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Address in use when deploying MQTT 2.0.14 as container using Docker Desktop #2428

Open
RiteshKo opened this issue Jan 6, 2022 · 1 comment

Comments

@RiteshKo
Copy link

RiteshKo commented Jan 6, 2022

I am trying to run mqtt as a container using Docker desktop. But as per the logs getting an error Address in use when running the command:

mosquitto -c mosquitto.conf

Below is my docker-compose file:

version: '3.5'

services:
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto_container
    ports:
      - 1883:1883
    volumes:
      - ./config:/mosquitto/config

And the mosquitto.conf file:

listener 1883 127.0.0.1
allow_anonymous true 

In all the articles over the internet and also in the mqtt docs it is mentioned that we have to specify listener in the conf file which I have added.

My goal is to run mqtt as a container and then from a .net utililty publish the messages to the broker.

I am using the Docker version v20.10.10 running on my Windows 10 and mqtt image version is 2.0.14.

Please guide me.

@zoechi
Copy link

zoechi commented Jul 14, 2023

Same here

1689340436: mosquitto version 2.0.15 starting
1689340436: Config loaded from /mosquitto/config/mosquitto.conf.
1689340436: Opening ipv4 listen socket on port 1883.
1689340436: Opening ipv6 listen socket on port 1883.
1689340436: Opening ipv4 listen socket on port 1883.
1689340436: Error: Address in use

Why does it listen on ipv4 1883 twice?

config

persistence true
persistence_location /mosquitto/data
log_dest file /mosquitto/log/mosquitto.log
per_listener_settings true # enable password authentication
password_file /mosquitto/config/passwordfile
listener 1883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants