sixhop / AutoMySQLBackup

A fork and further development of AutoMySQLBackup from sourceforge. http://sourceforge.net/projects/automysqlbackup/
GNU General Public License v2.0
341 stars 103 forks source link

Bad filedescriptor loop -Centos 8 and Mysql 8 #45

Open hbjonsson opened 4 years ago

hbjonsson commented 4 years ago

Trying to get automysql running with a Mysql 8 database.

On first run it appeared to be stalled:

automysqlbackup /etc/automysqlbackup/automysqlbackup3.mysql.conf

# Checking for permissions to write to folders:
base folder /home/MySQL-Backup/backups ... exists ... ok.
backup folder /home/MySQL-Backup/backups/mysql-db ... exists ... writable? yes. Proceeding.

NOTE: here is where it hangs..... rest appears after the Control-C

^Cchecking directory "/home/MySQL-Backup/backups/mysql-db/daily" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/weekly" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/monthly" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/latest" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/tmp" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/fullschema" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/status" ... exists.

# Testing for installed programs
pigz ... found.
mysql ... found.
mysqldump ... found.

# Parsing databases ... done.
======================================================================
AutoMySQLBackup version 3.0
http://sourceforge.net/projects/automysqlbackup/

Backup of Database Server - localhost
Databases - drupal8,redacted1,information_schema,redacted2,redacted3,redacted4,redacted5,mysql,performance_schema,phpmyadmin,redacted6,redacted7
Databases (monthly) - drupal8,redacted1,information_schema,redacted2,redacted3,redacted4,redacted5,mysql,performance_schema,phpmyadmin,redacted6,redacted7

======================================================================
======================================================================
Dump full schema.

###### WARNING ######
Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
mysql: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.

======================================================================

======================================================================
Dump status.

mysqlshow: [Warning] Using a password on the command line interface can be insecure.
Rotating 4 month backups for

======================================================================

Backup Start Time Mon Nov  2 14:30:31 GMT 2020
======================================================================
Daily Backup ...

Daily Backup of Database ( drupal8 )
mysqldump: [Warning] Using a password on the command line interface can be insecure.
^C/usr/local/bin/automysqlbackup: line 835: 6: Bad file descriptor
/usr/local/bin/automysqlbackup: line 836: 7: Bad file descriptor
Skipping normal output methods, since the program exited before any log files could be created.
dbdump with parameters "drupal8,redacted1,information_schema,redacted2,redacted3,redacted4,redacted5,mysql,performance_schema,phpmyadmin,redacted6,redacted7" "/home/MySQL-Backup/backups/mysql-db/daily/drupal8/daily_drupal8_2020-11-02_14h28m_Monday.sql.gz" failed!

Backup End Time Mon Nov  2 14:31:39 GMT 2020
======================================================================
Total disk space used for backup storage...
Size - Location
136K /home/MySQL-Backup/backups/mysql-db

======================================================================
/usr/local/bin/automysqlbackup: line 835: 6: Bad file descriptor
/usr/local/bin/automysqlbackup: line 836: 7: Bad file descriptor
Skipping normal output methods, since the program exited before any log files could be created.
[root@host MySQL-Backup]# ^C

Second run:

# automysqlbackup /etc/automysqlbackup/automysqlbackup3.mysql.conf

# Checking for permissions to write to folders:
base folder /home/MySQL-Backup/backups ... exists ... ok.
backup folder /home/MySQL-Backup/backups/mysql-db ... exists ... writable? yes. Proceeding.

Here it hangs.....

^Cchecking directory "/home/MySQL-Backup/backups/mysql-db/daily" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/weekly" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/monthly" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/latest" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/tmp" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/fullschema" ... exists.
checking directory "/home/MySQL-Backup/backups/mysql-db/status" ... exists.

# Testing for installed programs
pigz ... found.
mysql ... found.
mysqldump ... found.

# Parsing databases ...
###### WARNING ######
Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
mysql: [Warning] Using a password on the command line interface can be insecure.
^C/usr/local/bin/automysqlbackup: line 835: 6: Bad file descriptor
/usr/local/bin/automysqlbackup: line 836: 7: Bad file descriptor
Skipping normal output methods, since the program exited before any log files could be created.
^C/usr/local/bin/automysqlbackup: line 835: 6: Bad file descriptor
/usr/local/bin/automysqlbackup: line 836: 7: Bad file descriptor
Skipping normal output methods, since the program exited before any log files could be created.
^C/usr/local/bin/automysqlbackup: line 835: 6: Bad file descriptor
/usr/local/bin/automysqlbackup: line 836: 7: Bad file descriptor
Skipping normal output methods, since the program exited before any log files could be created.

Stuck in loop above - have to kill the two automysqlbackup pids with -9

OS is Centos 8 and Mysql 8.

Any ideas on how to fix this?

Here is the config file:

CONFIG_mysql_dump_username='root'
CONFIG_mysql_dump_password='redacted'
CONFIG_backup_dir='/home/MySQL-Backup/backups/mysql-db'
CONFIG_db_exclude=( "redacted8" "redacted9" "performance_schema" "information_schema" )
CONFIG_do_weekly=6
CONFIG_mysql_dump_usessl='no'
stevehop commented 3 years ago

Line 835 and 836 reference the variables $log_file and $log_errfile as part of the stdout and stderror outputs to terminal. I found that by editing the automysqlbackup script itself and and explicitly declaring the previously mentioned variables fixed the problem for me:

log_file=pathtomy_log_file.log log_errfile=pathtomy_log_errfile.log