innobackupex still does not read defaults-file

Bug #359341 reported by Percona
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
High
Unassigned

Bug Description

It fails for me

innobackupex-1.5.1 --defaults-file=/etc/my.cnf.bak --apply-log /mnt/data/db/

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 apply-log run completes successfully.
           At the end of a successful apply-log run innobackup
           prints "innobackup completed OK!".

innobackupex:: Warning: Ignored unrecognized line 2 in options : 'Error: Please set parameter 'datadir'
'
innobackupex: fatal error: no 'mysqld' group in MySQL options

Tags: innobackupex
Revision history for this message
Percona (percona-team) wrote :

my /etc/my.cnf.bak is

[mysqld]
#debug
basedir=/usr
datadir=/mnt/data/db
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

max_allowed_packet=16M
table_cache=2048

default-character-set=utf8

max-connections=512
net_read_timeout=7200
net_write_timeout=7200

innodb_log_file_size=256M

and I do not have /etc/my.cnf file

Changed in percona-xtrabackup:
assignee: nobody → yasufumi-kinoshita
importance: Undecided → Medium
status: New → Confirmed
Changed in percona-xtrabackup:
status: Confirmed → Fix Committed
Changed in percona-xtrabackup:
status: Fix Committed → Fix Released
Revision history for this message
seattlegaucho (gnarvaja) wrote :

This bug is still present in version 1.0. Consider the following:

[quote]
./innobackupex-1.5.1 --defaults-file=/home/gnarvaja/sandboxes/rsandbox_5_1_40/master/my.sandbox.cnf ../test/
Version string '' contains invalid data; ignoring: '' at ./innobackupex-1.5.1 line 1610.

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 backup run completes successfully.
           At the end of a successful backup run innobackupex-1.5.1
           prints "completed OK!".

innobackupex-1.5.1: Using mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) using EditLine wrapper
innobackupex-1.5.1: Using mysql server version Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.

sh: xtrabackup: not found
innobackupex-1.5.1: fatal error: no 'mysqld' group in MySQL options
innobackupex-1.5.1: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options
[/quote]

... but ...

[quote]
my_print_defaults --defaults_file=/home/gnarvaja/sandboxes/rsandbox_5_1_40/master/my.sandbox.cnf mysqld | grep datadir
--datadir=/home/gnarvaja/sandboxes/rsandbox_5_1_40/master/data
[/quote]

Revision history for this message
tianma (tianma-1473) wrote :

yes ,This bug is still present in version 1.0

Changed in percona-xtrabackup:
status: Fix Released → In Progress
importance: Medium → High
assignee: Yasufumi Kinoshita (yasufumi-kinoshita) → Aleksandr Kuzminsky (akuzminsky)
Changed in percona-xtrabackup:
milestone: none → release-1.2
Revision history for this message
tianma (tianma-1473) wrote :

This bug is still present in version 1.0. Consider the following:

ddb@db-62:~/wangwei/tools/xtrabackup-1.2/bin$ ./innobackupex-1.5.1 --defaults-file=/home/ddb/wan
gwei/db-36-2/db-36-2.cnf --user=root --ibbackup=/home/ddb/wangwei/tools/xtrabackup-1.2/bin/xtr
abackup /mnt/ddb/2/db-36-2-bak

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 backup run completes successfully.
           At the end of a successful backup run innobackupex-1.5.1
           prints "completed OK!".

innobackupex-1.5.1: Using mysql Ver 14.12 Distrib 5.0.38, for pc-linux-gnu (x86_64) using readline 5.2
innobackupex-1.5.1: Using mysql server version Copyright (C) 2002 MySQL AB

innobackupex-1.5.1: fatal error: no 'mysqld' group in MySQL options
innobackupex-1.5.1: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

Revision history for this message
tianma (tianma-1473) wrote :

This bug is still present in version 1.2. Consider the following:

ddb@db-62:~/wangwei/tools/xtrabackup-1.2/bin$ ./innobackupex-1.5.1 --defaults-file=/home/ddb/wan
gwei/db-36-2/db-36-2.cnf --user=root --ibbackup=/home/ddb/wangwei/tools/xtrabackup-1.2/bin/xtr
abackup /mnt/ddb/2/db-36-2-bak
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 backup run completes successfully.
           At the end of a successful backup run innobackupex-1.5.1
           prints "completed OK!".
innobackupex-1.5.1: Using mysql Ver 14.12 Distrib 5.0.38, for pc-linux-gnu (x86_64) using readline 5.2
innobackupex-1.5.1: Using mysql server version Copyright (C) 2002 MySQL AB
innobackupex-1.5.1: fatal error: no 'mysqld' group in MySQL options
innobackupex-1.5.1: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

Changed in percona-xtrabackup:
milestone: 1.2 → 1.3.1
Revision history for this message
Holger Thiel (kirax) wrote :

Seems To be still present in 1.4:

101126 15:28:14 innobackupex-1.5.1: Connected to database with mysql child process (pid=8486)
101126 15:28:20 innobackupex-1.5.1: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex-1.5.1
           prints "completed OK!".

innobackupex-1.5.1: Using mysql Ver 14.14 Distrib 5.1.49, for unknown-linux-gnu (x86_64) using readline 5.1
innobackupex-1.5.1: Using mysql server version Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

innobackupex-1.5.1: fatal error: no 'mysqld' group in MySQL options
innobackupex-1.5.1: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

Revision history for this message
freesk8ing (freesk8ing) wrote :

Yet , I have this problem too in 1.4
OS: redhat 5.3
mysql: 4.1.22

shell> innobackupex-1.5.1 --tmpdir=/data/mysql_backup/temp --user=root --password=test --socket=/tmp/mysql.sock --defaults-file=/etc/my.cnf --slave-info --stream=tar /data/mysql_backup | gzip - > /data/mysql_backup/test.tar.gz

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.

101221 10:13:09 innobackupex-1.5.1: Starting mysql with options: --defaults-file="/etc/my.cnf" --password=test --user=root --socket=/tmp/mysql.sock --unbuffered --
101221 10:13:09 innobackupex-1.5.1: Connected to database with mysql child process (pid=8868)
101221 10:13:15 innobackupex-1.5.1: Connection to database server closed
IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackupex-1.5.1
           prints "completed OK!".

innobackupex-1.5.1: Using mysql Ver 14.7 Distrib 4.1.22, for pc-linux-gnu (i686) using readline 4.3
innobackupex-1.5.1: Using mysql server version Copyright (C) 2002 MySQL AB

Use of uninitialized value in concatenation (.) or string at /usr/local/xtrabackup/bin/innobackupex-1.5.1 line 2128.
sh: --: invalid option
Usage: sh [GNU long option] [option] ...
        sh [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --protected
        --rcfile
        --rpm-requires
        --restricted
        --verbose
        --version
        --wordexp
Shell options:
        -irsD or -c command or -O shopt_option (invocation only)
        -abefhkmnptuvxBCHP or -o option
innobackupex-1.5.1: fatal error: no 'mysqld' group in MySQL options
innobackupex-1.5.1: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

Changed in percona-xtrabackup:
assignee: Aleksandr Kuzminsky (akuzminsky) → Alexey Kopytov (akopytov)
milestone: 1.3.1 → 1.6
tags: added: innobackupex
Revision history for this message
Valentine Gostev (longbow) wrote :

works for me,
all tests from test/ which use innobackupex with --defaults-file option and work fine (read datadir option correctly)

If you still experience issues with --defaults-file option please let us know the exact MySQL/Percona Server version, xtrabackup's version and if possible attach your cnf file.

Changed in percona-xtrabackup:
milestone: 1.6 → 1.5
assignee: Alexey Kopytov (akopytov) → nobody
status: In Progress → Fix Released
Changed in percona-xtrabackup:
status: Fix Released → Triaged
status: Triaged → Fix Released
Revision history for this message
Sachin Kale (sachin-zmanda) wrote :

Faced this error while attempting backup-

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

Segmentation fault
innobackupex: fatal error: no 'mysqld' group in MySQL options
innobackupex: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

----------------------------
The defaults file content was -

[mysqld]
datadir=/var/lib/mysql/
innodb_data_file_path=ibdata1:10M:autoextend
innodb_log_files_in_group=2
innodb_log_file_size=5242880

------
xtrabackup verson -

root@ubuntu-client:~# dpkg -l "*xtrabackup*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=================================-=================================-==================================================================================
ii xtrabackup 1.6-245.lenny Open source backup tool for InnoDB and XtraDB
----------------------------

While directly running xtrabackup_55 gives segmentation fault, but running xtrabackup_51 completes the backup.

Percona server version is 5.5.11-rel20.2-115.lenny

mysql - Server version: 5.5.11-55 Percona Server (GPL), Release 20.2

linux - distrubution details
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS"

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

Please let me know if there is any workaround to make backup successful.

Revision history for this message
Valentine Gostev (longbow) wrote :

Sachin,

where is your my.cnf located on file system?
What was the particular command you tried to run backup?

Revision history for this message
Sachin Kale (sachin-zmanda) wrote :

We provide defaults file as my.cnf
We use following command for backup -

/usr/bin/innobackupex --no-timestamp --defaults-file=/tmp/jE146DIESd --user=mysql --password="*****" --port=3306 --socket=/var/run/mysqld/mysqld.sock /tmp/bkdir

root@ubuntu:~# cat /tmp/jE146DIESd
[mysqld]
datadir=/var/lib/mysql/
innodb_data_file_path=ibdata1:10M:autoextend
innodb_log_files_in_group=2
innodb_log_file_size=5242880

root@ubuntu:~# /usr/bin/innobackupex --version
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2011. All Rights Reserved.

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

Revision history for this message
Sachin Kale (sachin-zmanda) wrote :

Using the command mentioned in above comment - if we use /etc/mysql/my.cnf instead of the defaults file, the command is successful and backup happens.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Sachin,

Thank you for your bug report. The crash issue you are facing has been reported as a separate bug #782447.

Revision history for this message
mariadb_user (adeliciouspizza) wrote :

I had this problem using Maria DB 5.2.7 on Ubuntu Server 10.0.4 LTS. I was able to fix the problem by changing "[server]" to "[mysqld]" in /etc/mysql/my.cnf. I am going to file a bug report with Maria DB and ask them to change that.

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-258

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.