Open UgnilJoZ opened 1 year ago
i can confirm this issue. i used https://github.com/eaudeweb/freeipa-password-reset fork to make it run in general. First try to reset worked, second gave that RPC warning to me too
ok. this error happens so often in a row thats quite impossible to reset a password for a user. the token is sent by mail, but when i enter i get the error nearly always. had to re-enter the token and new password 5 times until it worked.
some info about version:
same issue happens when NOT using virtualenv, instead using the system's provided python libraries. With ipaclient version 4.9.11 (same like FreeIPA server itself) it happens the same way
The errors comes frome https://github.com/freeipa/freeipa/blob/d7a27a24b92b85afde0bccbaaa09a3191c91c8c2/ipalib/backend.py#L63 basically
dirty bug fix like the following works:
vim /srv/IPAPasswordReset/PasswordReset/app/pwdmanager.py
api.Backend.rpcclient.connect()
self.redis = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=settings.REDIS_DB, password=settings.REDIS_PASSWORD)
add a try-except block before connect() method
try:
api.Backend.rpcclient.disconnect()
except Exception as e:
pass
api.Backend.rpcclient.connect()
self.redis = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=settings.REDIS_DB, password=settings.REDIS_PASSWORD)
A cleaner solution could be to let the call to api.Backend.rpcclient.connect()
depend on the connection status, which can be queried through the isconnected
method. This should also fix the issue.
hi. Yeah indeed this is better:
vim /srv/IPAPasswordReset/PasswordReset/app/pwdmanager.py
api.Backend.rpcclient.connect()
self.redis = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=settings.REDIS_DB, password=settings.REDIS_PASSWORD)
should get
if api.Backend.rpcclient.isconnected() is False:
api.Backend.rpcclient.connect()
self.redis = redis.StrictRedis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, db=settings.REDIS_DB, password=settings.REDIS_PASSWORD)
Hi,
Every second time we call
/setpassword
, an error is shown: "rpcclient is already connected".Manually resending the request succeeds.
If not catched, the exeption trace is the following: