DELETE /tenants/admin - UnmappedInstanceError

Bug #956414 reported by Joe Gordon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
In Progress
Low
Dolph Mathews

Bug Description

Using Essex from source last updated March 14th:

2012-03-12 16:39:40 DEBUG [root] ******************** REQUEST ENVIRON ********************
2012-03-12 16:39:40 DEBUG [root] SCRIPT_NAME = /v2.0
2012-03-12 16:39:40 DEBUG [root] webob.adhoc_attrs = {'response': <Response at 0x3ab9dd0 200 OK>}
2012-03-12 16:39:40 DEBUG [root] REQUEST_METHOD = DELETE
2012-03-12 16:39:40 DEBUG [root] PATH_INFO = /tenants/admin
2012-03-12 16:39:40 DEBUG [root] SERVER_PROTOCOL = HTTP/1.0
2012-03-12 16:39:40 DEBUG [root] HTTP_X_AUTH_TOKEN = ADMIN
2012-03-12 16:39:40 DEBUG [root] HTTP_USER_AGENT = python-keystoneclient
2012-03-12 16:39:40 DEBUG [root] eventlet.posthooks = []
2012-03-12 16:39:40 DEBUG [root] SERVER_NAME = 192.168.240.19
2012-03-12 16:39:40 DEBUG [root] REMOTE_ADDR = 192.168.240.19
2012-03-12 16:39:40 DEBUG [root] eventlet.input = <eventlet.wsgi.Input object at 0x3e1e110>
2012-03-12 16:39:40 DEBUG [root] wsgi.url_scheme = http
2012-03-12 16:39:40 DEBUG [root] SERVER_PORT = 35357
2012-03-12 16:39:40 DEBUG [root] wsgi.input = <eventlet.wsgi.Input object at 0x3e1e110>
2012-03-12 16:39:40 DEBUG [root] HTTP_HOST = 192.168.240.19:35357
2012-03-12 16:39:40 DEBUG [root] wsgi.multithread = True
2012-03-12 16:39:40 DEBUG [root] wsgi.version = (1, 0)
2012-03-12 16:39:40 DEBUG [root] openstack.context = {'token_id': 'ADMIN', 'is_admin': True}
2012-03-12 16:39:40 DEBUG [root] GATEWAY_INTERFACE = CGI/1.1
2012-03-12 16:39:40 DEBUG [root] wsgi.run_once = False
2012-03-12 16:39:40 DEBUG [root] wsgi.errors = <open file '<stderr>', mode 'w' at 0x7fd09b629270>
2012-03-12 16:39:40 DEBUG [root] wsgi.multiprocess = False
2012-03-12 16:39:40 DEBUG [root] CONTENT_TYPE = text/plain
2012-03-12 16:39:40 DEBUG [root] HTTP_ACCEPT_ENCODING = gzip, deflate
2012-03-12 16:39:40 DEBUG [root]
2012-03-12 16:39:40 DEBUG [root] ******************** REQUEST BODY ********************
2012-03-12 16:39:40 DEBUG [root]
2012-03-12 16:39:40 DEBUG [routes.middleware] Matched DELETE /tenants/admin
2012-03-12 16:39:40 DEBUG [routes.middleware] Route path: '{path_info:.*}', defaults: {'controller': <keystone.contrib.admin_crud.core.CrudExtension object at 0x394c250>}
2012-03-12 16:39:40 DEBUG [routes.middleware] Match dict: {'controller': <keystone.contrib.admin_crud.core.CrudExtension object at 0x394c250>, 'path_info': '/tenants/admin'}
2012-03-12 16:39:40 DEBUG [routes.middleware] Matched DELETE /tenants/admin
2012-03-12 16:39:40 DEBUG [routes.middleware] Route path: '/tenants/{tenant_id}', defaults: {'action': u'delete_tenant', 'controller': <keystone.identity.core.TenantController object at 0x39449d0>}
2012-03-12 16:39:40 DEBUG [routes.middleware] Match dict: {'action': u'delete_tenant', 'tenant_id': u'admin', 'controller': <keystone.identity.core.TenantController object at 0x39449d0>}
2012-03-12 16:39:40 DEBUG [root] arg_dict: {'tenant_id': u'admin'}
2012-03-12 16:39:40 DEBUG [eventlet.wsgi.server] Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg/eventlet/wsgi.py", line 336, in handle_one_response
   result = self.application(self.environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/Paste-1.7.5.1-py2.7.egg/paste/urlmap.py", line 203, in __call__
   return app(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 147, in __call__
   resp = self.call_func(req, *args, **self.kwargs)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 208, in call_func
   return self.func(req, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/wsgi.py", line 284, in __call__
   response = request.get_response(self.application)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1053, in get_response
   application, catch_exc_info=False)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1022, in call_application
   app_iter = application(self.environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 147, in __call__
   resp = self.call_func(req, *args, **self.kwargs)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 208, in call_func
   return self.func(req, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/wsgi.py", line 284, in __call__
   response = request.get_response(self.application)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1053, in get_response
   application, catch_exc_info=False)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1022, in call_application
   app_iter = application(self.environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 147, in __call__
   resp = self.call_func(req, *args, **self.kwargs)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 208, in call_func
   return self.func(req, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/wsgi.py", line 284, in __call__
   response = request.get_response(self.application)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1053, in get_response
   application, catch_exc_info=False)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1022, in call_application
   app_iter = application(self.environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 147, in __call__
   resp = self.call_func(req, *args, **self.kwargs)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 208, in call_func
   return self.func(req, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/wsgi.py", line 284, in __call__
   response = request.get_response(self.application)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1053, in get_response
   application, catch_exc_info=False)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1022, in call_application
   app_iter = application(self.environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 147, in __call__
   resp = self.call_func(req, *args, **self.kwargs)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 208, in call_func
   return self.func(req, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/wsgi.py", line 307, in __call__
   resp = req.get_response(self.application)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1053, in get_response
   application, catch_exc_info=False)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/request.py", line 1022, in call_application
   app_iter = application(self.environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 159, in __call__
   return resp(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/Routes-1.12.3-py2.7.egg/routes/middleware.py", line 131, in __call__
   response = self.app(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 159, in __call__
   return resp(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 159, in __call__
   return resp(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/Routes-1.12.3-py2.7.egg/routes/middleware.py", line 131, in __call__
   response = self.app(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 159, in __call__
   return resp(environ, start_response)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 147, in __call__
   resp = self.call_func(req, *args, **self.kwargs)
 File "/usr/local/lib/python2.7/dist-packages/WebOb-1.0.8-py2.7.egg/webob/dec.py", line 208, in call_func
   return self.func(req, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/wsgi.py", line 181, in __call__
   result = method(context, **params)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/identity/core.py", line 314, in delete_tenant
   self.identity_api.delete_tenant(context, tenant_id)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/common/manager.py", line 48, in _wrapper
   return f(*args, **kw)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/identity/backends/sql.py", line 340, in delete_tenant
   session.delete(tenant_ref)
 File "/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.7.5-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py", line 1250, in delete
   raise exc.UnmappedInstanceError(instance)
UnmappedInstanceError: Class '__builtin__.NoneType' is not mapped

Revision history for this message
Joseph Heck (heckj) wrote :

Joe - need some clarification for repro:

did the "admin" tenant already exist when you made the request to remove it, or is this an instance of failure of removing a tenant that didn't already exist?

shouldn't give a traceback either way, but I'd like to know to categorize this issue appropriately. For the sake of completeness, could you also specify the command you used with the client to generate this?

Changed in keystone:
status: New → Incomplete
Revision history for this message
Joe Gordon (jogo) wrote :
Download full text (5.3 KiB)

THis stack trace was generated when trying to run the following command (which requires a ID not a name)

'keystone tenant-delete admin'

Stack trace has changed slightly:

2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] ******************** REQUEST ENVIRON ********************
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] SCRIPT_NAME = /v2.0
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] webob.adhoc_attrs = {'response': <Response at 0x40af590 200 OK>}
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] REQUEST_METHOD = DELETE
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] PATH_INFO = /tenants/foo
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] SERVER_PROTOCOL = HTTP/1.0
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] HTTP_X_AUTH_TOKEN = ADMIN
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] HTTP_USER_AGENT = python-keystoneclient
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] eventlet.posthooks = []
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] SERVER_NAME = 192.168.240.19
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] REMOTE_ADDR = 192.168.240.19
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] eventlet.input = <eventlet.wsgi.Input object at 0x3e37950>
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.url_scheme = http
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] SERVER_PORT = 35357
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.input = <eventlet.wsgi.Input object at 0x3e37950>
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] HTTP_HOST = 192.168.240.19:35357
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.multithread = True
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.version = (1, 0)
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] openstack.context = {'token_id': 'ADMIN', 'is_admin': True}
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] GATEWAY_INTERFACE = CGI/1.1
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.run_once = False
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.errors = <open file '<stderr>', mode 'w' at 0x7fef12133270>
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] wsgi.multiprocess = False
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] CONTENT_TYPE = text/plain
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] HTTP_ACCEPT_ENCODING = gzip, deflate
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi]
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi] ******************** REQUEST BODY ********************
2012-03-20 16:16:25    DEBUG [keystone.common.wsgi]
2012-03-20 16:16:25    DEBUG [routes.middleware] Matched DELETE /tenants/foo
2012-03-20 16:16:25    DEBUG [routes.middleware] Route path: '{path_info:.*}', defaults: {'controller': <keystone.contrib.admin_crud.core.CrudExtension object at 0x3ca90d0>}
2012-03-20 16:16:25    DEBUG [routes.middleware] Match dict: {'controller': <keystone.contrib.admin_crud.core.CrudExtension object at 0x3ca90d0>, 'path_info': '/tenants/foo'}
2012-03-20 16:16:25    DEBUG [routes.middleware] Matched DELETE /tenants/foo
2012-03-20 16:16:25    DEBUG [routes.middleware] Route path: '/tenants/{tenant_id}', defaults: {'action': u'delete_tenant', 'controller': <k...

Read more...

tags: added: essex-rc-potential
Changed in keystone:
status: Incomplete → New
Revision history for this message
Dolph Mathews (dolph) wrote :

Ran into this today. It applies to almost every *-delete command except for service-delete. Keystone should be returning 404 instead of 500 in this case.

Changed in keystone:
status: New → Confirmed
assignee: nobody → Dolph Mathews (dolph)
importance: Undecided → Low
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/5597

Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
Dolph Mathews (dolph) wrote :

Because this issue affects the majority of keystoneclient commands (not just this one), I'm rolling up this issue with similar ones into bug 963056

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.