ShahriyarR / MySQL-AutoXtraBackup

MySQL-AutoXtraBackup commandline tool written in Python 3 based on Percona XtraBackup
https://autoxtrabackup.azepug.az/
MIT License
140 stars 79 forks source link

MySQL-AutoXtraBackup Version: 1.5.3 UnboundLocalError: local variable 'filteredargs' referenced before assignment #318

Closed clavezzo closed 5 years ago

clavezzo commented 5 years ago

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:

[root@vvv master_backup_script]# python3 ../autoxtrabackup.py -v -l DEBUG --backup
2018-09-21 00:13:49 DEBUG <pid.PidFile object at 0x7f5268228548> entering setup
2018-09-21 00:13:49 DEBUG <pid.PidFile object at 0x7f5268228548> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-21 00:13:49 DEBUG <pid.PidFile object at 0x7f5268228548> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
2018-09-21 00:13:49 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 00:13:49 DEBUG OK: Server is Up and running
2018-09-21 00:13:49 DEBUG OK: /usr/bin/mysql exists
2018-09-21 00:13:49 DEBUG OK: /usr/bin/mysqladmin exists
2018-09-21 00:13:49 DEBUG OK: MySQL configuration file exists
2018-09-21 00:13:49 DEBUG OK: XtraBackup exists
2018-09-21 00:13:49 DEBUG OK: Main backup directory exists
2018-09-21 00:13:49 DEBUG OK: Full Backup directory exists
2018-09-21 00:13:49 DEBUG OK: Increment directory exists
2018-09-21 00:13:49 DEBUG OK: Check status
2018-09-21 00:13:49 DEBUG - - - - You have a full backup that is less than 604800.0 seconds old. - - - -
2018-09-21 00:13:49 DEBUG - - - - We will take an incremental one based on recent Full Backup - - - -
2018-09-21 00:13:52 DEBUG <pid.PidFile object at 0x7f5268228548> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
Traceback (most recent call last):
File "../autoxtrabackup.py", line 308, in 
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 266, 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 815, in inc_backup
logger.debug("The following backup command will be executed {}".format(filteredargs))
UnboundLocalError: local variable 'filteredargs' referenced before assignment
2018-09-21 00:13:52 DEBUG <pid.PidFile object at 0x7f5268228548> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid
[root@vvv master_backup_script]# vi backuper.py
[root@vvv master_backup_script]# python3 ../autoxtrabackup.py -version
Error: no such option: -e
[root@vvv master_backup_script]# python3 ../autoxtrabackup.py --version
Developed by Shahriyar Rzayev from Azerbaijan MUG(http://mysql.az)
Link : https://github.com/ShahriyarR/MySQL-AutoXtraBackup
Email: rzayev.shahriyar@yandex.com
Based on Percona XtraBackup: https://github.com/percona/percona-xtrabackup/
MySQL-AutoXtraBackup Version: 1.5.3
ShahriyarR commented 5 years ago

Hi, Could you please run autoxtrabackup as standalone executable? Not by calling .py file: autoxtrabackup -v -l DEBUG --backup

ShahriyarR commented 5 years ago

@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.

clavezzo commented 5 years ago

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
ShahriyarR commented 5 years ago

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.

clavezzo commented 5 years ago

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]#

clavezzo commented 5 years ago

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 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 666, in inc_backup raise RuntimeError("FAILED: INCREMENTAL BACKUP") RuntimeError: FAILED: INCREMENTAL BACKUP 2018-09-21 16:37:09 DEBUG <pid.PidFile object at 0x7f5e6d2fb5e8> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.py.pid

clavezzo commented 5 years ago

The full backup finished with errors : corruped file

clavezzo commented 5 years ago

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

Set either mysql_socket or host and post. If both are set socket is used

mysql_socket=/var/lib/mysql/mysql.sock

mysql_host=127.0.0.1 mysql_port=3306 datadir=/var/lib/mysql

[Backup]

Optional: set pid directory

pid_dir=/tmp/MySQL-AutoXtraBackup tmpdir=/opt/mysql-dump/backup/tmp

Optional: set warning if pid of backup us running for longer than X

pid_runtime_warning=5 Hours backupdir=/opt/mysql-dump/backup backup_tool=/usr/bin/xtrabackup

Optional: specify different path/version of xtrabackup here for prepare

prepare_tool=

xtra_prepare=--apply-log-only

Optional: pass additional options for backup stage

xtra_backup=--compact

Optional: pass additional options for prepare stage

xtra_prepare_options=--rebuild-indexes

Optional: pass general additional options; it will go to both for backup and prepare

xtra_options=--binlog-info=ON --galera-info

xtra_options=--no-version-check

Optional: set archive and rotation

archive_dir=/home/shahriyar.rzaev/XB_TEST/backup_archives

prepare_archive=1

move_archive=0

full_backup_interval=7 day

max_archive_size=100GiB

max_archive_duration=7 Days

Optional WARNING(Enable this if you want to take partial backups). Specify database names or table names.

partial_list=test

[Compress]

Optional

Enable only if you want to use compression.

compress=quicklz compress_chunk_size=65536 compress_threads=4 decompress=TRUE

Enable if you want to remove .qp files after decompression.(Not available yet, will be released with XB 2.3.7 and 2.4.6)

remove_original=FALSE

[Encrypt]

Optional

Enable only if you want to create encrypted backups

xbcrypt=/usr/bin/xbcrypt

encrypt=AES256

Please note that --encrypt-key and --encrypt-key-file are mutually exclusive

encrypt_key='VVTBwgM4UhwkTTV98fhuj+D1zyWoA89K'

encrypt_key_file=/path/to/file/with_encrypt_key

encrypt_threads=4

encrypt_chunk_size=65536

decrypt=AES256

Enable if you want to remove .qp files after decompression.(Not available yet, will be released with XB 2.3.7 and 2.4.6)

remove_original=FALSE

[Xbstream]

EXPERIMENTAL

Enable this, if you want to stream your backups

xbstream=/usr/bin/xbstream

stream=xbstream

Optional

Please enable this and disable all other options here, for tar streaming

stream=tar

xbstream_options=-x --parallel=100

xbs_decrypt=1

WARN, enable this, if you want to stream your backups to remote host

remote_stream=ssh xxx.xxx.xxx.xxx

Optional remote syncing

[Remote]

remote_conn=root@xxx.xxx.xxx.xxx

remote_dir=/home/sh/Documents

[Commands] start_mysql_command=service mysql start stop_mysql_command=service mysql stop

Change user:group respectively

chown_command=chown -R mysql:mysql

Do not touch; this is for --test_mode, which is testing for XtraBackup itself.

[TestConf]

ps_branches=5.5 5.6 5.7

pxb_branches=2.3 2.4

gitcmd=--recursive --depth=1 https://github.com/percona/percona-server.git

pxb_gitcmd=https://github.com/percona/percona-xtrabackup.git

testpath=/home/shahriyar.rzaev/XB_TEST/server_dir

incremental_count=3

make_slaves=1

xb_configs=xb_2_4_ps_5_6.cnf xb_2_4_ps_5_7.cnf xb_2_3_ps_5_6.cnf xb_2_3_ps_5_5.cnf xb_2_4_ps_5_5.cnf

default_mysql_options=--log-bin=mysql-bin,--log-slave-updates,--server-id={},--gtid-mode=ON,--enforce-gtid-consistency,--binlog-format=row

mysql_options=--innodb_buffer_pool_size=1G 2G 3G,--innodb_log_file_size=1G 2G 3G,--innodb_page_size=4K 8K 16K 32K 64K

clavezzo commented 5 years ago

Pls any solution?

clavezzo commented 5 years ago

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 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 865, in all_backup if self.mysql_connection_flush_logs(): File "/home/MySQL-AutoXtraBackup/master_backup_script/backuper.py", line 214, in mysql_connection_flush_logs raise RuntimeError("FAILED: Log flushing -> {}".format(output)) RuntimeError: FAILED: Log flushing -> 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

ShahriyarR commented 5 years ago

@clavezzo

kakulacis commented 5 years ago

I have the same error, first incremental works, second one fails with error: Traceback (most recent call last): File "/bin/autoxtrabackup", line 11, in sys.exit(all_procedure()) File "/usr/lib64/python3.6/site-packages/click/core.py", line 764, in call return self.main(args, kwargs) File "/usr/lib64/python3.6/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/usr/lib64/python3.6/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib64/python3.6/site-packages/click/core.py", line 555, in invoke return callback(args, *kwargs) File "/usr/lib64/python3.6/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), args, **kwargs) File "/usr/lib/python3.6/site-packages/autoxtrabackup.py", line 266, in all_procedure b.all_backup() File "/usr/lib/python3.6/site-packages/master_backup_script/backuper.py", line 917, in all_backup self.inc_backup() File "/usr/lib/python3.6/site-packages/master_backup_script/backuper.py", line 815, in inc_backup logger.debug("The following backup command will be executed {}".format(filteredargs)) UnboundLocalError: local variable 'filteredargs' referenced before assignment 2018-10-01 09:26:15 DEBUG <pid.PidFile object at 0x7f278cea8908> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid

ShahriyarR commented 5 years ago

@kakulacis which version of autoxtrabackup you are using? Could you please check it with -> release_v1.5.4 branch?

kakulacis commented 5 years ago

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.

hzc2012 commented 5 years ago

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))

nonamexz commented 5 years ago

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))

按你的方法修改代码后,问题解决。

ShahriyarR commented 5 years ago

Already fixed in release_v1.5.4 and merged. Will be available soon as general release.