Backups not working

Hello guys,

Backups suddenly stopped working 2 weeks ago and after some investigations I don’t get any logs or email notifications (I used to get email with backup errors when it happened).

Can you help me sorting this out ? I don’t know where to start as all logs are empty.

  • Last user logs about backup (after that, nothing related to backups):
18  Nov  202105:11:17 BackupBackup created (Archive: 2021-11-18_05-11-11.tar).
  • Running /usr/local/hestia/bin/v-backup-users take some time after launch, but displays nothing afterward. No backup is created. Is there a way to make this command verbose ?
  • Running backup from the CLI will say that the backup process has been launched … but nothing will be created.

Any hints ? Also, it was nice to receive email when backups weren’t working, any idea how I could restore this feature ?

Thanks for the help

Check /var/log/hestia/system.log

And is the cronjob running?

Hi,

Thanks for helping.

Well, the cron job seems to be there:

sudo /usr/local/hestia/bin/v-backup-users
1005***

And the cron is up and running. Though I don’t see cron logs in the system.log file except when these crons were added to the contrab.

Regarding backups:

Last line is this, nothing after:

2021-11-25 08:43:34 v-schedule-user-backup  'username'

I do have this line every day (supposedly triggered by cron):

2021-11-06 05:11:04 v-backup-user  'username'

No error messages. It’s really weird, I checked my free space I have way enough to handle the backup.
I’ll try restarting my server, maybe …

It’s totally weird, restart didn’t do anything but running the backup and checking at resources at the same time with htop I can see that zstd is running. I can even see the command launched … But at the end of the process no backup in the backup folder …

Hello,

I was able to find out what’s going wrong. There is a permission issue on my database folder.

The backup logs are in /usr/local/hestia/log/backup.log.

In this file, I was able to see:

-- DB --
2021-11-29 10:20:38 username_database (mysql)
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
sh: 0: getcwd() failed: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
sh: 0: getcwd() failed: No such file or directory
exim: getting initial cwd failed: No such file or directory
Error: dump username_database failed

The issue now is that if I check permission under /var/lib/mysql/… every folders belongs to mysql:mysql. Are you using the mysql user to perform the database backups or am I supposed to change the permission, so root user can access them?

For /var/lib/mysql/ and below mysql:mysql is the right owner…

What version are you currently running?

Server version: 10.5.12-MariaDB-1:10.5.12

Maybe the issue is from the top folders, then no ? Should MySQL be in root group, and should I check the permissions on these folders ?

Hestia version I assume 1.5.0?

When you run v-backup-user username

We create a file in a /backup/tmp.xxx/ folder and then dump the database in that file and gzip / zstd it. How ever I am wondering why it can access /backup/tmp.xxx/database folder

Is the backup mounted to a remote server?

When using /usr/local/hestia/bin/v-backup-users during the process, I can see the tmp.xxx folder under backup. All subfolders seem to be created (dns, web mail …) and belonging to root:root.
Though the message is less verbose in the log:

-- DB --
2021-11-29 13:14:36 username_database (mysql)
Error: dump username_database failed

When using the CLI to launch the backup I don’t see the tmp folder under backup/ (or I missed it, dunno) but then I get the verbose error message about folder permission.

Rhaa this is driving me crazy.

What is the HestiaCP version?

Yeah it is v1.5.0

Do you have have the backup mounted to a different folder / server?

No, I only have a symlink from /home/username/backups to /backup folder, which I created because I mount my server through ssh and wanted to be able to access the backup repo.

I tried changing permissions on /backup, which belongs to my username:username now, but putting it to root:root doesn’t seem to change anything.

That might be the issue…

Symlinking doesn’t work see Backups / Restore — Hestia Control Panel documentation

Yeah! I was hoping so much it was that …

Just checked my fstab:

# Mount backups folder.
/home/username/backups /backup none defaults,bind 0 0

But maybe it’s still that. Maybe the mount fails for some reason. I do see backups as a “symlink” of /backup though …