Failed to install devstack because it can't connect to MySQL server

asked 2018-11-21 05:29:33 -0500

m391365 gravatar image

I want to install OpenStack in a clean Ubuntu 18.04.1 VM, but failed to do so. Steps to reproduce:

Ran ./stack.sh with https://docs.openstack.org/devstack/rocky/ (default configurations).

I got an error "/opt/stack/requirements/.venv/bin/pip’: No such file or directory". I fixed it by running virtualenv /opt/stack/requirements/.venv/ and reran ./stack.sh. It produced the following error:

[...]
2018-11-21 10:52:08.389 | Configuring and starting MySQL
+lib/databases/mysql:configure_database_mysql:64  is_ubuntu
+functions-common:is_ubuntu:467            [[ -z deb ]]
+functions-common:is_ubuntu:470            '[' deb = deb ']'
+lib/databases/mysql:configure_database_mysql:65  my_conf=/etc/mysql/my.cnf
+lib/databases/mysql:configure_database_mysql:79  is_fedora
+functions-common:is_fedora:440            [[ -z Ubuntu ]]
+functions-common:is_fedora:444            '[' Ubuntu = Fedora ']'
+functions-common:is_fedora:444            '[' Ubuntu = 'Red Hat' ']'
+functions-common:is_fedora:445            '[' Ubuntu = RedHatEnterpriseServer ']'
+functions-common:is_fedora:446            '[' Ubuntu = CentOS ']'
+functions-common:is_fedora:446            '[' Ubuntu = OracleServer ']'
+functions-common:is_fedora:447            '[' Ubuntu = Virtuozzo ']'
+lib/databases/mysql:configure_database_mysql:79  is_suse
+functions-common:is_suse:455              [[ -z Ubuntu ]]
+functions-common:is_suse:459              [[ Ubuntu =~ (openSUSE) ]]
+functions-common:is_suse:459              [[ Ubuntu == \S\U\S\E\ \L\I\N\U\X ]]
+lib/databases/mysql:configure_database_mysql:87  sudo mysqladmin -u root password secret
mysqladmin: connect to server at '127.0.0.1' failed
error: 'Can't connect to MySQL server on '127.0.0.1' (111)'
Check that mysqld is running on 127.0.0.1 and that the port is 3306.
You can check this by doing 'telnet 127.0.0.1 3306'
+lib/databases/mysql:configure_database_mysql:87  true
+lib/databases/mysql:configure_database_mysql:90  sudo mysql -uroot -psecret -h127.0.0.1 -e 'GRANT ALL PRIVILEGES ON *.* TO '\''root'\''@'\''%'\'' identified by '\''secret'\'';'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
+lib/databases/mysql:configure_database_mysql:1  exit_trap
+./stack.sh:exit_trap:515                  local r=1
++./stack.sh:exit_trap:516                  jobs -p
+./stack.sh:exit_trap:516                  jobs=
+./stack.sh:exit_trap:519                  [[ -n '' ]]
+./stack.sh:exit_trap:525                  '[' -f /tmp/tmp.QHn6q49fWm ']'
+./stack.sh:exit_trap:526                  rm /tmp/tmp.QHn6q49fWm
+./stack.sh:exit_trap:530                  kill_spinner
+./stack.sh:kill_spinner:425               '[' '!' -z '' ']'
+./stack.sh:exit_trap:532                  [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:533                  echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:535                  type -p generate-subunit
+./stack.sh:exit_trap:536                  generate-subunit 1542796073 1455 fail
+./stack.sh:exit_trap:538                  [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:541                  /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2018-11-21-105209.txt for details
+./stack.sh:exit_trap:550                  exit 1

It suggested me to run telnet 127.0.0.1 3306, the command returned an error.

$ telnet 127.0.0.1 3306
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

$ netstat -paln|grep :3306
tcp        1      0 127.0.0.1:51934         127.0.0.1:3306          CLOSE_WAIT  9105/placementuWSGI 
tcp        1      0 127.0.0.1:51936         127.0.0.1:3306          CLOSE_WAIT  9104/placementuWSGI 
tcp        1      0 127.0.0.1:51902         127.0 ...
(more)
edit retag flag offensive close merge delete

Comments

The error is caused by MySQL not running. Share the local.conf. Check the MySQL log and the stack.sh log.

Also see the NetworkManager comment at https://docs.openstack.org/devstack/l.... I can’t say if this is related to your problem, though.

Bernd Bausch gravatar imageBernd Bausch ( 2018-11-21 17:37:29 -0500 )edit