Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to MySQL server. #393

Open
kloostermanw opened this issue May 16, 2023 · 0 comments
Open

Can't connect to MySQL server. #393

kloostermanw opened this issue May 16, 2023 · 0 comments
Labels

Comments

@kloostermanw
Copy link

  • TwinDB Backup version: 3.1.1
  • Operating System: Ubuntu 22.04
  • Mysql: 8.0.30
  • Percona-xtrabackup-80: 8.0.30

Description

When I run

twindb-backup --xtrabackup-binary=/usr/bin/xtrabackup --xbstream-binary=/usr/bin/xbstream backup hourly

I get the following error message:

ERROR: mysql_source.get_connection():541: Can't connect to MySQL server on 127.0.0.1
ERROR: mysql_source.get_connection():541: Can't connect to MySQL server on 127.0.0.1

But the backup is running fine.

What I Did

I investigated what was causing the message. So I update the log line in mysql_source on line 543 as following

except OperationalError as err:
LOG.error(
"Can't connect to MySQL server on %s",
self._connect_info.hostname,
)

LOG.error(
    "Can't connect to MySQL server on %s",
    str(err),
)

And this give me the following error message.

ERROR: mysql_source.get_connection():541: Can't connect to MySQL server on (1193, "Unknown system variable 'wsrep_on'")

I think for some reason the check in is_galera bubbles up as an error message.

def is_galera(self):
"""Check if local MySQL instance is a Galera cluster
:return: True if it's a Galera.
:rtype: bool
"""
try:
with self._cursor() as cursor:
cursor.execute("SELECT @@wsrep_on as wsrep_on")
row = cursor.fetchone()
return str(row["wsrep_on"]).lower() == "1" or str(row["wsrep_on"]).lower() == "on"
except (
pymysql.InternalError,
OperationalError,
MySQLSourceError,
) as err:
error_code = err.args[0]
error_message = err.args[1]
if error_code == 1193:
LOG.debug("Galera is not supported or not enabled")
return False
else:
LOG.error(error_message)
raise

@akuzminsky akuzminsky added the bug label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants