keystone-manage: error: argument command: invalid choice: 'db' from postinst

Bug #930444 reported by Kevin Jackson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
keystone (Ubuntu)
Fix Released
Critical
Martin Pool

Bug Description

Precise A2 updated at time of this bug.

Just done an install of OpenStack and Keystone now has changed to an interactive session (breaking all previous unattended installs) due to introduction of dbconfig. The install fails due to what looks like a syntax error creating entries in the database.

Replacing config file /etc/dbconfig-common/keystone.conf with new version
granting access to database keystone for keystone@localhost: success.
verifying access for keystone@localhost: success.
creating database keystone: success.
verifying database keystone exists: success.
dbconfig-common: flushing administrative password
usage: keystone-manage [-h]

                       {create_credential,create_endpoint_template,create_role,create_service,create_tenant,create_token,create_user,delete_credential,delete_endpoint_template,delete_role,delete_service,delete_tenant,delete_token,delete_user,downgrade_database,goto_database,grant_role,list_credentials,list_endpoint_templates,list_endpoints,list_roles,list_services,list_tenants,list_tokens,list_users,map_endpoint,revoke_role,sync_database,unmap_endpoint,update_credential,update_endpoint_template,update_role,update_service,update_tenant,update_token,update_user,upgrade_database,version,version_control_database}
                       ...
keystone-manage: error: argument command: invalid choice: 'db' (choose from 'create_credential', 'create_endpoint_template', 'create_role', 'create_service', 'create_tenant', 'create_token', 'create_user', 'delete_credential', 'delete_endpoint_template', 'delete_role', 'delete_service', 'delete_tenant', 'delete_token', 'delete_user', 'downgrade_database', 'goto_database', 'grant_role', 'list_credentials', 'list_endpoint_templates', 'list_endpoints', 'list_roles', 'list_services', 'list_tenants', 'list_tokens', 'list_users', 'map_endpoint', 'revoke_role', 'sync_database', 'unmap_endpoint', 'update_credential', 'update_endpoint_template', 'update_role', 'update_service', 'update_tenant', 'update_token', 'update_user', 'upgrade_database', 'version', 'version_control_database')
dpkg: error processing keystone (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 keystone
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@openstack2:/etc/dbconfig-common# dpkg -l | grep keystone
iF keystone 2012.1~e4~20120203.1574-0ubuntu2 Proposed OpenStack identity service - Daemons
ii python-keystone 2012.1~e4~20120203.1574-0ubuntu2 Proposed OpenStack identity service - Python library

Also:
1) Is this auto create necessary / can it be optional?
2) What does it create so I know what can be catered for with an unattended install?

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in keystone (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

I just hit this too when installing on to a fresh current precise image.

I think there are really two bugs here:

1- interactive configuration, which seems contrary to the normal Ubuntu practice or policy

2- the error from keystone-manage during installation

Revision history for this message
Martin Pool (mbp) wrote :

this is coming from keystone.postinst:

        if [ "$dbc_install" = "true" ]
        then
            # On first install, create basics configuration and add roles
            if [ -z "$2" ]
            then
                sed -e "s,_DBC_URL_,$SQL_CONNECTION," -i /etc/keystone/keystone.conf

                keystone-manage database sync
                keystone-manage role add Admin
                keystone-manage role add Member
                keystone-manage role add KeystoneAdmin
                keystone-manage role add KeystoneServiceAdmin
                keystone-manage role add sysadmin
                keystone-manage role add netadmin
            fi

            if [ "$dbc_upgrade" = "true" ]
            then
                su -s /bin/sh -c 'exec keystone-manage db sync' keystone
            fi
        fi

It looks like this needs to be `keystone-manage sync_database` instead.

Martin Pool (mbp)
summary: - Keystone Ubuntu Precise dbconfig install broken - show stopper
+ keystone-manage: error: argument command: invalid choice: 'db' from
+ postinst
Changed in keystone (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Martin Pool (mbp) wrote :

There is a commit message in <http://bazaar.launchpad.net/~openstack-ubuntu-packagers/keystone/ubuntu/revision/29> suggesting this has been removed, but it doesn't seem to have actually been removed...

Changed in keystone (Ubuntu):
assignee: nobody → Martin Pool (mbp)
Martin Pool (mbp)
Changed in keystone (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Martin Pool (mbp) wrote :

I split out https://bugs.launchpad.net/ubuntu/+source/keystone/+bug/931236 for the issue of perhaps-unnecessary interactive configuration.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package keystone - 2012.1~e4~20120203.1574-0ubuntu3

---------------
keystone (2012.1~e4~20120203.1574-0ubuntu3) precise; urgency=low

  * Update "db sync" to "sync_database" in postinst. (LP: #930444)
 -- Martin Pool <email address hidden> Thu, 16 Feb 2012 00:24:34 +0200

Changed in keystone (Ubuntu):
status: In Progress → Fix Released
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.