Ask Your Question

Unable to sync nova-manage db using the command su -s /bin/sh -c "nova-manage db sync" nova

asked 2019-02-20 08:24:38 -0500

anonymous user


Getting the below error in the nova-api logs

2019-02-20 09:15:12.994 17515 WARNING oslo_db.sqlalchemy.engines [req-ae8002a5-32b9-42f2-9353-7610197d12a0 - - - - -] SQL connection failed. 10 attempts left.: DBConnectionError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'xx.xx..xx.xx' ([Errno 111] ECONNREFUSED)") ^C Session terminated, terminating shell...2019-02-20 09:15:16.016 17515 CRITICAL nova [req-ae8002a5-32b9-42f2-9353-7610197d12a0 - - - - -] Unhandled error: KeyboardInterrupt 2019-02-20 09:15:16.016 17515 ERROR nova Traceback (most recent call last): 2019-02-20 09:15:16.016 17515 ERROR nova File "/usr/bin/nova-manage", line 10, in <module> 2019-02-20 09:15:16.016 17515 ERROR nova sys.exit(main()) 2019-02-20 09:15:16.016 17515 ERROR nova File "/usr/lib/python2.7/dist-packages/nova/cmd/", line 1654, in main 2019-02-20 09:15:16.016 17515 ERROR nova ret = fn(fn_args, *fn_kwargs)

ABle to ping the mysql server from nova machine. ubuntu 18.04 and openstack-rocky port is good though Source the adminrc file and same issue. nova.conf is as below:

connection = mysql+pymysql://

where is my sql server on another machine .

/etc/hosts is good as well /etc/resolv.conf is good as well.

Any further inputs on this.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-02-20 10:33:16 -0500

Marco Schuster gravatar image

Install a mysql client on the nova machine and try connecting to your host from there. Odds are that there is a firewall rule either on mysql-host preventing ingress traffic or on nova-host preventing egress traffic.

The other thing: check with netstat -lnp where the mysqld is listening. You might have run into the issue that distributions set bind-address to, change it to for world-open listening or to the IP address of the management interface. If the mysql-host is connected directly to the Internet - install a firewall!

edit flag offensive delete link more


It worked well.. You saved my day . GREAT thanks

opensourceengineer gravatar imageopensourceengineer ( 2019-02-21 05:27:39 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2019-02-20 08:24:38 -0500

Seen: 440 times

Last updated: Feb 20 '19