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

Can't get out of local only mode #2970

Open
CZonin opened this issue Dec 19, 2023 · 1 comment
Open

Can't get out of local only mode #2970

CZonin opened this issue Dec 19, 2023 · 1 comment

Comments

@CZonin
Copy link

CZonin commented Dec 19, 2023

I've had mosquitto (2.0.18) running and working for services on the host machine for awhile now without any issues. Recently, I've been trying to get it to be reached by other devices on my network, but no matter what I do, it starts in local only mode.

Here's my docker-compose:

version: "3"
services:
  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    restart: unless-stopped
    # network_mode: host
    ports:
      - "1883:1883" #default mqtt port
      - "9001:9001" #default mqtt port for websockets
    volumes:
      - /home/czonin/mosquitto/conf:/mosquitto/conf
      - /home/czonin/mosquitto/data:/mosquitto/data
      - /home/czonin/mosquitto/log:/mosquitto/log
    environment:
        - TZ=America/New_York
        - PUID=1000
        - PGID=1000

mosquitto.conf

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
listener 1883
protocol websockets
## Authentication ##
allow_anonymous true
password_file /mosquitto/conf/mosquitto.conf

I've checked the config file within the container to make sure it's mapping to my local file which it is. I've tried with listener 9001 and without protocol websockets in the config, but no luck.

Any ideas?

@SebWo87
Copy link

SebWo87 commented Dec 26, 2023

Hi, I recently had the same issue, but was due to missing 'listener 1883' entry. What is the output of the log files?
As far as I know, 'allow_anonymous true' is in conflict with the presents of a password file. If you want to use a username and password, remove 'allow_anonymous' or change its value to false.

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