[MDEV-17960] 'mariabackup --prepare': Cannot config file, backup-my.cnf Created: 2018-12-10  Updated: 2021-02-22  Resolved: 2018-12-14

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.3.10
Fix Version/s: N/A

Type: Bug Priority: Blocker
Reporter: Test Jetco Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: need_feedback
Environment:

RedHat Enterprise 7.3


Issue Links:
Duplicate
is duplicated by MDEV-24938 mariabackup --prepare raises "Can't o... Closed

 Description   

I am testing mariabackup. I could successfully make a mariadb backup using mariabackup utility. As the manual said before restore (-copy-back), we should use '-prepare' option first.

Therefore, I executed the following statement:

  1. mariabackup --defaults-file=/etc/my.cnf.d/backup-my.cnf --prepare --target-dir=/backup/mariadb-backup-20181210182451

mariabackup based on MariaDB server 10.3.10-MariaDB Linux (x86_64)
mariabackup: cd to /backup/mariadb-backup-20181210182451/
cannot open backup-my.cnf for reading

It complained 'cannot open backup-my.cnf for reading'.

Then I tried the following:

  1. mariabackup --defaults-file="/etc/my.cnf.d/backup-my.cnf" --prepare --target-dir=/backup/mariadb-backup-20181210182451

Same error messages!

I have already created 'backup-my.cnf' under /etc/my.cnf.d

cd /etc/my.cnf.d

[root@db1 my.cnf.d]# ll
total 16
rw-rr-. 1 root root 739 Dec 10 18:42 backup-my.cnf
rw-rr-. 1 root root 763 Oct 2 17:45 enable_encryption.preset
rw-rr-. 1 root root 232 Oct 2 17:45 mysql-clients.cnf
rw-rr-. 1 root root 1789 Dec 10 18:40 server.cnf

Why did mariabackup complain 'cannot open backup-my.cnf for reading'?



 Comments   
Comment by Vladislav Vaintroub [ 2018-12-10 ]

There must be a backup-my.cnf in your backup directory , not in /etc
mariabackup --backup creates it, and mariabackup --prepare uses it.

I hope the manual did not say you should supply your own backup-my.cnf

It mus be there, in backup directory

Comment by Test Jetco [ 2018-12-14 ]

Thank you so much.

The ownership of the backup directory is as follows:

drwx------. 2 root root 239 Dec 14 21:33 mariadb-backup-20181214213349

Under mariadb-backup-20181214213349, there is the backup-my.cnf file...

rw-r----. 1 root root 338 Dec 14 21:33 backup-my.cnf.qp

I used '-compress' option to back up MariaDB. As root is used to perform '-prepare' operation, it should not be file permission issue, right? The file, backup-my.cnf, was compressed as backup-my.cnf.qp. The file, backup-my.cnf, does not exist. Is it the cause of the error message, 'cannot open backup-my.cnf for reading'?

Do I need to decompress the backup files before doing '--prepare'?

Comment by Vladislav Vaintroub [ 2018-12-14 ]

This is why we deprecate the --compress, because it is very very confusing to all users.
Yes, you need to decompress everything

Generated at Thu Feb 08 08:40:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.