charts icon indicating copy to clipboard operation
charts copied to clipboard

[incubator/mysqlha] cannot open ./xtrabackup_checkpoints and cannot find ./xtrabackup_logfile

Open cpanato opened this issue 8 years ago • 21 comments

Is this a request for help?: yes


Is this a BUG REPORT (choose one): When start the helm chart I got this error in the second instance of the mysql

Logs from clone-mysql in mm-helm-mysqlha-1:

++ hostname
+ [[ mm-helm-mysqlha-1 =~ -([0-9]+)$ ]]
+ ordinal=1
+ [[ 1 -eq 0 ]]
+ [[ -d /var/lib/mysql/mysql ]]
+ xbstream -x -C /var/lib/mysql
+ ncat --recv-only mm-helm-mysqlha-0.mm-helm-mysqlha 3307
+ xtrabackup --prepare --user=repl --password=kEjVcXXofVA7 --target-dir=/var/lib/mysql
xtrabackup version 2.4.4 based on MySQL server 5.7.13 Linux (x86_64) (revision id: df58cf2)
xtrabackup: cd to /var/lib/mysql
xtrabackup: Error: cannot open ./xtrabackup_checkpoints
xtrabackup: error: xtrabackup_read_metadata()
xtrabackup: This target seems not to have correct metadata...
InnoDB: Number of pools: 1
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.
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.

Version of Helm and Kubernetes: helm: v2.9.0 k8s: v1.9.6

Which chart: incubator/mysqlha version 0.2.1

What you expected to happen: the pod start successfully

How to reproduce it (as minimally and precisely as possible): it is hard, sometimes works sometimes not

thanks!

cpanato avatar May 31 '18 14:05 cpanato

Same problem! Have u resolved it?

chrisxu555 avatar Jun 14 '18 05:06 chrisxu555

no. I tried to remove the installation, perform some cleanup and install it again

cpanato avatar Jun 25 '18 13:06 cpanato

I think I know why.

I was checking the pods and looks like when this happens the create-replication-user.sql is empty for some reason.

I saw some errors to connect and then I was checking the scripts and this file was empty, then I apply the same steps to generate the file and apply on mysql, after that the replica was able to connect.

I will check if can improve the init container to avoid this error.

cpanato avatar Jun 26 '18 12:06 cpanato

this is thextrabackups logs when the issue happen

I dont know if the order of the commands are generated randomly but the file is empty

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
+ sleep 1
+ mysql -h 127.0.0.1 -e 'SELECT 1'
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
+ sleep 1
+ mysql -h 127.0.0.1 -e 'SELECT 1'
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
+ sleep 1
+ mysql -h 127.0.0.1 -e 'SELECT 1'
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
+ sleep 1
+ mysql -h 127.0.0.1 -e 'SELECT 1'
1
1
+ cd /mnt/scripts
+ [[ -f create-replication-user.sql ]]
+ cp create-replication-user.sql create-replication-user.orig.sql
+ tee create-replication-user.sql
+ sed s/@@REPLICATION_PASSWORD@@/HGYaZNsg35v6/g
+ cat create-replication-user.sql
+ sed s/@@REPLICATION_USER@@/repl/g
+ mysql -h 127.0.0.1 --verbose
+ cd /var/lib/mysql
+ [[ -f xtrabackup_slave_info ]]
+ [[ -f xtrabackup_binlog_info ]]
+ [[ -f change_master_to.sql.in ]]
+ exec ncat --listen --keep-open --send-only --max-conns=1 3307 -c 'xtrabackup --backup --slave-info --stream=xbstream --host=127.0.0.1 --user=repl --password=HGYaZNsg35v6'
180626 16:38:06  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=127.0.0.1;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock' as 'repl'  (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;host=127.0.0.1;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock','repl',...) failed: Access denied for user 'repl'@'127.0.0.1' (using password: YES) at - line 1314.
180626 16:38:06 Connecting to MySQL server host: 127.0.0.1, user: repl, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Failed to connect to MySQL server: Access denied for user 'repl'@'127.0.0.1' (using password: YES).
180626 16:38:33  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=127.0.0.1;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock' as 'repl'  (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;host=127.0.0.1;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock','repl',...) failed: Access denied for user 'repl'@'127.0.0.1' (using password: YES) at - line 1314.
180626 16:38:33 Connecting to MySQL server host: 127.0.0.1, user: repl, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Failed to connect to MySQL server: Access denied for user 'repl'@'127.0.0.1' (using password: YES).
180626 16:39:22  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=127.0.0.1;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock' as 'repl'  (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;host=127.0.0.1;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock','repl',...) failed: Access denied for user 'repl'@'127.0.0.1' (using password: YES) at - line 1314.
180626 16:39:22 Connecting to MySQL server host: 127.0.0.1, user: repl, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Failed to connect to MySQL server: Access denied for user 'repl'@'127.0.0.1' (using password: YES).

cpanato avatar Jun 26 '18 16:06 cpanato

The old data of mysql which still exists in the old PV causes that problem(mysql can't be connected.). It succeeds when I delete the PVCs and install it again.

chrisxu555 avatar Jun 27 '18 12:06 chrisxu555

I reproduce the error several times, with a fresh install and reinstall. I have a fix for that, will submit when I finish my tests and it is fixed :)

cpanato avatar Jun 27 '18 12:06 cpanato

@cpanato I have the same problem Can you show me how did you fix this?

iming0319 avatar Jul 23 '18 03:07 iming0319

@iming0319 one quick fix is delete the mysqha-1 pod and then the mysqlha-2 and most of the times it will fix.

another approach is to follow the PR I've opened.

cpanato avatar Aug 08 '18 16:08 cpanato

I am also facing the same issue here. I got following error log + xtrabackup --prepare --user=repl --password=o5OQIXOvQVLJ --target-dir=/var/lib/mysql xtrabackup version 2.4.4 based on MySQL server 5.7.13 Linux (x86_64) (revision id: df58cf2) xtrabackup: cd to /var/lib/mysql xtrabackup: Error: cannot open ./xtrabackup_checkpoints xtrabackup: error: xtrabackup_read_metadata() xtrabackup: This target seems not to have correct metadata... InnoDB: Number of pools: 1 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. 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.

@cpanato I tried your version too. It didn't worked for me.

rtamizh avatar Aug 20 '18 15:08 rtamizh

but this is another error looks like @rtamizh

cpanato avatar Sep 07 '18 19:09 cpanato

@rtamizh have u fixed the issue?

howudoing avatar Nov 28 '18 09:11 howudoing

Hello I am experiencing the same issue

sconrod-tester avatar Jan 17 '20 04:01 sconrod-tester

@cpanato @rtamizh @sconrod-tester Have anyone of you fixed the issue? I am having the exact same problem.

suresh-thatikonda avatar Apr 03 '20 12:04 suresh-thatikonda

@sureshoao not using this anymore :/

cpanato avatar Apr 03 '20 12:04 cpanato

same problem

root@09ed3a942448:~# innobackupex --host=mysql --user=root--password=pass--apply-log ../var/www/backups
200409 12:06:56 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!".

innobackupex version 2.4.9 based on MySQL server 5.7.13 Linux (x86_64) (revision id: a467167cdd4)
xtrabackup: cd to /var/www/backups/
xtrabackup: Error: cannot open ./xtrabackup_checkpoints
xtrabackup: Error: failed to read metadata from './xtrabackup_checkpoints'

ivanmem avatar Apr 09 '20 12:04 ivanmem

I found that because of mysqld listening on the 127.0.0.1 interface that make xtrabackup can't init at start-up pod. So, I tried add bind-address config to values.yml as below:

  configFiles:
    master.cnf: |
      [mysqld]
      log-bin
      skip_name_resolve
      bind-address=0.0.0.0
    slave.cnf: |
      [mysqld]
      super-read-only
      skip_name_resolve
      bind-address=0.0.0.0

now, it's working !

quangnb2 avatar Sep 27 '20 18:09 quangnb2

Trying to install the chart with mysql version 8.0. So I have modified the values.yaml. mysqlImage: mysql:8.0

Then I got the below error: ++ hostname

  • [[ test-mysqlha-1 =~ -([0-9]+)$ ]]
  • ordinal=1
  • [[ 1 -eq 0 ]]
  • [[ -d /var/lib/mysql/mysql ]]
  • xbstream -x -C /var/lib/mysql
  • ncat --recv-only test-mysqlha-0.test-mysqlha 3307 Ncat: Connection refused.
  • xtrabackup --prepare --user=repl --password=tSQ8BLh5rcHq --target-dir=/var/lib/mysql xtrabackup version 2.4.4 based on MySQL server 5.7.13 Linux (x86_64) (revision id: df58cf2) xtrabackup: cd to /var/lib/mysql xtrabackup: Error: cannot open ./xtrabackup_checkpoints xtrabackup: error: xtrabackup_read_metadata() xtrabackup: This target seems not to have correct metadata... InnoDB: Number of pools: 1 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. 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.

Then I changed the xtraBackupImage as well with below value. xtraBackupImage: percona/percona-xtradb-cluster:8.0.

Now I am getting the error: ++ hostname

  • [[ mysqlha-1 =~ -([0-9]+)$ ]]
  • ordinal=1
  • [[ 1 -eq 0 ]]
  • [[ -d /var/lib/mysql/mysql ]]
  • ncat --recv-only mysqlha-0.mysqlha 3307
  • xbstream -x -C /var/lib/mysql bash: line 10: ncat: command not found bash: line 10: xbstream: command not found

2nd pod is not starting. Need help to install the chart with mysql latest version.

shekarchandra avatar Sep 30 '20 12:09 shekarchandra

How is this issue closed without resolution i hit the same thing as @sheka

Trying to install the chart with mysql version 8.0. So I have modified the values.yaml. mysqlImage: mysql:8.0

Then I got the below error: ++ hostname

  • [[ test-mysqlha-1 =~ -([0-9]+)$ ]]
  • ordinal=1
  • [[ 1 -eq 0 ]]
  • [[ -d /var/lib/mysql/mysql ]]
  • xbstream -x -C /var/lib/mysql
  • ncat --recv-only test-mysqlha-0.test-mysqlha 3307 Ncat: Connection refused.
  • xtrabackup --prepare --user=repl --password=tSQ8BLh5rcHq --target-dir=/var/lib/mysql xtrabackup version 2.4.4 based on MySQL server 5.7.13 Linux (x86_64) (revision id: df58cf2) xtrabackup: cd to /var/lib/mysql xtrabackup: Error: cannot open ./xtrabackup_checkpoints xtrabackup: error: xtrabackup_read_metadata() xtrabackup: This target seems not to have correct metadata... InnoDB: Number of pools: 1 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. 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.

Then I changed the xtraBackupImage as well with below value. xtraBackupImage: percona/percona-xtradb-cluster:8.0.

Now I am getting the error: ++ hostname

  • [[ mysqlha-1 =~ -([0-9]+)$ ]]
  • ordinal=1
  • [[ 1 -eq 0 ]]
  • [[ -d /var/lib/mysql/mysql ]]
  • ncat --recv-only mysqlha-0.mysqlha 3307
  • xbstream -x -C /var/lib/mysql bash: line 10: ncat: command not found bash: line 10: xbstream: command not found

2nd pod is not starting. Need help to install the chart with mysql latest version.

anupash147 avatar Sep 30 '20 16:09 anupash147

Had the same issue resolved it. Please check and verify the hostname, it clearly says that Connection refused.

anandsiddharth avatar Dec 03 '20 16:12 anandsiddharth

the issue still exists...

xiongleio avatar Sep 17 '21 09:09 xiongleio