No errors when creating keystone tables when MySQL fails

Bug #1314125 reported by Jaan Porkon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Expired
Undecided
Unassigned
openstack-manuals
Invalid
Undecided
Unassigned

Bug Description

By following documentation:

http://docs.openstack.org/icehouse/install-guide/install/yum/content/keystone-install.html

When MySQL controller is not changed in /etc/keystone/keystone.conf

Then when you are using "su -s /bin/sh -c "keystone-manage db_sync" keystone" command won't produce any errors.. errors appear only when you add an user for example:

keystone user-create --name=admin --pass=password --<email address hidden>
An unexpected error prevented the server from fulfilling your request. (HTTP 500)

In keystone.log file there will be:
CRITICAL keystone [-] OperationalError: (OperationalError) (2005, "Unknown MySQL server host 'controller' (1)") None None

If controller is changed in /etc/keystone/keystone.conf user must re-run following command:
su -s /bin/sh -c "keystone-manage db_sync" keystone

otherwise when they try to create an user they will receive the error above and error in keystone.log

TRACE keystone.common.wsgi ProgrammingError: (ProgrammingError) (1146, "Table 'keystone.domain' doesn't exist") 'SELECT domain.id AS domain_id, domain.name AS domain_name, domain.enabled AS domain_enabled, domain.extra AS domain_extra \nFROM domain \nWHERE domain.id = %s' ('default',)

Dolph Mathews (dolph)
tags: added: user-experience
Revision history for this message
Dolph Mathews (dolph) wrote :

There must be something else at play here, because you should be seeing the stderr you're expecting.

Running keystone-manage directly or with su -s (exactly as described in openstack-manuals) both produce a relevant error message for me. For example:

$ keystone-manage db_sync 2> stderr.log
$ cat stderr.log
2014-04-29 10:31:17.072 35866 CRITICAL keystone [-] OperationalError: (OperationalError) (2005, "Unknown MySQL server host 'controller' (0)") None None

Changed in keystone:
status: New → Incomplete
Revision history for this message
Jaan Porkon (jaantrill) wrote :
Tom Fifield (fifieldt)
Changed in keystone:
status: Incomplete → New
Revision history for this message
David Stanek (dstanek) wrote :

The fact that you don't get any output makes me wonder if your keystone client is actually pointing at a different keystone instance. Can you verify that your environment is setup properly?

Also I do think the instructions are incorrect. The database settings should go into the [sql] section and not the [database] section. I believe that:

  # openstack-config --set /etc/keystone/keystone.conf \
     database connection mysql://keystone:KEYSTONE_DBPASS@controller/keystone

should be:

  # openstack-config --set /etc/keystone/keystone.conf \
     sql connection mysql://keystone:KEYSTONE_DBPASS@controller/keystone

When I used the original command keystone-manage tries to login to the database using the default keystone:keystone and I get the follwoing error:

  # su -s /bin/sh -c "keystone-manage db_sync" keystone
  2014-05-29 23:07:37.828 3132 CRITICAL keystone [-] (OperationalError) (1045, "Access denied for user 'keystone'@'localhost' (using password:YES)") None None

Revision history for this message
Matt Kassawara (ionosphere80) wrote :

Since the rest of the installation guide depends on successful installation of keystone, a problem with the content would generate considerably more bug reports. Therefore, I think this issue involves something outside of the installation guide.

Changed in openstack-manuals:
status: New → Invalid
Changed in keystone:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Keystone because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
Revision history for this message
Hamdi Roumani (roumani) wrote :

I couple possibilities here, I've seen this error before (but you'll see it on every keystone-manage' invocation if this is the case):
Is 'controller' reachable (i.e. is this a valid host name, try to ping it), If you can't and its just your local host (you can change it to that) or:
sudo vim /etc/hosts
Add: 127.0.0.1 controller

Assuming you're running keystone locally, if not replace controller with the correct host name.
I think the install docs should call this out for clarity.

The next possible issue, the default conf, assuming you're installing from packages (i.e. not source) the [database] section has a sqllite connection that's a bit further down from the start (and it is NOT commented out), the docs don't call this out but you need to make sure you delete this (I believe newer versions have addressed this).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.