Mysql – thesqlbackup failed with error when –use-tts option is used

backupMySQL

I just found an interesting behavior when using the mysqlbackup feature to create a backup of a database and i'm wondering if i missed any steps or maybe a config that i missed or created a typo somewhere.

When running the following command:

/path/to/mysql_enterprise_backup/bin/mysqlbackup –host=127.0.0.1
–user=$BACKUP_USER –password=$BACKUP_PASS –include-tables="^*.*$" –with-timestamp –use-tts –backup-dir=$BACKUP_DIR –compress backup-and-apply-log

I get an error at the end of the script:

InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
86 87 88 89 90 91 92 93 94 95 96 97 98 99 210120 09:53:45 PCR1
INFO: We were able to parse ibbackup_logfile up to
lsn 31466657750. 210120 09:53:45 MAIN INFO: Apply-log-compress operation completed successfully. 210120 09:53:45
MAIN INFO: Full backup prepared for recovery successfully.

MAIN: Can't get stat of
'/path/to/backup/hotbackups/2021-01-20_09-51-53/datadir/ibdata1'
(Errcode: 2 – No such file or directory) 210120 09:53:45 MAIN ERROR:
Unable to get the size of file
/path/to/backup/hotbackups/2021-01-20_09-51-53/datadir/ibdata1. Error
code: 2, No such file or directory

mysqlbackup failed with errors!

As per the error, the script attempts to get the size of the ibdata1 file, but it can't find it and fails.

the only folders available in the datadir directory are my schemas and ibbackup_logfile, but not ibdata

Now this is where it get's interesting and also where i'm getting lost.
I'm using the –use-tts option when creating my backup (in order to be selective and restore in another environment) but looking at the doc for the use-tts option https://dev.mysql.com/doc/mysql-enterprise-backup/3.12/en/backup-partial-options.html#option_meb_use-tts and i quote:

The system tablespace is not backed up, saving disk space and I/O
resources

With this in mind, if i understand correctly, the –use-tts option will not backup and create a ibdata file but the command mysqlbackup will still check for that specific file even though the option to not create it has been specified in the command.

This is causing the backup to get the fail message.

My dilemma at this time is that the mysqlbackup script fails even though my backup seems to have been done correctly. (i'm assuming it was done correctly because of this log entry: 210120 09:53:45 MAIN INFO: Full backup prepared for recovery successfully.)

Has anyone noticed this before?

Best Answer

This is some error cause by bad usage of the tool. Make sure you are running a mysqlbackup version that is compatible with the server version of MySQL your databases are running. Note that upgrading only either one will not work, so for instance MySQL version 8 and older only works with MySQL Enterprise Backup 8 or older.

Check from the documentation.