MMC up but not responding

I’m running Mosquitto in Docker on a Raspberry Pi 5 and trying to add MMC. The MMC part of my compose file looks like this:

  management-center:
    image: cedalo/management-center:dev
    container_name: management-center
    environment:
        # Do not change these settings for the moment!
        CEDALO_MC_BROKER_ID: mosquitto-2.0
        CEDALO_MC_BROKER_NAME: Mosquitto 2.0
        CEDALO_MC_BROKER_URL: mqtt://${MQTT_HOST}:1883
        CEDALO_MC_BROKER_USERNAME: ${MQTT_USERNAME}
        CEDALO_MC_BROKER_PASSWORD: ${MQTT_PASSWORD}
        CEDALO_MC_PROXY_CONFIG_DIR: /management-center/config/config.json
    ports:
        - 1888:8088
    depends_on:
        - mosquitto
    network_mode: bridge   

The container starts ok - logs show this - some warnings that I think I can ignore:

2024-05-10T09:22:13.711205331Z Starting Management Center for Eclipse Mosquitto
2024-05-10T09:22:14.087775203Z No license key found or provided.
2024-05-10T09:22:14.283389587Z Fri, 10 May 2024 09:22:14 GMT express-session deprecated undefined resave option; provide resave option at start.js:180:10
2024-05-10T09:22:14.283466217Z Fri, 10 May 2024 09:22:14 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at start.js:180:10
2024-05-10T09:22:14.286913024Z Connecting to "Mosquitto 2.0" on mqtt://myhostname.domain.com:1883
2024-05-10T09:22:14.312367896Z Started Mosquitto proxy at http://localhost:8088
2024-05-10T09:22:14.321776888Z "CEDALO_MC_PLUGIN_DIR" is not set. Skipping loading of plugins
2024-05-10T09:22:14.326667013Z Mosquitto proxy server started on port 8088
2024-05-10T09:22:14.334005980Z Connected to 'Mosquitto 2.0' at mqtt://myhostname.domain.com:1883

But when I try to browse to http://myhostname.domain.com:1888 I get “connection refused”.

I’ve seen other logs where I can see core and login plugins loading. I tried setting CEDALO_MC_PLUGIN_DIR to /management-center/src/plugins but that didn’t help.

Am I missing something to make the MMC front-end listen on all interfaces?

Hello BarCar,

Can you set the following EnvVar: CEDALO_MC_PROXY_HOST: 0.0. 0.0
This is because by default MMC listens on localhost and inside docker localhost interfaces are not forwarded to the host machine.

Thanks for that suggestion Tizian.

I had already tried that with no change in behaviour.

Hi BarCar,

In my experience setting CEDALO_MC_PROXY_HOST variable to "0.0.0.0" should resolve the issue.
I tried it out and it worked fine for me.

Here is my full setup:

docker-compose.yml:

version: '3.8'

services:
  mosquitto:
      container_name: mosquitto
      image: eclipse-mosquitto:2
      ports:
          - 1883:1883
          - 9001:9001
      volumes:
          - ./mosquitto/config:/mosquitto/config
          - ./mosquitto/data:/mosquitto/data
      networks:
          - mosquitto
  management-center:
    container_name: management-center
    image: cedalo/management-center:dev
    container_name: management-center
    environment:
        CEDALO_MC_BROKER_ID: mosquitto-2.0
        CEDALO_MC_PROXY_HOST: "0.0.0.0"
        CEDALO_MC_BROKER_NAME: Mosquitto 2.0
        CEDALO_MC_BROKER_URL: mqtt://${MQTT_HOST}:1883
        CEDALO_MC_BROKER_USERNAME: ${MQTT_USERNAME}
        CEDALO_MC_BROKER_PASSWORD: ${MQTT_PASSWORD}
        CEDALO_MC_USERNAME: ${MMC_USERNAME}
        CEDALO_MC_PASSWORD: ${MMC_PASSWORD}
    ports:
        - 1888:8088
    networks:
        - mosquitto
networks:
    mosquitto:
        name: mosquitto
        driver: bridge

directory structure:

.
├── docker-compose.yml
├── env.sh
└── mosquitto
    ├── config
    │   ├── mosquitto.conf
    │   └── passwd_file
    └── data

mosquitto.conf:

persistence true
persistence_location /mosquitto/data/
log_type subscribe
log_type unsubscribe
log_type websockets
log_type error
log_type warning
log_type notice
log_type information
log_dest stdout

password_file /mosquitto/config/passwd_file
allow_anonymous false

# MQTT Default listener
listener 1883 0.0.0.0

# MQTT over WebSockets
listener 9001 0.0.0.0
protocol websockets

env.sh:

export MQTT_USERNAME="admin"
export MQTT_PASSWORD="password"
export MQTT_HOST="mosquitto"
export MMC_USERNAME="cedalo"
export MMC_PASSWORD="password"

Steps to run the setup:

  • install mosquitto_psswd with mosquitto or mosquitto-clients package (sudo apt install mosquitto-client / brew install mosquitto etc)
  • Generate mosquitto password file with mosquitto_passwd -c ./mosquitto/passwd_file admin (in this case I use username admin)
  • Export the environment variables used in docker compose: source ./env.sh
  • Run the docker compose: docker-compose up -d
  • Check management-center logs with: docker logs management-center. In my case I get the following logs:
Starting Management Center for Eclipse Mosquitto
No license key found or provided.
Thu, 16 May 2024 08:00:32 GMT express-session deprecated undefined resave option; provide resave option at start.js:180:10
Thu, 16 May 2024 08:00:32 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at start.js:180:10
Connecting to "Mosquitto 2.0" on mqtt://mosquitto:1883
Started Mosquitto proxy at http://localhost:8088
"CEDALO_MC_PLUGIN_DIR" is not set. Skipping loading of plugins
Mosquitto proxy server started on port 8088
Connected to 'Mosquitto 2.0' at mqtt://mosquitto:1883
  • Go to http://localhost:1888 and login with credentials defined with MMC_USERNAME and MMC_PASSWORD environment variables.

However, if I remove CEDALO_MC_PROXY_HOST from the docker compse file, I get behavior that you describe and cannot reach MMC.
Note that you can of course also have mosquitto running externally on some other machine in your network and not necessarily define in the same docker-compose. I use it just as a proof of concept

1 Like

Thanks sey.

I’m not sure what changed but it all started working when I rebuilt everything per your steps. The config looked the same but presumably I missed something.