Re: [percona-group] Cannot start xtrabackup

1,520 views
Skip to first unread message

Justin Swanhart

unread,
Mar 15, 2013, 5:05:07 PM3/15/13
to percona-d...@googlegroups.com
SElinux?

Sent from my iPhone

On Mar 15, 2013, at 3:05 PM, Ty Smith <nuffs...@gmail.com> wrote:

Hope someone can help, I have been working on this for two days with no luck.
The OS user which runs the database is the same user I start Xtrabackup as. The OS user has complete ownership of the MySQL directory, the Xtrabackup directory and my backup destination directory. When I start Xtrabackup it fails with the error below. Any ideas. Thanks



InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009
Innobase Oyand Percona Ireland Ltd 2009-2012. All Rights Reserved.

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

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



130315 13:54:42 innobackupex: Starting ibbackup with command: /opt/percona/percona-xtrabackup-2.0.5/bin/xtrabackup_55 --defaults-file="/opt/mysql/mysqldb/db/db.cnf" --defaults-group="mysqld" --prepare --target-dir=/opt/mysql/database_backup

/opt/percona/percona-xtrabackup-2.0.5/bin/xtrabackup_55 version 2.0.5 for Percona Server 5.5.16 Linux (x86_64) (revision id: undefined)
xtrabackup: cd to /opt/mysql/database_backup
xtrabackup: Error: cannot open ./xtrabackup_checkpoints
xtrabackup: error: xtrabackup_read_metadata()
xtrabackup: This target seems not to have correct metadata...
130315 13:54:42 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 ./xtrabackup_logfile. will try to find.
130315 13:54:42 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 ./xtrabackup_logfile.
xtrabackup: Error: xtrabackup_init_temp_log() failed.
innobackupex: Error:
innobackupex: ibbackup failed at /opt/percona/percona-xtrabackup-2.0.5/bin/innobackupex line 381.

--
You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to percona-discuss...@googlegroups.com.
To post to this group, send email to percona-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ty Smith

unread,
Mar 15, 2013, 10:13:10 PM3/15/13
to Percona Discussion
Rhel 6

On Mar 15, 5:05 pm, Justin Swanhart <justin.swanh...@percona.com>
wrote:
> SElinux?
>
> Sent from my iPhone
>

Alexey Kopytov

unread,
Mar 16, 2013, 6:49:49 AM3/16/13
to percona-d...@googlegroups.com
Hi Ty,

On Fri, 15 Mar 2013 12:05:58 -0700 (PDT), Ty Smith wrote:
> Hope someone can help, I have been working on this for two days with no
> luck.
> The OS user which runs the database is the same user I start Xtrabackup as.
> The OS user has complete ownership of the MySQL directory, the Xtrabackup
> directory and my backup destination directory. When I start Xtrabackup it
> fails with the error below. Any ideas. Thanks
>

Are xtrabackup_checkpoints and xtrabackup_logfile indeed missing in
/opt/mysql/database_backup?

If there are no such files in that directory, the backup is incomplete.
If those files are there and have correct access rights, it must be
SELinux as pointed out by Justin.

Best regards,
Alexey.

Ty Smith

unread,
Mar 16, 2013, 9:41:21 AM3/16/13
to Percona Discussion
The system is running redhat 6
The log files are not there, when xtrabackup starts would it not
create the files as needed? I manually created the files and received
the following error using the following parameters.


innobackupex --user=root--password=password--defaults-file=/opt/mysql/
mysqldb/db/db.cnf /opt/mysql/database_backup --no-lock --apply-log --
ibbackup=xtrabackup_55



xtrabackup_55 version 2.0.5 for Percona Server 5.5.16 Linux (x86_64)
(revision id: undefined)
xtrabackup: cd to /opt/mysql/database_backup
xtrabackup: error: xtrabackup_read_metadata()
xtrabackup: This target seems not to have correct metadata...
InnoDB: Error: tried to read 2048 bytes at offset 0 0.
InnoDB: Was only able to read 0.
130316 9:32:22 InnoDB: Operating system error number 0 in a file
operation.
InnoDB: Error number 0 means 'Success'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File operation call: 'read'.
InnoDB: Cannot continue operation.

Justin Swanhart

unread,
Mar 16, 2013, 9:49:00 AM3/16/13
to percona-d...@googlegroups.com
Hi Ty,

SELinux is not a distribution, is is "security enhanced linux" which
is an extra security layer which ships enabled on RHEL 6. It uses
"labels" to identify which process can interact. I think it is likely
that you system is not labeled in such a way as to allow the
xtrabackup binary to read from the data directory, or it could be a
problem with labels in the destination. Since you are on RHEL 6 I'll
bet dollars to donuts it is SElinux.

https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/index.html

--Justin

Alexey Kopytov

unread,
Mar 16, 2013, 9:59:25 AM3/16/13
to percona-d...@googlegroups.com
Hi Ty,

On Sat, 16 Mar 2013 06:41:21 -0700 (PDT), Ty Smith wrote:
> The system is running redhat 6
> The log files are not there, when xtrabackup starts would it not
> create the files as needed? I manually created the files and received
> the following error using the following parameters.

The --apply-log step requires, among other things, a copy of the redo
log created on the backup step. In other words, it requires a directory
containing a previously and successfully created backup. What files does
/opt/mysql/database_backup contain?

Best regards,
Alexey.

Justin Swanhart

unread,
Mar 16, 2013, 11:43:34 AM3/16/13
to percona-d...@googlegroups.com
Hi,

There are some other possibilities:
If there are ib_logfile files in the directory, then you may be trying
to run the --apply-log phase against a backup on which the apply phase
has already been run, and, after that the xtrabackup_* files were
removed.

The above would also be the case if you are trying to run --apply-log
against a binary copy of the database and not an xtrabackup backup.

Otherwise:
If there are no xtrabackup_* files, and no ib_logfile files, then this
is an invalid backup.

If there are no ib_logfile files but some xtrabackup_* files, please
do "ls -lh" to show what files you have in the backup directory.

Finally, do you have the output from the original backup?

If possible, also examine the output of innobackupex. You will notice
an invocation of xtrabackup --prepare. Run that command under strace
and attach it to an email if you can.

--Justin

Ty Smith

unread,
Mar 16, 2013, 5:24:58 PM3/16/13
to Percona Discussion
Sorry I was thinking about a distro.  I double checked SElinux is not
enabled.

/etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled


[root@host]# getenforce
Disabled



On Mar 16, 9:49 am, Justin Swanhart <justin.swanh...@percona.com>
wrote:
> Hi Ty,
>
> SELinux is not a distribution, is is "security enhanced linux" which
> is an extra security layer which ships enabled on  RHEL 6.  It uses
> "labels" to identify which process can interact.  I think it is likely
> that you system is not labeled in such a way as to allow the
> xtrabackup binary to read from the data directory, or it could be a
> problem with labels in the destination.  Since you are on RHEL 6 I'll
> bet dollars to donuts it is SElinux.
>
> https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Lin...

Ty Smith

unread,
Mar 16, 2013, 6:39:25 PM3/16/13
to Percona Discussion
The suggestion to use strace solved the problem. It turns out
xtrabackup could not find the mysql binary, I added the mysql path to
the environment variables and successfully started a backup.

Thanks for the help. I will start a new thread if I have other
questions or issues.


On Mar 16, 11:43 am, Justin Swanhart <justin.swanh...@percona.com>
wrote:
Reply all
Reply to author
Forward
0 new messages