PUT /users/ADMIN/OS-KSADM/password - AttributeError

Bug #956417 reported by Joe Gordon
6
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 13th:

2012-03-13 14:37:38 DEBUG [root] ******************** REQUEST ENVIRON ********************
2012-03-13 14:37:38 DEBUG [root] SCRIPT_NAME = /v2.0
2012-03-13 14:37:38 DEBUG [root] webob.adhoc_attrs = {'response': <Response at 0x3784bd0 200 OK>}
2012-03-13 14:37:38 DEBUG [root] REQUEST_METHOD = PUT
2012-03-13 14:37:38 DEBUG [root] PATH_INFO = /users/ADMIN/OS-KSADM/password
2012-03-13 14:37:38 DEBUG [root] SERVER_PROTOCOL = HTTP/1.0
2012-03-13 14:37:38 DEBUG [root] CONTENT_LENGTH = 41
2012-03-13 14:37:38 DEBUG [root] HTTP_X_AUTH_TOKEN = ADMIN
2012-03-13 14:37:38 DEBUG [root] HTTP_USER_AGENT = python-keystoneclient
2012-03-13 14:37:38 DEBUG [root] eventlet.posthooks = []
2012-03-13 14:37:38 DEBUG [root] SERVER_NAME = 192.168.240.19
2012-03-13 14:37:38 DEBUG [root] REMOTE_ADDR = 192.168.240.19
2012-03-13 14:37:38 DEBUG [root] eventlet.input = <eventlet.wsgi.Input object at 0x3784690>
2012-03-13 14:37:38 DEBUG [root] wsgi.url_scheme = http
2012-03-13 14:37:38 DEBUG [root] SERVER_PORT = 35357
2012-03-13 14:37:38 DEBUG [root] wsgi.input = <_io.BytesIO object at 0x3755a70>
2012-03-13 14:37:38 DEBUG [root] HTTP_HOST = 192.168.240.19:35357
2012-03-13 14:37:38 DEBUG [root] wsgi.multithread = True
2012-03-13 14:37:38 DEBUG [root] openstack.params = {u'user': {u'password': u'', u'id': u'ADMIN'}}
2012-03-13 14:37:38 DEBUG [root] wsgi.version = (1, 0)
2012-03-13 14:37:38 DEBUG [root] openstack.context = {'token_id': 'ADMIN', 'is_admin': True}
2012-03-13 14:37:38 DEBUG [root] GATEWAY_INTERFACE = CGI/1.1
2012-03-13 14:37:38 DEBUG [root] wsgi.run_once = False
2012-03-13 14:37:38 DEBUG [root] wsgi.errors = <open file '<stderr>', mode 'w' at 0x7f0bb39e5270>
2012-03-13 14:37:38 DEBUG [root] wsgi.multiprocess = False
2012-03-13 14:37:38 DEBUG [root] webob.is_body_seekable = True
2012-03-13 14:37:38 DEBUG [root] CONTENT_TYPE = application/json
2012-03-13 14:37:38 DEBUG [root] HTTP_ACCEPT_ENCODING = gzip, deflate
2012-03-13 14:37:38 DEBUG [root]
2012-03-13 14:37:38 DEBUG [root] ******************** REQUEST BODY ********************
2012-03-13 14:37:38 DEBUG [root] {"user": {"password": "", "id": "ADMIN"}}
2012-03-13 14:37:38 DEBUG [root]
2012-03-13 14:37:38 DEBUG [routes.middleware] Matched PUT /users/ADMIN/OS-KSADM/password
2012-03-13 14:37:38 DEBUG [routes.middleware] Route path: '{path_info:.*}', defaults: {'controller': <keystone.contrib.admin_crud.core.CrudExtension object at 0x31db190>}
2012-03-13 14:37:38 DEBUG [routes.middleware] Match dict: {'controller': <keystone.contrib.admin_crud.core.CrudExtension object at 0x31db190>, 'path_info': '/users/ADMIN/OS-KSADM/password'}
2012-03-13 14:37:38 DEBUG [routes.middleware] Matched PUT /users/ADMIN/OS-KSADM/password
2012-03-13 14:37:38 DEBUG [routes.middleware] Route path: '/users/{user_id}/OS-KSADM/password', defaults: {'action': u'set_user_password', 'controller': <keystone.identity.core.UserController object at 0x31d3f50>}
2012-03-13 14:37:38 DEBUG [routes.middleware] Match dict: {'action': u'set_user_password', 'controller': <keystone.identity.core.UserController object at 0x31d3f50>, 'user_id': u'ADMIN'}
2012-03-13 14:37:38 DEBUG [root] arg_dict: {'user_id': u'ADMIN'}
2012-03-13 14:37:38 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 401, in set_user_password
   return self.update_user(context, user_id, user)
 File "/usr/local/lib/python2.7/dist-packages/keystone-2012.1-py2.7.egg/keystone/identity/core.py", line 390, in update_user
   user_ref = self.identity_api.update_user(context, user_id, user)
 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 296, in update_user
   old_user_dict = user_ref.to_dict()
AttributeError: 'NoneType' object has no attribute 'to_dict'

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

Joe - could you add a touch more info:

did the admin user already exist when you attempted to set it's password to ""?

for completeness sake, could you also include the keystone client commands you used to generate this.

Changed in keystone:
status: New → Incomplete
Revision history for this message
Joe Gordon (jogo) wrote :

This bug was produces by trying to update a user password by specifying a name instead of an ID.

keystone user-password-update --pass foo test:tester

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

This can be reproduced by attempting to update the password for a user which does not exist (which should return a 404):

    $ keystone user-password-update completely_invalid_user_id --pass newpass
    An unexpected error prevented the server from fulfilling your request. 'NoneType' object has no attribute 'to_dict' (HTTP 500)

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/5655

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.