Closed hankjordan closed 2 years ago
Container Startup Log:
The problem is that the script bin/ejabberdctl
in this Docker image sets as erlang node name:
ejabberd@$(hostname -s)
When you create a container, it gets a random machine name, and you will see when ejabberd starts:
ejabberd 0.0.0 is started in the node ejabberd@c76956d41c42 in 3.23s
You can also see in ./xmpp/db
it creates a directory ejabberd@c76...
When you create another container, it gets another machine name, and ejabberdctl sets a new erlang node name, which means the old Mnesia database is unacceptable, and creates a new one.
Good news! there's a simple solution: add this to your docker-compose.yml so ejabberdctl in all containers set the same erlang node name, and the Mnesia database can be reused:
environment:
- ERLANG_NODE_ARG=ejabberd@main
Long term solution: there's a PR that addresses this: https://github.com/processone/docker-ejabberd/pull/73
This solved my issue. Thank you for being so helpful.
Upon removal and re-creation of a docker container, the Mnesia database is not properly saved/loaded, causing all users, contacts, messages, etc to be lost.
The documentation leads me to believe this database is persistent:
/home/ejabberd/database: Directory containing Mnesia database. You should back up or export the content of the directory to persistent storage (host storage, local storage, any storage plugin)
To my knowledge, this was working fine previously.
Here is my configuration file. Certificates are valid, configuration loads properly:
This is the docker-compose.yml:
I am running the latest version.