incorrect ImportError message raised

Bug #1753584 reported by Mark Hamzy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Undecided
Mark Hamzy

Bug Description

Logs show:

2018-03-05 20:50:01.665 35 WARNING stevedore.named [-] Could not load uuid
2018-03-05 20:50:01.666 35 CRITICAL keystone [-] Unhandled error: ImportError: (u'Unable to find %(name)r driver in %(namespace)r.',
 {'namespace': 'keystone.token.provider', 'name': 'uuid'})
2018-03-05 20:50:01.666 35 ERROR keystone Traceback (most recent call last):
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/bin/keystone-manage", line 10, in <module>
2018-03-05 20:50:01.666 35 ERROR keystone sys.exit(main())
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/cmd/manage.py", line 45,
in main
2018-03-05 20:50:01.666 35 ERROR keystone cli.main(argv=sys.argv, config_files=config_files)
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/cmd/cli.py", line 1349, i
n main
2018-03-05 20:50:01.666 35 ERROR keystone CONF.command.cmd_class.main()
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/cmd/cli.py", line 397, in
 main
2018-03-05 20:50:01.666 35 ERROR keystone klass = cls()
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/cmd/cli.py", line 66, in
__init__
2018-03-05 20:50:01.666 35 ERROR keystone self.load_backends()
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/cmd/cli.py", line 129, in
 load_backends
2018-03-05 20:50:01.666 35 ERROR keystone drivers = backends.load_backends()
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/server/backends.py", line
 53, in load_backends
2018-03-05 20:50:01.666 35 ERROR keystone drivers = {d._provides_api: d() for d in managers}
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/server/backends.py", line
 53, in <dictcomp>
2018-03-05 20:50:01.666 35 ERROR keystone drivers = {d._provides_api: d() for d in managers}
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/token/provider.py", line
65, in __init__
2018-03-05 20:50:01.666 35 ERROR keystone super(Manager, self).__init__(CONF.token.provider)
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/common/manager.py", line
181, in __init__
2018-03-05 20:50:01.666 35 ERROR keystone self.driver = load_driver(self.driver_namespace, driver_name)
2018-03-05 20:50:01.666 35 ERROR keystone File "/var/lib/kolla/venv/lib/python2.7/site-packages/keystone/common/manager.py", line
81, in load_driver
2018-03-05 20:50:01.666 35 ERROR keystone raise ImportError(msg, {'name': driver_name, 'namespace': namespace})
2018-03-05 20:50:01.666 35 ERROR keystone ImportError: (u'Unable to find %(name)r driver in %(namespace)r.', {'namespace': 'keystone
.token.provider', 'name': 'uuid'})
2018-03-05 20:50:01.666 35 ERROR keystone

which is misleading. The correct error should be:

2018-03-05 20:50:25.517 47 ERROR keystone ImportError: Unable to find 'uuid' driver in 'keystone.token.provider'.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/549870

Changed in keystone:
assignee: nobody → Mark Hamzy (mark-hamzy)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/549870
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=852bd45c94df4a5c5ccb1e42077ec4f2d1a57272
Submitter: Zuul
Branch: master

commit 852bd45c94df4a5c5ccb1e42077ec4f2d1a57272
Author: Mark Hamzy <email address hidden>
Date: Mon Mar 5 15:18:31 2018 -0600

    Fix formatting of ImportError

    Fix formatting of ImportError when using a driver not found in the list
    of token providers.

    Change-Id: I0ac8ac199aeebd20960ad0654461f1f81c4d7da0
    Closes-bug: 1753584

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 14.0.0.0b1

This issue was fixed in the openstack/keystone 14.0.0.0b1 development milestone.

Changed in keystone:
milestone: none → rocky-1
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.