I am running the official eclipse-mosquitto:2.1.0-alpine via Docker.
Following the deprecation warnings in the changelog regarding password_file and acl_file, I attempted to switch to the new plugin-based configuration (mosquitto_password_file.so and mosquitto_acl_file.so).
However, the container fails to start because the plugins cannot find their dependency libmosquitto_common.so.1.
The error message suggests the plugin was compiled with a relative path pointing to a build directory structure (../../libcommon/) that does not exist in the final Docker image structure.
To Reproduce:
- Use eclipse-mosquitto:latest (v2.1.0).
- Configure mosquitto.conf to use the password plugin instead of the legacy password_file option.
- Start the container.
Configuration (mosquitto.conf):
max_packet_size 10000000
max_queued_messages 5000
persistent_client_expiration 5m
allow_anonymous false
persistence true
persistence_location /mosquitto/data
persistence_file mosquitto.db
log_timestamp_format %Y-%m-%dT%H:%M:%S
log_dest file /mosquitto/log/mosquitto.log
log_dest stdout
# Plugin configuration causing the crash
plugin /usr/lib/mosquitto_password_file.so
plugin_opt_password_file /mosquitto/config/passwd
plugin /usr/lib/mosquitto_acl_file.so
plugin_opt_acl_file /mosquitto/config/acls
listener 1883
protocol mqtt
socket_domain ipv4
set_tcp_nodelay true
Docker Compose:
services:
mosquitto:
container_name: mosquitto
image: eclipse-mosquitto:2.1.0-alpine
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- ./mnt/config:/mosquitto/config
- ./mnt/data:/mosquitto/data
- ./mnt/log:/mosquitto/log
Log Output:
2026-01-30T16:35:14: mosquitto version 2.1.0 starting
...
2026-01-30T16:35:14: Loading plugin: /usr/lib/mosquitto_password_file.so
2026-01-30T16:35:14: Error: Unable to load plugin "/usr/lib/mosquitto_password_file.so".
2026-01-30T16:35:14: Load error: Error loading shared library ../../libcommon/libmosquitto_common.so.1: No such file or directory (needed by /usr/lib/mosquitto_password_file.so)
Workaround: Reverting to the deprecated password_file and acl_file syntax works correctly.
I am running the official eclipse-mosquitto:2.1.0-alpine via Docker.
Following the deprecation warnings in the changelog regarding password_file and acl_file, I attempted to switch to the new plugin-based configuration (mosquitto_password_file.so and mosquitto_acl_file.so).
However, the container fails to start because the plugins cannot find their dependency libmosquitto_common.so.1.
The error message suggests the plugin was compiled with a relative path pointing to a build directory structure (../../libcommon/) that does not exist in the final Docker image structure.
To Reproduce:
Configuration (mosquitto.conf):
max_packet_size 10000000 max_queued_messages 5000 persistent_client_expiration 5m allow_anonymous false persistence true persistence_location /mosquitto/data persistence_file mosquitto.db log_timestamp_format %Y-%m-%dT%H:%M:%S log_dest file /mosquitto/log/mosquitto.log log_dest stdout # Plugin configuration causing the crash plugin /usr/lib/mosquitto_password_file.so plugin_opt_password_file /mosquitto/config/passwd plugin /usr/lib/mosquitto_acl_file.so plugin_opt_acl_file /mosquitto/config/acls listener 1883 protocol mqtt socket_domain ipv4 set_tcp_nodelay trueDocker Compose:
Log Output:
Workaround: Reverting to the deprecated password_file and acl_file syntax works correctly.