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

BUG: MQTT client connection error: connack timeout #412

Closed
marleyjaffe opened this issue Dec 20, 2024 · 3 comments
Closed

BUG: MQTT client connection error: connack timeout #412

marleyjaffe opened this issue Dec 20, 2024 · 3 comments

Comments

@marleyjaffe
Copy link
Contributor

marleyjaffe commented Dec 20, 2024

Not sure what is causing this error.

mqdockerup      | 2024-12-20T03:29:13.340541146Z Starting MqDockerUp V1.15.1 ...
mqdockerup      | 2024-12-20T03:29:13.340573021Z
mqdockerup      | 2024-12-20T03:29:17.535263709Z 20.12.2024 03:29:17 [info] Connected to the database.
mqdockerup      | 2024-12-20T03:29:17.811665845Z 20.12.2024 03:29:17 [error] MQTT client connection error:  connack timeout
mqdockerup      | 2024-12-20T03:29:17.833697148Z 20.12.2024 03:29:17 [error] MqDockerUp stopped due to an error
mqdockerup      | 2024-12-20T03:29:17.839030155Z 20.12.2024 03:29:17 [error] object
mqdockerup      | 2024-12-20T03:29:17.845152751Z 20.12.2024 03:29:17 [error] Error: connack timeout
mqdockerup      | 2024-12-20T03:29:17.845285773Z     at Timeout._onTimeout (/app/node_modules/mqtt/src/lib/client.ts:900:23)
mqdockerup      | 2024-12-20T03:29:17.845320200Z     at listOnTimeout (node:internal/timers:569:17)
mqdockerup      | 2024-12-20T03:29:17.845362388Z     at processTimers (node:internal/timers:512:7)
mqdockerup      | 2024-12-20T03:29:18.045503300Z npm notice
mqdockerup      | 2024-12-20T03:29:18.045696687Z npm notice New major version of npm available! 10.8.2 -> 11.0.0
mqdockerup      | 2024-12-20T03:29:18.045733770Z npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
mqdockerup      | 2024-12-20T03:29:18.045765854Z npm notice To update run: npm install -g npm@11.0.0
mqdockerup      | 2024-12-20T03:29:18.045797938Z npm notice
mqdockerup      |
mqdockerup      | > mqdockerup@1.15.1 start
mqdockerup      | > ts-node src/index.ts

docker-compose relevant lines:

  mqdockerup:
    image: micrib/mqdockerup:latest
    restart: always
    environment:
      MAIN_CONTAINERCHECKINTERVAL: "5m"
      MAIN_PREFIX: "Docker-PI"
      MQTT_CONNECTIONURI: "mqtt://IPADDR:1883"
      # MQTT_USERNAME: "ha"
      # MQTT_PASSWORD: "12345678"
      ACCESSTOKENS_GITHUB: "github_API_KEY"
      MQTT_CLIENTID: "Docker_PI_mqdockerup"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # This is required to access the docker API
      - ${DOCKERDIR}/mqdockerup:/app/data/ # This is required to store the data (database.db)
    container_name: mqdockerup

mosquitto MQTT logs:

1734665467: New client connected from IPADDR:54950 as Docker_PI_mqdockerup (p5, c1, k60, u'ha').
1734665467: Client Docker_PI_mqdockerup closed its connection.
@ciddi89
Copy link

ciddi89 commented Feb 10, 2025

Have the same issue with my docker on my Synology NAS. With the docker in a VM on proxmox is no problem and mqdockerup works fine.

@kimzeuner
Copy link

kimzeuner commented Feb 20, 2025

Same for me running Docker on a PI3. With version v1.3.3 it's working but every time changing to latest i get the connack timeout message and the container stops.

*Edit: Just changed the MQTT_CONNECTTIMEOUT from the default of 60 to 120 seconds and everything is working

@ciddi89
Copy link

ciddi89 commented Feb 20, 2025

Okay, for me I found out it is a firewall issue because the container can't connect to the mqtt server. So I can fix it by myself.

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

4 participants