r/openstack • u/Sad_Cobbler2193 • Apr 23 '24
Problem with nova while su -s /bin/sh -c "nova-manage db sync" nova
su -s /bin/sh -c "nova-manage db sync" nova
ERROR: Could not access cell0.
Has the nova_api database been created?
Has the nova_cell0 database been created?
Has "nova-manage api_db sync" been run?
Has "nova-manage cell_v2 map_cell0" been run?
Is [api_database]/connection set in nova.conf?
Is the cell0 database connection URL correct?
Error: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL
server on 'sprl3@controller' ([Errno -2] Name or service not known)")
(Background on this error at: https://sqlalche.me/e/14/e3q8)
In /var/log/nova/nova-conductor.log
2024-04-23 10:10:29.933 294700 ERROR oslo_service.service FROM services
2024-04-23 10:10:29.933 294700 ERROR oslo_service.service WHERE
services.deleted = %(deleted_1)s AND services.host = %(host_1)s AND
services.`binary` = %(binary_1)s
2024-04-23 10:10:29.933 294700 ERROR oslo_service.service LIMIT
%(param_1)s]
2024-04-23 10:10:29.933 294700 ERROR oslo_service.service [parameters:
{'deleted_1': 0, 'host_1': 'sprl3', 'binary_1': 'nova-conductor',
'param_1': 1}]
2024-04-23 10:10:29.933 294700 ERROR oslo_service.service (Background on
this error at: https://sqlalche.me/e/14/f405)
2024-04-23 10:10:29.933 294700 ERROR oslo_service.service
In /var/log/mysql/error.log
2024-04-23 10:11:51 209374 [Warning] Aborted connection 209374 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:51 209378 [Warning] Aborted connection 209378 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:51 209379 [Warning] Aborted connection 209379 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209380 [Warning] Aborted connection 209380 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209383 [Warning] Aborted connection 209383 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209384 [Warning] Aborted connection 209384 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209381 [Warning] Aborted connection 209381 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209385 [Warning] Aborted connection 209385 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209382 [Warning] Aborted connection 209382 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
2024-04-23 10:11:52 209386 [Warning] Aborted connection 209386 to db:
'nova' user: 'nova' host: 'controller' (Got an error reading
communication packets)
1
u/redfoobar Apr 23 '24
The error suggests it tries to connect to a hostname called “controller” does that resolve to a host?
If so the next troubleshoot check would be if you connect to the specified database in the nova.conf with eg mysql commandline
1
u/nvez Apr 23 '24
your database connection points to controller which can’t be resolved.