innobackupex-1.5.1 --copy-back fails

Bug #357653 reported by MarkD
2
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
High
Unassigned

Bug Description

Hi,

i'm currently trying to copy back a backup and i get the following error:

innobackupex-1.5.1 --copy-back /mysql/backup/2009-04-08_10-24-32

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackup
           prints "innobackup completed OK!".

innobackupex: Error: Backup data file '/mysql/backup/2009-04-08_10-24-32//mysql/data/ibdata1' does not exist. at ./innobackupex-1.5.1 line 433.

-------

stat("/mysql/data", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/mysql/logs", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
stat("/mysql/backup/2009-04-08_10-24-32//mysql/data/ibdata1", 0xa9b3140) = -1 ENOENT (No such file or directory)
stat("/mysql/backup/2009-04-08_10-24-32//mysql/data/ibdata1.ibz", 0xa9b3140) = -1 ENOENT (No such file or directory)
write(2, "innobackupex: Error: Backup data"..., 144innobackupex: Error: Backup data file '/mysql/backup/2009-04-08_10-24-32//mysql/data/ibdata1' does not exist. at ./innobackupex-1.5.1 line 433.

-------

Backup created with "innobackupex-1.5.1 --prepare" and "innobackupex-1.5.1 --apply-log" (all ended with OK).

my.cnf:
.........
innodb_data_home_dir = /
innodb_data_file_path = /mysql/data/ibdata1:128M:autoextend
innodb_file_per_table
innodb_log_group_home_dir = /mysql/logs
innodb_buffer_pool_size = 4096M
innodb_additional_mem_pool_size = 32M
innodb_log_file_size = 128M
innodb_log_files_in_group = 2

/mysql/backup/backup-my.cnf:
# This MySQL options file was generated by innobackup.

# The MySQL server
[mysqld]
datadir=/media/local-data0/backup/2009-04-08_10-24-32
innodb_data_home_dir=/media/local-data0/backup/2009-04-08_10-24-32
innodb_data_file_path=/mysql/data/ibdata1:128M:autoextend
innodb_log_group_home_dir=/media/local-data0/backup/2009-04-08_10-24-32
innodb_log_files_in_group=2
innodb_log_file_size=134217728

Btw. backup-my.cnf: /mysql/data in innodb_data_file_path doesn't seem right, does it?

Greets
Mark Davis

Related branches

description: updated
Revision history for this message
MarkD (mark-davis-ewetel) wrote :

For me this seems to work:

-------------------------------
@@ -605,6 +605,8 @@
     # make a list of all ibdata files in the backup directory and all
     # directories in the backup directory under which there are ibdata files
     foreach my $a (split(/;/, $orig_innodb_data_file_path)) {
+
+ $a =~ s/^$orig_datadir//;
         my $path = (split(/:/,$a))[0];
         my $filename = (split(/\/+/, $path))[0];

-------------------------------
But i don't know, if this is a proper fix or if it breaks other setups.

Revision history for this message
MarkD (mark-davis-ewetel) wrote :

Mhh,

not really a proper fix... Just got this:

innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ibdata1'

innobackupex: Starting to copy InnoDB tables and indexes
innobackupex: in '/mysql/backup/2009-04-08_10-24-32'
innobackupex: back to original InnoDB data directory '/'
innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32//mysql/data/ibdata1'
cp: cannot stat `/mysql/backup/2009-04-08_10-24-32//mysql/data/ibdata1': No such file or directory
innobackupex: Error: Failed to copy file '/mysql/data/ibdata1': Bad file descriptor at ./innobackupex-1.5.1 line 433.

Revision history for this message
MarkD (mark-davis-ewetel) wrote :

innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ibdata1'

innobackupex: Starting to copy InnoDB tables and indexes
innobackupex: in '/mysql/backup/2009-04-08_10-24-32'
innobackupex: back to original InnoDB data directory '/'
innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32//ibdata1'

innobackupex: Starting to copy InnoDB log files
innobackupex: in '/mysql/backup/2009-04-08_10-24-32'
innobackupex: back to original InnoDB log directory '/mysql/logs'
innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ib_logfile1'
innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ib_logfile0'
innobackupex: Finished copying back files.

--------------------------

@@ -605,6 +605,8 @@
     # make a list of all ibdata files in the backup directory and all
     # directories in the backup directory under which there are ibdata files
     foreach my $a (split(/;/, $orig_innodb_data_file_path)) {
+
+ $a =~ s/^$orig_datadir//;
         my $path = (split(/:/,$a))[0];
         my $filename = (split(/\/+/, $path))[0];

@@ -671,6 +673,7 @@
     print STDERR "$prefix in '$backup_dir'\n";
     print STDERR "$prefix back to original InnoDB data directory '$orig_ibdata_dir'\n";
     foreach my $a (split(/;/, $orig_innodb_data_file_path)) {
+ $a =~ s/$orig_datadir//;
         # get the relative pathname of a data file
         my $path = (split(/:/,$a))[0];
         print STDERR "$prefix Copying file '$backup_dir/$path'\n";
------------------

Sorry for update-"spam". Are you guys contactable on freenode or something?

Revision history for this message
Vadim Tkachenko (vadim-tk) wrote : Re: [Percona-discussion] [Bug 357653] Re: innobackupex-1.5.1 --copy-back fails

MarkD,

Thanks for testing, we will look into....

Unfortunately we are not available on freenode, it's OK to communicate
there.

MarkD wrote:
> innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ibdata1'
>
> innobackupex: Starting to copy InnoDB tables and indexes
> innobackupex: in '/mysql/backup/2009-04-08_10-24-32'
> innobackupex: back to original InnoDB data directory '/'
> innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32//ibdata1'
>
> innobackupex: Starting to copy InnoDB log files
> innobackupex: in '/mysql/backup/2009-04-08_10-24-32'
> innobackupex: back to original InnoDB log directory '/mysql/logs'
> innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ib_logfile1'
> innobackupex: Copying file '/mysql/backup/2009-04-08_10-24-32/ib_logfile0'
> innobackupex: Finished copying back files.
>
> --------------------------
>
> @@ -605,6 +605,8 @@
> # make a list of all ibdata files in the backup directory and all
> # directories in the backup directory under which there are ibdata files
> foreach my $a (split(/;/, $orig_innodb_data_file_path)) {
> +
> + $a =~ s/^$orig_datadir//;
> my $path = (split(/:/,$a))[0];
> my $filename = (split(/\/+/, $path))[0];
>
> @@ -671,6 +673,7 @@
> print STDERR "$prefix in '$backup_dir'\n";
> print STDERR "$prefix back to original InnoDB data directory '$orig_ibdata_dir'\n";
> foreach my $a (split(/;/, $orig_innodb_data_file_path)) {
> + $a =~ s/$orig_datadir//;
> # get the relative pathname of a data file
> my $path = (split(/:/,$a))[0];
> print STDERR "$prefix Copying file '$backup_dir/$path'\n";
> ------------------
>
> Sorry for update-"spam". Are you guys contactable on freenode or
> something?
>

--
Vadim Tkachenko, CTO
Percona Inc.
ICQ: 369-510-335, Skype: vadimtk153, Phone +1-888-401-3403
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.percona.com/

  Attend the 2009 Percona Performance Conference
  April 22-23 - http://conferences.percona.com/

Changed in percona-xtrabackup:
importance: Undecided → High
Changed in percona-xtrabackup:
assignee: nobody → yasufumi-kinoshita
status: New → Confirmed
Revision history for this message
Yasufumi Kinoshita (yasufumi-kinoshita) wrote :

Thank you for reporting.

I have pushed the fix.

http://bazaar.launchpad.net/~percona-dev/percona-xtrabackup/trunk/revision/42

Some strange behavior when kind of your settings also may be fixed.

Changed in percona-xtrabackup:
status: Confirmed → Fix Committed
Changed in percona-xtrabackup:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-255

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.