0

Hy,

I'm using Ansible OpenStack for deploy OpenStack test environment

On playbook setup-openstack.yml task os_keystone : Check current state of Keystone DB fails because exit code 1 from /openstack/venvs/keystone-20.1.0.dev9/bin/keystone-manage db_sync --check command

TASK [os_keystone : Check current state of Keystone DB] ***************************************************************************************** fatal: [infra1_keystone_container-3fe165e4]: FAILED! => {"changed": true, "cmd": ["/openstack/venvs/keystone-20.1.0.dev9/bin/keystone-manage", "d b_sync", "--check"], "delta": "0:01:42.935686", "end": "2019-10-28 21:25:55.634598", "failed_when_result": true, "msg": "non-zero return code", " rc": 1, "start": "2019-10-28 21:24:12.698912", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

With debug=True and use_stderr=True in keystone.conf logs

root@infra1-keystone-container-3fe165e4:/etc/keystone# /openstack/venvs/keystone-20.1.0.dev9/bin/keystone-manage db_sync --check
2019-10-28 21:41:49.802 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 10 attempts left.: oslo_db.exception.DBConnectionError : (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:41:59.821 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 9 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:42:09.830 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 8 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:42:19.844 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 7 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query') 2019-10-28 21:42:29.859 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 6 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:42:39.870 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 5 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:42:49.884 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 4 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query') 2019-10-28 21:42:59.898 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 3 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:43:09.913 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 2 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:43:19.927 7461 WARNING oslo_db.sqlalchemy.engines [-] SQL connection failed. 1 attempts left.: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
2019-10-28 21:43:29.940 7461 CRITICAL keystone [-] Unhandled error: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2013, 'L ost connection to MySQL server during query')

Manually connect to database with credentials in keystone.conf from keystone lxc container works, but no table in keystone database

> root@infra1-keystone-container-3fe165e4:/etc/keystone# /openstack/venvs/keystone-20.1.0.dev9/bin/keystone-manage --version 16.0.1

CorTheZ
  • 63
  • 1
  • 5

2 Answers2

0

I had the same error during my deployment after having to re-run the setup-openstack playbook twice (because of an unrelated error).

I deployed my setup on baremetal (not containers) with mysqld + haproxy/keepalived. When I ran the playbook the 1st time, it appears keepalived/haproxy was stopped for some reason, meaning keystone couldn't access mysql when running the playbook for a 2nd time, causing the above error.

Try checking if your MySQL server is accessible from keystone's point of view. Hopefully this is helpful!

Justin417
  • 1
  • 1
0

For me also same issue happened .I restarted keepalived service and then were able to ping the lb ip and also ran playbook successfuly