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

Cannot use host because it resolves to an IP address (127.0.1.1) that does not match a real network #343

Closed
jaimesouza opened this issue Oct 16, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@jaimesouza
Copy link

Hello, I am trying to deploy the mysql charm on vsphere, but I got the following error:

$ juju debug-log --include mysql/1

unit-mysql-1: 11:54:00 INFO juju.worker.uniter found queued "start" hook
unit-mysql-1: 11:54:01 INFO unit.mysql/1.juju-log Running legacy hooks/start.
unit-mysql-1: 11:54:01 INFO unit.mysql/1.juju-log Retrieving the total memory of the server
unit-mysql-1: 11:54:08 ERROR unit.mysql/1.juju-log Failed to configure instance: juju-39c062-4 with error b'Configuring local MySQL instance listening at port 3306 for use in an InnoDB cluster...\n\nThis instance reports its own address as \x1b[1mjuju-39c062-4:3306\x1b[0m\n\x1b[31mERROR: \x1b[0mCannot use host \'juju-39c062-4\' for instance \'juju-39c062-4:3306\' because it resolves to an IP address (127.0.1.1) that does not match a real network interface, thus it is not supported. Change your system settings and/or set the MySQL server \'report_host\' variable to a hostname that resolves to a supported IP address.\nTraceback (most recent call last):\n  File "<string>", line 1, in <module>\nRuntimeError: Dba.configure_instance: Invalid host/IP \'juju-39c062-4\' resolves to \'127.0.1.1\' which is not supported.\n\n'
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysql-1/charm/src/mysql_vm_helpers.py", line 605, in _run_mysqlsh_script
    return subprocess.check_output(
  File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['charmed-mysql.mysqlsh', '--no-wizard', '--python', '-f', '/var/snap/charmed-mysql/common/tmpsv4ddksd']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-mysql-1/charm/lib/charms/mysql/v0/mysql.py", line 1156, in configure_instance
    self._run_mysqlsh_script("\n".join(configure_instance_command))
  File "/var/lib/juju/agents/unit-mysql-1/charm/src/mysql_vm_helpers.py", line 609, in _run_mysqlsh_script
    raise MySQLClientError(e.stderr)
charms.mysql.v0.mysql.MySQLClientError: b'Configuring local MySQL instance listening at port 3306 for use in an InnoDB cluster...\n\nThis instance reports its own address as \x1b[1mjuju-39c062-4:3306\x1b[0m\n\x1b[31mERROR: \x1b[0mCannot use host \'juju-39c062-4\' for instance \'juju-39c062-4:3306\' because it resolves to an IP address (127.0.1.1) that does not match a real network interface, thus it is not supported. Change your system settings and/or set the MySQL server \'report_host\' variable to a hostname that resolves to a supported IP address.\nTraceback (most recent call last):\n  File "<string>", line 1, in <module>\nRuntimeError: Dba.configure_instance: Invalid host/IP \'juju-39c062-4\' resolves to \'127.0.1.1\' which is not supported.\n\n'

I have tried with the current edge and stable versions.

@jaimesouza jaimesouza added the bug Something isn't working label Oct 16, 2023
@github-actions
Copy link
Contributor

@paulomach
Copy link
Contributor

paulomach commented Oct 25, 2023

Hi @jaimesouza , does the environment still up.
If so (or if you can reproduce), it will be helpful to capture the mysql unit /etc/hosts file so we can confirm (or dismiss) a hypothesis.

@jaimesouza
Copy link
Author

jaimesouza commented Oct 25, 2023

Hi @paulomach! I assume your hypothesis is correct.

The issue is on /etc/hosts indeed:

127.0.1.1 juju-39c062-25 juju-39c062-25

I have tested pre-adding the machine, commenting that line on /etc/hosts, and deploying the charm after that and it worked.

Thank you for the insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants