Bug 42912 - ucr.load() fails: 'NoneType' object has no attribute 'lower'
ucr.load() fails: 'NoneType' object has no attribute 'lower'
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCR
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-4-errata
Assigned To: Janek Walkenhorst
Dirk Wiesenthal
:
Depends on: 37402
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-09 17:17 CET by Florian Best
Modified: 2020-08-07 13:13 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.240
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2016102421000359, 2016102921000181, 2016110321000566, 2016110321000851, 2016110421000742, 2016111121000489, 2016111721000192, 2016111721000512, 2016111721000629, 2016112921000161, 2016111821000207, 2016120221000101, 2020072721000379
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-11-09 17:17:58 CET
This seems to happen more often currently. We should backport it for UCS 4.1-3.

+++ This bug was initially created as a clone of Bug #37402 +++

Traceback:
  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
507, in _thread
    ucr.load()
  File "/usr/lib/pymodules/python2.7/univention/config_registry/backend.py", line 106, in
load
    strict = self.is_true('ucr/encoding/strict')
  File "/usr/lib/pymodules/python2.7/univention/config_registry/backend.py", line 250, in
is_true
    value = self.get(key).lower()  # pylint: disable-msg=E1103

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


Remark:
In Management-Console die DNS-Einstellungen überprüft

Version:
4.0-0 errata10 (Walle)
Comment 1 Florian Best univentionstaff 2016-11-09 17:18:41 CET
This causes also the following traceback. I thought I already created a bug for this but can't find.

Die Ausführung des Kommandos udm/nav/container/query dns/dns ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 283, in execute
    function(self, request)
  File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 963, in nav_container_query
    root_subelements = ldap_base.lower() == container.lower() and request.flavor != 'navigation'
AttributeError: 'NoneType' object has no attribute 'lower'
Comment 2 Florian Best univentionstaff 2016-11-09 17:31:35 CET
As this might also be the cause of Bug #42619 I raise the type value to 7.
Comment 3 Florian Best univentionstaff 2016-11-11 16:38:46 CET
Reported again, 4.1-4 errata324 (Vahr)
Comment 4 Florian Best univentionstaff 2016-11-17 17:29:19 CET
Reported again, 4.1-4 errata327 (Vahr)
Comment 5 Florian Best univentionstaff 2016-11-17 17:30:20 CET
Reported again, 4.1-4 errata327 (Vahr)
Comment 6 Florian Best univentionstaff 2016-11-17 17:31:04 CET
Reported again, 4.1-4 errata327 (Vahr)
Comment 7 Florian Best univentionstaff 2016-11-17 17:31:38 CET
We should fix this asap imho.
Comment 8 Janek Walkenhorst univentionstaff 2016-11-20 23:35:27 CET
Code backported: r74621 r74622
Advisory: univention-config-registry.yaml r74620
Tests: OK

@Florian: Please build the package, once the buildsystem is well again.
Comment 9 Florian Best univentionstaff 2016-11-23 17:17:08 CET
I build the package last monday.
Comment 10 Florian Best univentionstaff 2016-11-28 15:33:02 CET
This changes the behavior of:
ucr.is_true(value='True') → True (prior False)

A effect of this is that in management/univention-management-console-module-udm/umc/python/udm/udm_ldap.py:
'nonempty_is_default': ucr.is_true(value=str(prop.nonempty_is_default)),
→ is evaluated correct so that when creating a user the mailHomeServer is set to the first value.
I think the API change here is okay as it fixes the currently broken behavior.
Comment 11 Florian Best univentionstaff 2016-11-28 15:40:21 CET
(In reply to Florian Best from comment #10)
> This changes the behavior of:
> ucr.is_true(value='True') → True (prior False)
> 
> A effect of this is that in
> management/univention-management-console-module-udm/umc/python/udm/udm_ldap.
> py:
> 'nonempty_is_default': ucr.is_true(value=str(prop.nonempty_is_default)),
> → is evaluated correct so that when creating a user the mailHomeServer is
> set to the first value.
> I think the API change here is okay as it fixes the currently broken
> behavior.

Ah it's not completely true, what I said here:
The regression is caused by the autopep8 changes in Bug #31771 where I replaced nonempty_is_default=1 to 
nonempty_is_default=True.

So this bug fixes actually every UDM pacakge which was build between 25.10 and now. (Only http://errata.software-univention.de/ucs/4.1/319.html).

See also Bug #33329.
Comment 12 Florian Best univentionstaff 2016-11-28 18:40:35 CET
(In reply to Florian Best from comment #11)
→ Bug #43069
Comment 13 Philipp Hahn univentionstaff 2016-11-29 11:32:31 CET
# cat /var/log/univention/listener.log
>05.08.16 22:48:53.803  LISTENER    ( ERROR   ) : import of filename=/usr/lib/univention-directory-listener/system/gencertificate.py failed
>Traceback (most recent call last):
>  File "/usr/lib/univention-directory-listener/system/gencertificate.py", line 45, in <module>
>    filter = '(|%s)' % ''.join('(objectClass=%s)' % oc for oc in set(configRegistry['ssl/host/objectclass'].split(',')))
>AttributeError: 'NoneType' object has no attribute 'split'

# cat /var/log/univention/config-registry.replog
>2016-08-05 22:45:06: set version/patchlevel=2 old:1
>2016-08-05 22:45:06: set version/version=4.1 old:4.1
>2016-08-05 22:48:28: set directory/manager/user_group/uniqueness=true old:true
>2016-08-05 22:48:38: set security/packetfilter/package/univention-management-console-server/tcp/6670/all/en=UMC old:
>2016-08-05 22:48:38: set security/packetfilter/package/univention-management-console-server/tcp/6670/all=ACCEPT old:
>2016-08-05 22:48:41: set umc/web/sso/newwindow=true old:true
>2016-08-05 22:48:45: set version/erratalevel=295 old:202
>2016-08-05 22:48:46: set version/releasename=Vahr old:Vahr
>2016-08-05 22:48:55: set license/base='UCS Core Edition' old:UCS Core Edition

# ucr get ssl/host/objectclass
>univentionDomainController,univentionMemberServer,univentionClient,univentionMobileClient,univentionCorporateClient

# ucr search --brief ^version/
>version/erratalevel: 327
>version/patchlevel: 4
>version/releasename: Vahr
>version/version: 4.1
Comment 14 Dirk Wiesenthal univentionstaff 2016-11-29 23:50:24 CET
Backport: OK
YAML: OK
Comment 15 Janek Walkenhorst univentionstaff 2016-12-01 11:57:31 CET
<http://errata.software-univention.de/ucs/4.1/333.html>
Comment 16 Florian Best univentionstaff 2016-12-09 17:10:41 CET
Reported again, 4.1-4 errata327 (Vahr)
Comment 17 Florian Best univentionstaff 2016-12-09 17:26:20 CET
Reported again, 4.1-4 errata327 (Vahr)
Comment 18 Christian Castens univentionstaff 2020-08-07 13:13:41 CEST
reported again 

Remark: Always getting this error messages, would like to put into production but have constant issue like these. Would be nice to know whats wrong and get it fixed 100%

Error:
Execution of command 'udm/nav/container/query dns/dns' has failed: