mjl- / mox

modern full-featured open source secure mail server for low-maintenance self-hosted email
https://www.xmox.nl
MIT License
3.36k stars 89 forks source link

Bad error message related to hardlink in backup command #170

Closed rdelaage closed 1 month ago

rdelaage commented 2 months ago

Hello, First of all, many thanks for mox, this simplify the self-hosting of emails a lot. I just setup an instance of mox on a personal VPS and I am currently setting up backups for my server.

I ran the mox backup command and get this error

warning: creating hardlink to message failed, will be doing regular file copies and not warn again: link data/accounts/bob/msg/a/1 /home/mox/mox-backup/accounts/bob/msg/a/1: invalid cross-device link; srcpath=data/accounts/bob/msg/a/1; dstpath=/home/mox/mox-backup/accounts/bob/msg/a/1

I am performing backups on the same device as the data and this hardlink works with the ln command

mjl- commented 2 months ago

This is probably due to mox.service specifying ReadWritePaths. It is doing binds/mounts, causing anything outside config/ and data/ to be "cross-device". I write backups to data/backup/ to sidestep the problem. Adding a path to ReadWritePaths should also work.

The error message should probably mention this as a hint, I've heard about this at least once before, and it's not obvious what's going on.

rdelaage commented 2 months ago

Yes, I ran the server without systemd and it works now. I add this path in the service file, thanks for the hint

rdelaage commented 2 months ago

Finally just adding the specific directory to the ReadWritePaths did not work. I had to put the whole mox home directory in this directive

mjl- commented 1 month ago

Thanks for the feedback. I added a hint to the hardlink message, pointing admins to ReadWritePaths. Hopefully helps future admins find a solution quickly.

Closing the issue. Feel free to reopen if we can do more.