Closed clavezzo closed 5 years ago
Hi,
Could you please run autoxtrabackup
as standalone executable?
Not by calling .py file:
autoxtrabackup -v -l DEBUG --backup
@clavezzo it seems to be I have spotted the issue and fixed it.
Could you please check again with release_v1.5.4
branch?
By simply doing:
git clone https://github.com/ShahriyarR/MySQL-AutoXtraBackup.git
git checkout release_v1.5.4
cd MySQL-AutoXtraBackup
python3 setup.py install
And then run your command to see if it works or not.
Executing again , but it hasn't worked yet!!!
MySQL-AutoXtraBackup]# python3 ./autoxtrabackup.py -v -l DEBUG --backup
2018-09-21 14:12:03 DEBUG <pid.PidFile object at 0x7fc84be41548> entering setup
2018-09-21 14:12:03 DEBUG <pid.PidFile object at 0x7fc84be41548> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-21 14:12:03 DEBUG <pid.PidFile object at 0x7fc84be41548> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-21 14:12:03 DEBUG Running mysqladmin command -> /usr/bin/mysqladmin --defaults-file=/etc/my.cnf --user=backup_user --password='*' status --host=127.0.0.1 --port=3306
2018-09-21 14:12:04 DEBUG OK: Server is Up and running
2018-09-21 14:12:04 DEBUG OK: /usr/bin/mysql exists
2018-09-21 14:12:04 DEBUG OK: /usr/bin/mysqladmin exists
2018-09-21 14:12:04 DEBUG OK: MySQL configuration file exists
2018-09-21 14:12:04 DEBUG OK: XtraBackup exists
2018-09-21 14:12:04 DEBUG OK: Main backup directory exists
2018-09-21 14:12:04 DEBUG OK: Full Backup directory exists
2018-09-21 14:12:04 DEBUG OK: Increment directory exists
2018-09-21 14:12:04 DEBUG OK: Check status
2018-09-21 14:12:04 DEBUG - - - - You have a full backup that is less than 604800.0 seconds old. - - - -
2018-09-21 14:12:04 DEBUG - - - - We will take an incremental one based on recent Full Backup - - - -
2018-09-21 14:12:07 DEBUG The following backup command will be executed /usr/bin/xtrabackup --defaults-file=/etc/my.cnf --user=backup_user --password='*' --target-dir=/opt/mysql-dump/backup/inc/2018-09-21_14-12-07 --incremental-basedir=/opt/mysql-dump/backup/inc/2018-09-21_00-13-52 --backup --host=127.0.0.1 --port=3306 --compress=quicklz --compress_chunk_size=65536 --no-version-check
2018-09-21 14:12:08 ERROR FAILED: INCREMENT BACKUP
2018-09-21 14:12:08 ERROR xtrabackup: recognized server arguments: --datadir=/var/lib/mysql --tmpdir=/opt/mysql-dump/mariaDB/mysqltmp --innodb_buffer_pool_size=8gb --innodb_flush_log_at_trx_commit=1 --innodb_log_file_size=50331648 --innodb_max_dirty_pages_pct=90
xtrabackup: recognized client arguments: --datadir=/var/lib/mysql --tmpdir=/opt/mysql-dump/mariaDB/mysqltmp --innodb_buffer_pool_size=8gb --innodb_flush_log_at_trx_commit=1 --innodb_log_file_size=50331648 --innodb_max_dirty_pages_pct=90 --user=backup_user --password=* --target-dir=/opt/mysql-dump/backup/inc/2018-09-21_14-12-07 --incremental-basedir=/opt/mysql-dump/backup/inc/2018-09-21_00-13-52 --backup=1 --host=127.0.0.1 --port=3306 --compress=quicklz --compress-chunk-size=65536 --no-version-check=1
xtrabackup: Error: cannot open /opt/mysql-dump/backup/inc/2018-09-21_00-13-52//xtrabackup_checkpoints
xtrabackup: error: failed to read metadata from /opt/mysql-dump/backup/inc/2018-09-21_00-13-52//xtrabackup_checkpoints
2018-09-21 14:12:08 DEBUG <pid.PidFile object at 0x7fc84be41548> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
Traceback (most recent call last):
File "./autoxtrabackup.py", line 312, in <module>
all_procedure()
File "/opt/Python-3.5.3/lib/python3.5/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/opt/Python-3.5.3/lib/python3.5/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/opt/Python-3.5.3/lib/python3.5/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/Python-3.5.3/lib/python3.5/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/opt/Python-3.5.3/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "./autoxtrabackup.py", line 270, in all_procedure
b.all_backup()
File "/home/MySQL-AutoXtraBackup/master_backup_script/backuper.py", line 917, in all_backup
self.inc_backup()
File "/home/MySQL-AutoXtraBackup/master_backup_script/backuper.py", line 846, in inc_backup
raise RuntimeError("FAILED: INCREMENT BACKUP")
RuntimeError: FAILED: INCREMENT BACKUP
2018-09-21 14:12:08 DEBUG <pid.PidFile object at 0x7fc84be41548> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
The latest error is totally different. The error indicates that your previous backups has no xtrabackup_checkpoints
file. As you remember you have already failed previous backups. This is from Percona XtraBackup itself:
xtrabackup: Error: cannot open /opt/mysql-dump/backup/inc/2018-09-21_00-13-52//xtrabackup_checkpoints
xtrabackup: error: failed to read metadata from /opt/mysql-dump/backup/inc/2018-09-21_00-13-52//xtrabackup_checkpoints
@clavezzo please remove all previous backups and run it again.
python3 ./autoxtrabackup.py
, call just autoxtrabackup
instead.What's the problem?
[root@dubhe MySQL-AutoXtraBackup]# autoxtrabackup -v -l DEBUG --backup -bash: autoxtrabackup: command not found
[root@xxxMySQL-AutoXtraBackup]# ./autoxtrabackup.py -v -l DEBUG --backup
./autoxtrabackup.py: line 1: import: command not found
./autoxtrabackup.py: line 2: from: command not found
./autoxtrabackup.py: line 3: from: command not found
./autoxtrabackup.py: line 4: from: command not found
./autoxtrabackup.py: line 5: from: command not found
./autoxtrabackup.py: line 6: from: command not found
./autoxtrabackup.py: line 7: from: command not found
./autoxtrabackup.py: line 8: from: command not found
./autoxtrabackup.py: line 9: import: command not found
./autoxtrabackup.py: line 10: import: command not found
./autoxtrabackup.py: line 11: import: command not found
./autoxtrabackup.py: line 12: import: command not found
./autoxtrabackup.py: line 13: import: command not found
./autoxtrabackup.py: line 14: import: command not found
./autoxtrabackup.py: line 15: import: command not found
./autoxtrabackup.py: line 16: from: command not found
./autoxtrabackup.py: line 17: from: command not found
./autoxtrabackup.py: line 19: syntax error near unexpected token (' ./autoxtrabackup.py: line 19:
logger = logging.getLogger('')'
[root@dubhe MySQL-AutoXtraBackup]#
I've cleaned the olds backups, except backup full.Continue occurring erro.
[root@dubhe MySQL-AutoXtraBackup]# python3 ./autoxtrabackup.py -v -l DEBUG --backup
2018-09-21 16:37:06 DEBUG <pid.PidFile object at 0x7f5e6d2fb5e8> entering setup
2018-09-21 16:37:06 DEBUG <pid.PidFile object at 0x7f5e6d2fb5e8> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-21 16:37:06 DEBUG <pid.PidFile object at 0x7f5e6d2fb5e8> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-21 16:37:06 DEBUG Running mysqladmin command -> /usr/bin/mysqladmin --defaults-file=/etc/my.cnf --user=backup_user --password='' status --host=127.0.0.1 --port=3306
2018-09-21 16:37:06 DEBUG OK: Server is Up and running
2018-09-21 16:37:06 DEBUG OK: /usr/bin/mysql exists
2018-09-21 16:37:06 DEBUG OK: /usr/bin/mysqladmin exists
2018-09-21 16:37:06 DEBUG OK: MySQL configuration file exists
2018-09-21 16:37:06 DEBUG OK: XtraBackup exists
2018-09-21 16:37:06 DEBUG OK: Main backup directory exists
2018-09-21 16:37:06 DEBUG OK: Full Backup directory exists
2018-09-21 16:37:06 DEBUG OK: Increment directory exists
2018-09-21 16:37:06 DEBUG OK: Check status
2018-09-21 16:37:06 DEBUG - - - - You have a full backup that is less than 604800.0 seconds old. - - - -
2018-09-21 16:37:06 DEBUG - - - - We will take an incremental one based on recent Full Backup - - - -
2018-09-21 16:37:09 DEBUG The following backup command will be executed /usr/bin/xtrabackup --defaults-file=/etc/my.cnf --user=backup_user --password='' --target-dir=/opt/mysql-dump/backup/inc/2018-09-21_16-37-09 --incremental-basedir=/opt/mysql-dump/backup/full/2018-09-20_14-50-54 --backup --host=127.0.0.1 --port=3306 --compress=quicklz --compress-chunk-size=65536 --compress-threads=4 --no-version-check
2018-09-21 16:37:09 ERROR FAILED: INCREMENTAL BACKUP
2018-09-21 16:37:09 ERROR xtrabackup: recognized server arguments: --datadir=/var/lib/mysql --tmpdir=/opt/mysql-dump/mariaDB/mysqltmp --innodb_buffer_pool_size=8gb --innodb_flush_log_at_trx_commit=1 --innodb_log_file_size=50331648 --innodb_max_dirty_pages_pct=90
xtrabackup: recognized client arguments: --datadir=/var/lib/mysql --tmpdir=/opt/mysql-dump/mariaDB/mysqltmp --innodb_buffer_pool_size=8gb --innodb_flush_log_at_trx_commit=1 --innodb_log_file_size=50331648 --innodb_max_dirty_pages_pct=90 --user=backup_user --password= --target-dir=/opt/mysql-dump/backup/inc/2018-09-21_16-37-09 --incremental-basedir=/opt/mysql-dump/backup/full/2018-09-20_14-50-54 --backup=1 --host=127.0.0.1 --port=3306 --compress=quicklz --compress-chunk-size=65536 --compress-threads=4 --no-version-check=1
xtrabackup: Error: cannot open /opt/mysql-dump/backup/full/2018-09-20_14-50-54//xtrabackup_checkpoints
xtrabackup: error: failed to read metadata from /opt/mysql-dump/backup/full/2018-09-20_14-50-54//xtrabackup_checkpoints
2018-09-21 16:37:09 DEBUG <pid.PidFile object at 0x7f5e6d2fb5e8> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
Traceback (most recent call last):
File "./autoxtrabackup.py", line 312, in
The full backup finished with errors : corruped file
my AutoXtraBackup config file:
cat /root/.autoxtrabackup/autoxtrabackup.cnf [MySQL] mysql=/usr/bin/mysql mycnf=/etc/my.cnf mysqladmin=/usr/bin/mysqladmin mysql_user=xxxxxx mysql_password=xxxxxx
mysql_host=127.0.0.1 mysql_port=3306 datadir=/var/lib/mysql
[Backup]
pid_dir=/tmp/MySQL-AutoXtraBackup tmpdir=/opt/mysql-dump/backup/tmp
pid_runtime_warning=5 Hours backupdir=/opt/mysql-dump/backup backup_tool=/usr/bin/xtrabackup
xtra_prepare=--apply-log-only
xtra_options=--no-version-check
full_backup_interval=7 day
[Compress]
compress=quicklz compress_chunk_size=65536 compress_threads=4 decompress=TRUE
[Encrypt]
[Xbstream]
[Commands] start_mysql_command=service mysql start stop_mysql_command=service mysql stop
chown_command=chown -R mysql:mysql
Pls any solution?
Now , Don't work the backup full too.
[root@dubhe MySQL-AutoXtraBackup]# python3 ./autoxtrabackup.py -v -l DEBUG --backup
2018-09-23 02:45:43 DEBUG <pid.PidFile object at 0x7f9e0fe96688> entering setup
2018-09-23 02:45:43 DEBUG <pid.PidFile object at 0x7f9e0fe96688> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-23 02:45:43 DEBUG <pid.PidFile object at 0x7f9e0fe96688> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-23 02:45:43 DEBUG Running mysqladmin command -> /usr/bin/mysqladmin --defaults-file=/etc/my.cnf --user=backup_user --password='' status --host=127.0.0.1 --port=3306
2018-09-23 02:45:43 DEBUG OK: Server is Up and running
2018-09-23 02:45:43 DEBUG OK: /usr/bin/mysql exists
2018-09-23 02:45:43 DEBUG OK: /usr/bin/mysqladmin exists
2018-09-23 02:45:43 DEBUG OK: MySQL configuration file exists
2018-09-23 02:45:43 DEBUG OK: XtraBackup exists
2018-09-23 02:45:43 DEBUG OK: Main backup directory exists
2018-09-23 02:45:43 DEBUG OK: Full Backup directory exists
2018-09-23 02:45:43 DEBUG OK: Increment directory exists
2018-09-23 02:45:43 DEBUG OK: Check status
2018-09-23 02:45:43 DEBUG - - - - You have no backups : Taking very first Full Backup! - - - -
2018-09-23 02:45:43 DEBUG Trying to flush logs
2018-09-23 02:45:43 ERROR FAILED: Log flushing
2018-09-23 02:45:43 ERROR ERROR 1105 (HY000) at line 1: Unknown error
2018-09-23 02:45:43 DEBUG <pid.PidFile object at 0x7f9e0fe96688> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
Traceback (most recent call last):
File "./autoxtrabackup.py", line 312, in
@clavezzo
I have the same error, first incremental works, second one fails with error:
Traceback (most recent call last):
File "/bin/autoxtrabackup", line 11, in
@kakulacis which version of autoxtrabackup you are using?
Could you please check it with -> release_v1.5.4
branch?
Sorry, it was 1.5.3, changed backuper.py as you have described in a fix (@ShahriyarR Fixing indentation problem for issue #318 (#319)) and it is working now. Sorry for troubling.
Edit the backuper.py file. In the 813th row,left alignment “filteredargs =……”
My example: vim /usr/local/lib/python3.6/site-packages/mysql_autoxtrabackup-1.5.3-py3.6.egg/master_backup_script/backuper.py
812 # filter out password from argument list 813 filteredargs = re.sub("--password='?\w+'?", "--password='*'", args) 814 815 logger.debug("The following backup command will be executed {}".format(filteredargs))
Edit the backuper.py file. In the 813th row,left alignment “filteredargs =……”
My example: vim /usr/local/lib/python3.6/site-packages/mysql_autoxtrabackup-1.5.3-py3.6.egg/master_backup_script/backuper.py
812 # filter out password from argument list 813 filteredargs = re.sub("--password='?\w+'?", "--password='*'", args) 814 815 logger.debug("The following backup command will be executed {}".format(filteredargs))
按你的方法修改代码后,问题解决。
Already fixed in release_v1.5.4 and merged. Will be available soon as general release.
Hello. I installed the last version of autoxtrabackup, following the document, MySQL AutoXtrabackup Documentation Release 1.5.3.
When I try run the autoxtrabackup.py code to make the incremental backup, occurrs the issue below: