Commands inheriting from baseldap.LDAPUpdate and baseldap.BaseLDAPModAttribute should raise MidairCollision when modifying an entry that was deleted by some other process in the meanwhile. However, the exception raising code itself crashes due to incorrect parameter passed to the exception class.
baseldap.LDAPUpdate
baseldap.BaseLDAPModAttribute
MidairCollision
This was observed during investigation of #6041:
Fri Jul 08 09:52:16.241457 2016] [wsgi:error] [pid 42029] Traceback (most recent call last): [Fri Jul 08 09:52:16.241460 2016] [wsgi:error] [pid 42029] File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 350, in wsgi_execute [Fri Jul 08 09:52:16.241463 2016] [wsgi:error] [pid 42029] result = self.Command[name](*args, **options) [Fri Jul 08 09:52:16.241464 2016] [wsgi:error] [pid 42029] File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 446, in __call__ [Fri Jul 08 09:52:16.241466 2016] [wsgi:error] [pid 42029] ret = self.run(*args, **options) [Fri Jul 08 09:52:16.241468 2016] [wsgi:error] [pid 42029] File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 763, in run [Fri Jul 08 09:52:16.241470 2016] [wsgi:error] [pid 42029] return self.execute(*args, **options) [Fri Jul 08 09:52:16.241471 2016] [wsgi:error] [pid 42029] File "/usr/lib/python2.7/site-packages/ipalib/plugins/baseldap.py", line 1527, in execute [Fri Jul 08 09:52:16.241494 2016] [wsgi:error] [pid 42029] format=_('the entry was deleted while being modified') [Fri Jul 08 09:52:16.241497 2016] [wsgi:error] [pid 42029] File "/usr/lib/python2.7/site-packages/ipalib/errors.py", line 254, in __init__ [Fri Jul 08 09:52:16.241499 2016] [wsgi:error] [pid 42029] messages.process_message_arguments(self, format, message, **kw) [Fri Jul 08 09:52:16.241501 2016] [wsgi:error] [pid 42029] File "/usr/lib/python2.7/site-packages/ipalib/messages.py", line 57, in process_message_arguments [Fri Jul 08 09:52:16.241503 2016] [wsgi:error] [pid 42029] name, format) [Fri Jul 08 09:52:16.241505 2016] [wsgi:error] [pid 42029] ValueError: non-generic 'MidairCollision' needs format=None; got format=Gettext('the entry was deleted while being modified', domain='ipa', localedir=None)
The end result is that instead of displaying:
ipa: ERROR: the entry was deleted while being modified
the user gets a rather unhelpful:
ipa: ERROR: an internal error has occurred
This behavior can actually be traced all the way to FreeIPA 3.0 so it seems it never worked properly. It is worth fixing, though, so that valid errors arising from race conditions are not masked by generic internal errors.
Linked to Bugzilla bug: https://bugzilla.redhat.com/show_bug.cgi?id=1358229 (Red Hat Enterprise Linux 7)
master:
Metadata Update from @mbabinsk: - Issue assigned to mbabinsk - Issue set to the milestone: FreeIPA 4.4.1
Login to comment on this ticket.