Bug #305
Problem Connecting to XMPP Server After Container Migration
Description
I encountered a problem after I moved the Unified Communications server to a new VPS hosting server using:
ssh old-vps.example.com rsync -avhz -n /var/lib/lxc/container -e ssh root@new-vps.example.com:/var/lib/lxc/
Note: Remove the -n flag to enable the actual transfer, not a dry-run.
The first problem was that I had not updated the network information in the containers configuration at /var/lib/lxc/container/config
. Even though this would normally be the issue, it did not solve the problem.
I received an error while starting prosody:
Error: Error loading included /etc/prosody/conf.d/localhost.cfg.lua: /etc/prosody/conf.d/localhost.cfg.lua: Permission denied
I noticed that the ownership of a few files and folders did not match the correct ones from the previous container:
ls -l /etc/prosody
drwxr-x--- 2 root ntp 4096 Dec 11 17:03 certs
drwxr-xr-- 2 root ntp 4096 Jan 15 17:05 conf.avail
drwxr-xr-- 2 root ntp 4096 Jan 15 17:07 conf.drw-r--r-1 root root 353 Sep 27 2012 migrator.cfg.luarw-r----1 root prosody 8096 Dec 11 17:02 prosody.cfg.luarw-r--r-1 root root 292 Jul 30 2009 README
I fixed this by running:
chgrp prosody /etc/prosody/certs/ chgrp prosody /etc/prosody/conf.*
I then noticed that there were no records in /var/lib/prosody
, so I went to add a user. Only to get an error:
prosodyctl adduser someuser@example.com
datamanager error Unable to write to accounts storage ('/var/lib/prosody/example%2ecom/accounts/someuser.dat: Permission denied') for user: someuser@example.com
Error saving to storage
This happened because /var/lib/prosody
had bad ownership as well, to fix this I ran:
chown prosody.prosody /var/lib/prosody
I added the user one more time, and restarted the server for good measure:
prosodyctl adduser someuser@example.com service prosody restart
This restored the functionality of the XMPP service.