Issue with backups (Wordpress & Defender plugin)

Hello.

I have an issue with backup. Everything was working fine, but today i need to download last backup archive and i’ve noticed, that i have old one from 2020-07-15, but today is 07-27) Nothing on server was changed or updated during that period. I’ve started to dig into logs.

Logs
> /var/log/hestia/backup.log
> 
> ================================
> admin
> --------------------------------
> 
> -- SYSTEM --
> 2020-07-15 05:10:01 admin.conf
> 2020-07-15 05:10:01 stats.log
> 2020-07-15 05:10:01 history.log
> 2020-07-15 05:10:01 pam
> 
> 
> -- WEB --
> 2020-07-15 05:10:01 somedomain.com
> 2020-07-15 05:10:09 *** 1 domain ***
> 
> -- DNS --
> 2020-07-15 05:10:09 *** 0 domains ***
> 
> -- DB --
> 2020-07-15 05:10:09 admin_somedomain (mysql)
> 2020-07-15 05:10:10 *** 1 database ***
> 
> -- CRON --
> 2020-07-15 05:10:10 *** 11 jobs ***
> 
> -- User Dir --
> 2020-07-15 05:10:10 adding .bash_logout
> 2020-07-15 05:10:10 adding .bashrc
> 2020-07-15 05:10:10 adding .cache
> 2020-07-15 05:10:10 adding .composer
> 2020-07-15 05:10:10 adding .config
> 2020-07-15 05:10:10 adding .local
> 2020-07-15 05:10:10 adding .profile
> 2020-07-15 05:10:10 adding .ssh
> 2020-07-15 05:10:10 *** 8 directories ***
> 
> -- SUMMARY --
> 2020-07-15 05:10:10 Rotated: 2020-07-14_05-10-11
> 2020-07-15 05:10:10 Local: /backup/admin.2020-07-15_05-10-10.tar
> 2020-07-15 05:10:10 Size: 55 MB
> 2020-07-15 05:10:10 Runtime: 1 minute
> 
> --------------------------------
> 
> 
> ================================
> admin
> --------------------------------
> 
> -- SYSTEM --
> 2020-07-16 05:10:01 admin.conf
> 2020-07-16 05:10:01 stats.log
> 2020-07-16 05:10:01 history.log
> 2020-07-16 05:10:01 pam
> 
> 
> -- WEB --
> 2020-07-16 05:10:01 somedomain.com
> 2020-07-16 05:10:10 *** 1 domain ***
> 
> -- DNS --
> 2020-07-16 05:10:10 *** 0 domains ***
> 
> -- DB --
> 2020-07-16 05:10:10 admin_somedomain (mysql)
> Error: dump admin_somedomain failed
> 
> --------------------------------

SQL dump problem repeats in log till today. I’ve deleted backup archive from CP today and tried to create a new one. The system still trying to make it with no luck( New stuff in log below:

> ================================
> admin
> --------------------------------
> 
> -- SYSTEM --
> 2020-07-27 05:10:02 admin.conf
> 2020-07-27 05:10:02 stats.log
> 2020-07-27 05:10:02 history.log
> 2020-07-27 05:10:02 pam
> 
> 
> -- WEB --
> 2020-07-27 05:10:02 somedomain.com
> 2020-07-27 05:10:15 *** 1 domain ***
> 
> -- DNS --
> 2020-07-27 05:10:15 *** 0 domains ***
> 
> -- DB --
> 2020-07-27 05:10:15 admin_somedomain (mysql)
> Error: dump admin_somedomain failed
> 
> --------------------------------
> 
> 
> -- SYSTEM --
> 2020-07-27 07:05:01 admin.conf
> 2020-07-27 07:05:01 stats.log
> 2020-07-27 07:05:01 history.log
> 2020-07-27 07:05:01 pam
> 
> 
> -- WEB --
> 2020-07-27 07:05:01 somedomain.com
> 2020-07-27 07:05:09 *** 1 domain ***
> 
> -- DNS --
> 2020-07-27 07:05:09 *** 0 domains ***
> 
> -- DB --
> 2020-07-27 07:05:09 admin_somedomain (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
> sh: 0: getcwd() failed: No such file or directory
> exim: can't get the current working directory: No such file or directory
> Error: dump admin_somedomain failed
> -- SYSTEM --
> 2020-07-27 07:10:01 admin.conf
> 2020-07-27 07:10:01 stats.log
> 2020-07-27 07:10:01 history.log
> 2020-07-27 07:10:01 pam
> 
> 
> -- WEB --
> 2020-07-27 07:10:01 somedomain.com
> 2020-07-27 07:10:09 *** 1 domain ***
> 
> -- DNS --
> 2020-07-27 07:10:09 *** 0 domains ***
> 
> -- DB --
> 2020-07-27 07:10:09 admin_somedomain (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
> sh: 0: getcwd() failed: No such file or directory
> exim: can't get the current working directory: No such file or directory
> Error: dump admin_somedomain failed
> -- SYSTEM --
> 2020-07-27 07:15:01 admin.conf
> 2020-07-27 07:15:01 stats.log
> 2020-07-27 07:15:01 history.log
> 2020-07-27 07:15:01 pam
> 
> 
> -- WEB --
> 2020-07-27 07:15:01 somedomain.com
> 2020-07-27 07:15:09 *** 1 domain ***
> 
> -- DNS --
> 2020-07-27 07:15:09 *** 0 domains ***
> 
> -- DB --
> 2020-07-27 07:15:09 admin_somedomain (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
> sh: 0: getcwd() failed: No such file or directory
> exim: can't get the current working directory: No such file or directory
> Error: dump admin_somedomain failed

Probaly a wild guess: did you disabled the backup cronjob under admin user?

Nope, it’s active. If it has been disabled, system should’t write to logs anything about backups, there are everyday 5:10AM records about failed backup.

Ah, thanks for pointing me to it. First of all: We do not recommend to host anything under the admin user, please create a new user for it.

To your issue, what happens if you try to manualy dump your database using mysqldump? Looks like there is something blocking it.

1 Like

Issue solved. After last successful backup i’ve installed Defender plugin for WordPress, which added prefix to existing DB tables. I’ve disabled it a few moments ago, checked v-backup-user via SSH and created backup via CP interface — works perfect.

Thanks for answers and your time!)

this is interesting. (new) prefixes on the tables or not shouldn’t matter for being able to simply dump the whole db from command-line.
the whole backup process does not care for what’s inside the user dir and database, so normally it cannot depend on the existence or usage of a plugin or not.

maybe however there was something else off/borked with the database and now you somehow fixed/repaired it while fiddling with it.

I’ve got error 1356 when i’ve tried dump db manually via SSH. I suppose that plugin Defender does somthing else with user rights and/or smth, not only adds prefixes in the tables’ names. Maybe i’ll dig in it later)

thanks for adding that detail…

https://boyter.org/2010/10/mysql-error-error1356-view-references-invalid/

maybe that plugin really is using views and not cleaning it up properly or something happened in between which made it stuck.

3 Likes

I don’t see how a plugin making changes to “inside of a database” affects “MySQLDump” which externally dumps the DB regardless of what tables/names/data is inside of the DB, unless there is a problem in the database structure. So I’d investigate a bit more and keep an eye for failing backups and logs that would point to the real problem

2 Likes