Bug 34539 - Traceback when opening policies on deleted object
Traceback when opening policies on deleted object
Status: RESOLVED DUPLICATE of bug 36256
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2-x
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-14 11:37 CEST by Dirk Wiesenthal
Modified: 2015-06-05 15:14 CEST (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Error handling, External feedback, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-04-14 11:37:51 CEST
Reported by traceback feedback:

 Traceback:
  File "/usr/lib/pymodules/python2.6/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.6/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File
"/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line
1046, in _thread
    policy_obj.clone(obj)
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 2695, in
clone
    self.copyIdentifier( referring_object )
  File "/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py", line 2683, in
copyIdentifier
    self.info[key2]=from_object.info[key]

KeyError: 'name'


Remark:
Drucker sollte gelöscht werden

How to reproduce:
 * Add printer
 * Open printer
 * Delete printer in another tab
 * Open policy tab on opened (now deleted) printer

=> Minor issue as the printer is deleted. Should make sure that the DN still exists. See Bug #29231 for another example of "missing dn" handling
Comment 1 Florian Best univentionstaff 2015-02-02 09:51:53 CET
The same goes for deleted shares:

Execution of command 'udm/object/policies shares/share' has failed:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/__init__.py", line 176, in _decorated
    return function(self, request, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 1104, in _thread
    policy_obj.clone(obj)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2786, in clone
    self.copyIdentifier( referring_object )
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2774, in copyIdentifier
    self.info[key2]=from_object.info[key]
KeyError: 'name'

The might be other tracebacks for each object type → e.g. Bug #37119
Comment 2 Florian Best univentionstaff 2015-06-01 16:39:05 CEST
Reported again, 4.0-2 errata205 (Walle)
Comment 3 Florian Best univentionstaff 2015-06-05 11:38:47 CEST
Fixed in svn r61055
-				if _obj is None:
-					raise UMC_OptionTypeError('The object could not be found')
+				if _obj is None or dn and not obj.exists():
+					raise ObjectDoesNotExist(dn)

*** This bug has been marked as a duplicate of bug 36256 ***
Comment 4 Florian Best univentionstaff 2015-06-05 13:07:58 CEST
Fixed typo, svn r61063

Reproduce (with DN which does not exists):
umc-client -s 10.200.27.70 -U Administrator -P univention COMMAND udm/object/policies -f shares/print -e -o '[{"objectType":"shares/printer","policies":[],"policyType":"policies/print_quota","objectDN":"cn=foo,cn=printers,dc=nstx,dc=local","container":None}]'