-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to update LDAP user causes internal server error #14
Comments
I'll take this as a feature request to add support for the update_user operation for LDAP users. The reason this isn't supported yet is simply that we haven't had a need for it, yet. So we haven't tested it either. (And I actually don't have access to an LDAP server with write access). I'm tempted to add a simple Not Supported message just to get rid of the 500. |
I can implement this once I have time, but it will probably be 6 weeks or so until I do. No worries :) In the mean time if anyone else is willing to work on this I can help guide you. |
i have also this problem. Is there a way to fix them? |
I haven't written the fix yet. I don't know of anyone else that has. |
Hi sergio97. Hi everyone. When i show users by "keystone user-list", the result is: |
cuongnguyenvan, when I try this in my environment I get the same error. This is expected. |
If you mean you tried to update an SQL user and it failed, that's a problem! |
I have configured hybird driver: I want to use Ldap for identity. But can not seem to update True / False user :( |
Based on that configuration, you're using the LDAP identity backend, not the hybrid one. |
In a similar issue- Identity is set to hybrid edit (to add comment)- lookup operations work fine (user-get, user-list) |
This happens as both a user changing their own password and as an admin resetting a user's password. I haven't tested admin updating a user other than password yet, but I bet it's the same. Keystone logs this stacktrace:
2014-09-05 17:57:25.623 445821 ERROR keystone.common.wsgi [-] 'User' object has no attribute 'to_dict'
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi Traceback (most recent call last):
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/common/wsgi.py", line 212, in call
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi result = method(context, *_params)
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/identity/controllers.py", line 239, in set_user_password
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi return self.update_user(context, user_id, user)
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/identity/controllers.py", line 185, in update_user
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi self.identity_api.update_user(user_id, user))
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/notifications.py", line 74, in wrapper
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi result = f(_args, *_kwargs)
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/identity/core.py", line 189, in wrapper
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi return f(self, *args, *_kwargs)
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/identity/core.py", line 351, in update_user
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi ref = driver.update_user(user_id, user)
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/common/sql/core.py", line 392, in wrapper
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi return method(_args, *_kwargs)
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi File "/usr/lib/python2.7/dist-packages/keystone/identity/backends/sql.py", line 164, in update_user
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi old_user_dict = user_ref.to_dict()
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi AttributeError: 'User' object has no attribute 'to_dict'
2014-09-05 17:57:25.623 445821 TRACE keystone.common.wsgi
An unexpected error prevented the server from fulfilling your request. (HTTP 500)
The problem is the driver sql calls our _get_user() which returns a user already in dict format because it came from LDAP:
user_ref = self._get_user(session, user_id)
On the line after that it calls:
old_user_dict = user_ref.to_dict()
which causes the problem.
I think the correct solution is to write an update_user() function that then calls update_user() in the LDAP or SQL backend accordingly. Thoughts?
With the normal LDAP driver it returns "You are not authorized to perform the requested action, LDAP user update. (HTTP 403)"
The text was updated successfully, but these errors were encountered: