innobackupex don't take the default datadir

Bug #936934 reported by Martin Arrieta on 2012-02-20
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Medium
Alexey Kopytov
2.1
Won't Fix
Undecided
Unassigned
2.2
Fix Released
Medium
Alexey Kopytov

Bug Description

If you don't have any "datadir" option on you mysqld section of your my.cnf, the server start fine and use /var/lib/mysql as a default but innobackupex don't

[root@repmaster ~]# innobackupex backups/

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

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

120220 09:58:49 innobackupex: Starting mysql with options: --unbuffered --
120220 09:58:49 innobackupex: Connected to database with mysql child process (pid=2448)
120220 09:58:55 innobackupex: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex
           prints "completed OK!".

innobackupex: Using mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1
innobackupex: Using mysql server version Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

xtrabackup: Error: Please set parameter 'datadir'
innobackupex: fatal error: no 'mysqld' group in MySQL options
innobackupex: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

[root@repmaster ~]# cat /etc/my.cnf | grep -v ^#

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
server-id = 1
log-bin=mysql-bin

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

[root@repmaster ~]# rpm -qa | grep xtra
xtrabackup-1.6.5-328.rhel6.x86_64

[root@repmaster ~]# cat /etc/issue
CentOS release 6.2 (Final)

[root@repmaster ~]# rpm -qa | grep -i percona
Percona-Server-server-55-5.5.20-rel24.1.217.rhel6.x86_64
Percona-Server-devel-55-5.5.20-rel24.1.217.rhel6.x86_64
percona-release-0.0-1.x86_64
Percona-Server-shared-55-5.5.20-rel24.1.217.rhel6.x86_64
Percona-Server-client-55-5.5.20-rel24.1.217.rhel6.x86_64

Related branches

Changed in percona-xtrabackup:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Valentine Gostev (longbow)
Cormac (cormac-mcgaughey) wrote :

Can you try using:

 innobackupex --ibbackup=xtrabackup backups/

I've found this and it's not picking the binary up correctly on Centos 6

Testing using:
env PERLDB_OPTS="NonStop=1 AutoTrace=1 frame=2" perl -dS /usr/bin/innobackupex --defaults-file=/etc/my.cnf /backup

This happens (several hundred lines snipped):
2174: if ($option_defaults_file) {
2175: $options = $options . " --defaults-file=\"$option_defaults_file\" ";
2178: $options = $options . "--print-param";
2183: $cmdline = "$option_ibbackup_binary $options";
2184: @lines = `$cmdline`;

It ended up execing:

--defaults-file="/etc/mysql/bluebox.cnf" --print-param

and threw this error.

The problem can be found in sub read_config_file where it's not correctly picking up the binary properly.

Alexey Kopytov (akopytov) wrote :

Cormac,

The problem you are observing looks unrelated to the original bug report. Though it seems similar to https://bugs.launchpad.net/percona-xtrabackup/+bug/910206.

Can you please make sure you are not running XtraBackup and Percona Server versions affected by that bug, and create a new one, if the problem persists with newer versions?

Stewart Smith (stewart) on 2012-06-15
tags: added: innobackupex
Changed in percona-xtrabackup:
assignee: Valentine Gostev (longbow) → nobody
status: Confirmed → Triaged
Alexey Kopytov (akopytov) wrote :

I'm not sure there's a reliable way to fix this. The server does have a default datadir value (which is a compile-time option, and for RPM builds is /var/lib/mysql), but XtraBackup does not. Defaulting to a specific location looks unreliable to me. I think XtraBackup should be explicit in this regard and not make any assumptions.

Changed in percona-xtrabackup:
status: Triaged → Won't Fix
Alexey Kopytov (akopytov) wrote :

This can be fixed by querying the datadir server variable from innobackupex. IIRC there are some cases when the default value of datadir is not reported correctly by the server, but that may have been fixed, as I'm unable to reproduce it now.

tags: added: i42483
Alexey Kopytov (akopytov) wrote :

This will be covered by https://blueprints.launchpad.net/percona-xtrabackup/+spec/read-server-options-with-show-variables. Keeping this bug as the BluePrint has wider in scope, and fixing this bug will be more like a side-effect.

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

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

Duplicates of this bug

Other bug subscribers