Bug 37667 - traceback when receiving policies
traceback when receiving policies
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.1
Assigned To: Florian Best
Dirk Wiesenthal
: interim-2
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-02 09:57 CET by Florian Best
Modified: 2015-11-17 12:11 CET (History)
1 user (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
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2015-02-02 09:57:21 CET
I tried to reproduce this (e.g. similar to Bug #34539 ?) but could not.

4.0-0 errata66 (Walle)

Traceback:
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 2770, in
copyIdentifier
    for key, property in from_object.descriptions.items():
AttributeError: 'NoneType' object has no attribute 'descriptions'
Comment 1 Florian Best univentionstaff 2015-03-18 12:02:15 CET
Reported again, 4.0-1 errata113 (Walle)

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/modules/__init__.py", line 176, in _decorated
    return function(self, request, *args, **kwargs)
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 1104, in _thread
    policy_obj.clone(obj)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 2786, in clone
    self.copyIdentifier( referring_object )
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 2770, in copyIdentifier
    for key, property in from_object.descriptions.items():
AttributeError: 'NoneType' object has no attribute 'descriptions'
Comment 2 Florian Best univentionstaff 2015-03-20 12:17:38 CET
Reported again, 4.0-1 errata113 (Walle), (different UUID)
Comment 3 Florian Best univentionstaff 2015-03-23 15:09:18 CET
We could add the information which policy type was requested to the error information.
Comment 4 Florian Best univentionstaff 2015-03-24 15:32:57 CET
I also found this in the logfiles of demo.univention.de twice → 4.0-0-errata-0 (the update failed today)
Comment 5 Florian Best univentionstaff 2015-03-24 15:34:23 CET
24.03.15 09:01:57.829  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:45943) response status code: 590
24.03.15 09:01:57.829  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:45943) response message:   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 360, in _thread
    dn = module.create( properties, container = options.get( 'container' ), superordinate = options.get( 'superordinate' ) )
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 184, in wrapper_func
    ret = func( *args, **kwargs )
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 347, in create
    raise UMC_CommandError( str( e ) )

UMC_CommandError: DN not found: .

24.03.15 09:01:57.829  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:45943) response result: None
24.03.15 09:02:56.132  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:46319) response status code: 590
24.03.15 09:02:56.132  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:46319) response message:   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 1086, in _thread
    policy_obj.clone(obj)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2772, in clone
    self.copyIdentifier( referring_object )
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2756, in copyIdentifier
    for key, property in from_object.descriptions.items():

AttributeError: 'NoneType' object has no attribute 'descriptions'

24.03.15 09:02:56.132  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:46319) response result: None
24.03.15 09:02:56.310  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:46320) response status code: 590
24.03.15 09:02:56.310  MAIN        ( PROCESS ) : CPCommand (41.150.108.242:46320) response message:   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 1086, in _thread
    policy_obj.clone(obj)
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2772, in clone
    self.copyIdentifier( referring_object )
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2756, in copyIdentifier
    for key, property in from_object.descriptions.items():

AttributeError: 'NoneType' object has no attribute 'descriptions'
Comment 6 Florian Best univentionstaff 2015-04-15 15:58:13 CEST
Reproducible:
execute the following code in the JS console and open the policies tab then:
umc.app.openModule('udm', 'navigation', { newObject: { objectType: 'dns/forward_zone' } })
Comment 7 Florian Best univentionstaff 2015-04-23 10:16:59 CEST
Reported again, 4.0-1 errata160 (Walle), udm/object/policies shares/share
Comment 8 Florian Best univentionstaff 2015-06-05 18:45:19 CEST
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":None,"container":None}]'

Happened if no policy was given or the given policy did not exists.

*** This bug has been marked as a duplicate of bug 36256 ***
Comment 9 Florian Best univentionstaff 2015-08-27 12:47:55 CEST
There still seems to be a case where this happens. We received the following traceback, 4.0-3 errata288 (Walle).

Remark:
Attempting to join a different domain

→ I don't understand the remark.


Execution of command 'udm/object/policies computers/computer' has failed:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 207, in _decorated
    return function(self, request, *args, **kwargs)
  File "%PY2.7%/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "%PY2.7%/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 1117, in _thread
    policy_obj.clone(obj)
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 2790, in clone
    self.copyIdentifier( referring_object )
  File "%PY2.7%/univention/admin/handlers/__init__.py", line 2774, in copyIdentifier
    for key, property in from_object.descriptions.items():
AttributeError: 'NoneType' object has no attribute 'descriptions'
Comment 10 Florian Best univentionstaff 2015-09-01 11:57:22 CEST
Reproducible:
umc-client -s master501.deadlock50.intranet -U Administrator -P univention COMMAND udm/object/policies -f users/user -e -o '[{"objectType":"users/user","policies":[],"policyType":"policies/pwhistory","objectDN":None,"container":None}]
Comment 11 Florian Best univentionstaff 2015-09-01 14:44:43 CEST
This was unfixed due to the revert in svn r61344.
I added the check if every argument is None.

univention-management-console-module-udm (6.0.4-1):
r63373 | Bug #37667: fix traceback when receiving policies for a not existing object
Comment 12 Dirk Wiesenthal univentionstaff 2015-11-09 00:23:40 CET
You are now testing:
  if not policy_dns and not object_dn and not container_dn

But you should test:
  if obj is None

as this is the actual reason for the traceback. You only test what you think might lead to "obj is None". As it is now, this still causes the traceback:

umc-client -s master50 -U Administrator -P univention COMMAND udm/object/policies -f users/user -e -o '[{"objectType":"users/user","policies":["cn=default-settings,cn=pwhistory,cn=users,cn=policies,dc=dirk,dc=singlemaster,dc=intranet"],"policyType":"policies/pwhistory","objectDN":None,"container":None}]'
Comment 13 Florian Best univentionstaff 2015-11-09 11:29:04 CET
(In reply to Dirk Wiesenthal from comment #12)
> You are now testing:
>   if not policy_dns and not object_dn and not container_dn
> 
> But you should test:
>   if obj is None
> 
> as this is the actual reason for the traceback. You only test what you think
> might lead to "obj is None". As it is now, this still causes the traceback:
yes :) fixed in svn r65314.
Comment 14 Dirk Wiesenthal univentionstaff 2015-11-09 15:40:01 CET
OK
Changelog adjusted
Comment 15 Florian Best univentionstaff 2015-11-16 09:05:40 CET
Reported agaon, 4.0-3 errata285 (Walle)
Comment 16 Stefan Gohmann univentionstaff 2015-11-17 12:11:47 CET
UCS 4.1 has been released:
 https://docs.software-univention.de/release-notes-4.1-0-en.html
 https://docs.software-univention.de/release-notes-4.1-0-de.html

If this error occurs again, please use "Clone This Bug".