Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 909441

Summary: packstack fails to setup nova db
Product: Red Hat OpenStack Reporter: Jon Thomas <jthomas>
Component: openstack-packstackAssignee: Martin Magr <mmagr>
Status: CLOSED NOTABUG QA Contact: Nir Magnezi <nmagnezi>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.0 (Folsom)CC: aortega, derekh, mmagr, ykaul
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-14 21:17:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
packstack output, ifconfig, mysql users table none

Description Jon Thomas 2013-02-08 19:34:01 UTC
Not sure if this should be under packstack or nova-manage.

The machine has two nics

eth0 192.168.2.113
eth1 10.0.10.0

I get this when trying to install with packstack

err: /Stage[main]/Nova::Api/Exec[nova-db-sync]: Failed to call refresh: /usr/bin/nova-manage db sync returned 1 instead of one of [0] at /var/tmp/packstack/20130208-1342/modules/nova/manifests/api.pp:98

So that says nova-manage failed and according to mysql the nova db gets created but no tables get populated.

So then I try nova_manage by hand and see:

$/usr/bin/nova-manage db sync
Command failed, please check log for more info
2013-02-08 13:50:34 22890 CRITICAL nova [-] (OperationalError) (1045, "Access denied for user 'nova'@'192.168.2.113' (using password: YES)") None None

but then I pull and source the keystonerc info out of the keystone.pp and try
 
$/usr/bin/nova-manage db sync
Command failed, please check log for more info
2013-02-08 14:22:58 28071 CRITICAL nova [-] (OperationalError) (1045, "Access denied for user 'nova'@'192.168.2.113' (using password: YES)") None None

I'm not sure why it's using 192.168.2.113

but then I try 

[root@small ~(keystone_admin)]$openstack-db --init --service nova
Please enter the password for the 'root' MySQL user: 
Verified connectivity to MySQL.
Creating 'nova' database.
ERROR 1007 (HY000) at line 1: Can't create database 'nova'; database exists
Asking openstack-nova to sync the database.
ERROR 1045 (28000): Access denied for user 'nova'@'localhost' (using password: YES)
Final sanity check failed.
Please file a bug report on bugzilla.redhat.com against the openstack-nova package.

and this creates the tables in the db. Final sanity check fails because packstack already created the user with a different pw. So I don't think that matters here.

The problem seems to be either that 'nova'@'192.168.2.113' is getting denied or that somehow nova-manage as called in packstack wants to use setup the db on 192.168.2.113.

Comment 2 Jon Thomas 2013-02-08 19:35:19 UTC
Created attachment 695218 [details]
packstack output, ifconfig, mysql users table

Comment 3 Jon Thomas 2013-02-08 19:40:04 UTC
oh, the above should say that after the packstack run, the nova db gets created but no tables get created.

Comment 4 Jon Thomas 2013-02-08 19:43:38 UTC
# rpm -qa | grep openstack
openstack-nova-console-2012.2.2-9.el6ost.noarch
openstack-glance-2012.2.1-5.el6ost.noarch
openstack-quantum-metaplugin-2012.2.1-6.el6ost.noarch
openstack-swift-proxy-1.7.4-7.el6ost.noarch
python-django-openstack-auth-1.0.2-3.1.el6.noarch
openstack-swift-1.7.4-7.el6ost.noarch
openstack-nova-volume-2012.2.2-9.el6ost.noarch
openstack-glance-doc-2012.2.1-5.el6ost.noarch
openstack-quantum-linuxbridge-2012.2.1-6.el6ost.noarch
openstack-keystone-2012.2.1-2.el6ost.noarch
openstack-swift-plugin-swift3-1.0.0-0.20120711git.el6.noarch
openstack-quantum-2012.2.1-6.el6ost.noarch
openstack-nova-compute-2012.2.2-9.el6ost.noarch
openstack-nova-cert-2012.2.2-9.el6ost.noarch
openstack-cinder-doc-2012.2.1-7.el6ost.noarch
openstack-quantum-nec-2012.2.1-6.el6ost.noarch
openstack-quantum-ryu-2012.2.1-6.el6ost.noarch
openstack-swift-account-1.7.4-7.el6ost.noarch
openstack-swift-doc-1.7.4-7.el6ost.noarch
openstack-nova-common-2012.2.2-9.el6ost.noarch
openstack-nova-api-2012.2.2-9.el6ost.noarch
openstack-nova-objectstore-2012.2.2-9.el6ost.noarch
openstack-cinder-2012.2.1-7.el6ost.noarch
openstack-nova-doc-2012.2.2-9.el6ost.noarch
openstack-quantum-nicira-2012.2.1-6.el6ost.noarch
openstack-packstack-2012.2.2-0.8.dev346.el6ost.noarch
openstack-swift-container-1.7.4-7.el6ost.noarch
openstack-keystone-doc-2012.2.1-2.el6ost.noarch
openstack-utils-2012.2-6.el6.noarch
openstack-nova-scheduler-2012.2.2-9.el6ost.noarch
openstack-nova-novncproxy-0.4-2.el6.noarch
openstack-quantum-cisco-2012.2.1-6.el6ost.noarch
openstack-dashboard-2012.2.1-3.el6ost.noarch
openstack-nova-network-2012.2.2-9.el6ost.noarch
openstack-nova-2012.2.2-9.el6ost.noarch
openstack-quantum-openvswitch-2012.2.1-6.el6ost.noarch
openstack-swift-object-1.7.4-7.el6ost.noarch

Comment 5 Jon Thomas 2013-02-08 20:06:21 UTC
So apparently this command will work to create the tables after the packstack failure. 

runuser -s /bin/sh nova -c "nova-manage db sync"

Comment 6 Jon Thomas 2013-02-14 20:52:53 UTC
It looks like the problem here is that nova-manage is using a different config than /etc/nova/nova.conf.

$ nova-manage config list | grep mysql
sql_connection = mysql://nova:1f20be4bcf3946fd.2.113/nova


$ grep mysql /etc/nova/nova.conf
sql_connection=mysql://nova:nova_default_password.0.1/nova

Comment 7 Jon Thomas 2013-02-14 21:17:02 UTC
ok, this was fixed by rm /root/nova.conf

I had put an old nova.conf version there as a backup from a previous install. I can't find any documentation for this, but apparently nova-manage looks for this file and overrides /etc/nova/nova.conf.

You can see what it;s using by:

nova-manage config list | grep config_file