innobackupex fails with relative paths

Bug #1433140 reported by arcadius
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Confirmed
Medium
Unassigned
2.2
Won't Fix
Undecided
Unassigned
2.3
Confirmed
Medium
Unassigned

Bug Description

innobackupex changes the current directory inside it, so if I give it BASEDIR and/or INCREMENTAL-DIR as relative paths:

# /usr/local/bin/innobackupex --use-memory=4G --apply-log --redo-only all-2015-02-28_22h28m-backup --incremental-dir=all-2015-03-03_22h34m-backup

.. , they become invalid & innobackupex outputs smth like:

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.

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

150317 17:58:02 innobackupex: Starting the apply-log operation

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".

150317 17:58:02 innobackupex: Starting ibbackup with command: xtrabackup --defaults-file="/var/backup/dumps/all-2015-02-28_22h28m-backup/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/var/backup/dumps/all-2015-02-28_22h28m-backup --apply-log-only --use-memory=4G --incremental-dir=all-2015-03-03_22h34m-backup

xtrabackup version 2.2.6 based on MySQL server 5.6.21 FreeBSD9.1 (amd64) (revision id: )
incremental backup from 649139193500 is enabled.
xtrabackup: cd to /var/backup/dumps/all-2015-02-28_22h28m-backup
xtrabackup: This target seems to be already prepared.
2015-03-17 17:58:02 803007400 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: Warning: cannot open all-2015-03-03_22h34m-backup/xtrabackup_logfile. will try to find.
2015-03-17 17:58:02 803007400 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
  xtrabackup: Fatal error: cannot find all-2015-03-03_22h34m-backup/xtrabackup_logfile.
xtrabackup: Error: xtrabackup_init_temp_log() failed.
innobackupex: got a fatal error with the following stacktrace: at /usr/local/bin/innobackupex line 2632.
 main::apply_log() called at /usr/local/bin/innobackupex line 1561
innobackupex: Error:
innobackupex: ibbackup failed at /usr/local/bin/innobackupex line 2632.

Maybe, input paths should be expanded with realpath command.

Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote :

Verified with 2.2.9. While prepare incremental , innobackupex fails with relative path.

root@desktop:/home/nilnandan/backup# xtrabackup --version
xtrabackup version 2.2.9 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
root@desktop:/home/nilnandan/backup#

root@desktop:/home/nilnandan/backup# ll
total 32
drwxrwxr-x 5 nilnandan nilnandan 4096 Mar 21 13:38 ./
drwx------ 43 nilnandan nilnandan 16384 Mar 21 13:28 ../
drwxr-xr-x 6 root root 4096 Mar 21 13:30 2015-03-21_13-29-07/
drwxr-xr-x 6 root root 4096 Mar 21 13:39 2015-03-21_13-35-26/
drwxr-xr-x 6 root root 4096 Mar 21 13:38 2015-03-21_13-38-29/
root@desktop:/home/nilnandan/backup#

root@desktop:/home/nilnandan/backup# innobackupex --apply-log --redo-only 2015-03-21_13-35-26 --incremental-dir=2015-03-21_13-38-29

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.

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

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

150321 13:40:52 innobackupex: Starting the apply-log operation

IMPORTANT: Please check that the apply-log run completes successfully.
           At the end of a successful apply-log run innobackupex
           prints "completed OK!".

150321 13:40:52 innobackupex: Starting ibbackup with command: xtrabackup --defaults-file="/home/nilnandan/backup/2015-03-21_13-35-26/backup-my.cnf" --defaults-group="mysqld" --prepare --target-dir=/home/nilnandan/backup/2015-03-21_13-35-26 --apply-log-only --incremental-dir=2015-03-21_13-38-29

xtrabackup version 2.2.9 based on MySQL server 5.6.22 Linux (x86_64) (revision id: )
incremental backup from 1687574 is enabled.
xtrabackup: cd to /home/nilnandan/backup/2015-03-21_13-35-26
xtrabackup: This target seems to be already prepared.
2015-03-21 13:40:52 7f19ebab6780 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
xtrabackup: Warning: cannot open 2015-03-21_13-38-29/xtrabackup_logfile. will try to find.
2015-03-21 13:40:52 7f19ebab6780 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
  xtrabackup: Fatal error: cannot find 2015-03-21_13-38-29/xtrabackup_logfile.
xtrabackup: Error: xtrabackup_init_temp_log() failed.
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 2642.
 main::apply_log() called at /usr/bin/innobackupex line 1570
innobackupex: Error:
innobackupex: ibbackup failed at /usr/bin/innobackupex line 2642.
root@desktop:/home/nilnandan/backup#

Changed in percona-xtrabackup:
status: New → Confirmed
Revision history for this message
Nickolay Ihalainen (ihanick) wrote :

There is a different error for the same problem (relative path in incremental-dir) for 2.2.10

innobackupex --apply-log . --incremental-dir=../2015-04-15_19-32-35

innobackupex: Copying '../2015-04-15_19-32-35/a/b.frm' to '/srv/backup-test/mbkp2/x/2015-04-15_19-29-39/a/b.frm'
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 2221
        main::copy_file('../2015-04-15_19-32-35/a/b.frm', '/srv/backup-test/mbkp2/x/2015-04-15_19-29-39/a/b...') called at /usr/bin/innobackupex line 2298
        main::process_file('CODE(0x22d7e58)') called at /usr/bin/innobackupex line 2308
        main::copy_file_callback() called at /usr/share/perl/5.14/File/Find.pm line 781
        File::Find::_find_dir('HASH(0x2788b08)', '../2015-04-15_19-32-35', 12) called at /usr/share/perl/5.14/File/Find.pm line 569
        File::Find::_find_opt('HASH(0x2788b08)', '../2015-04-15_19-32-35') called at /usr/share/perl/5.14/File/Find.pm line 1070
        File::Find::find('CODE(0x22e2610)', '../2015-04-15_19-32-35') called at /usr/bin/innobackupex line 2362
        main::copy_dir_recursively('../2015-04-15_19-32-35/', '/srv/backup-test/mbkp2/x/2015-04-15_19-29-39', '^(\.\.?|backup-my\.cnf|xtrabackup_logfile|xtrabackup_binary|x...', 1, 0) called at /usr/bin/innobackupex line 2668
        main::apply_log() called at /usr/bin/innobackupex line 1570

Revision history for this message
Jervin R (revin) wrote :

Still present on 2.2.13

Revision history for this message
sofire (sofire) wrote :

Still present on 2.3.2

innobackupex version 2.3.2 Linux (x86_64) (revision id: 306a2e0)
xtrabackup version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)

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.