Univention Bugzilla – Bug 37402
ucr.load() fails: 'NoneType' object has no attribute 'lower'
Last modified: 2017-04-04 18:29:02 CEST
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)
The valueb must be set: debian/univention-config.postinst: univention-config-registry set 'ucr/encoding/strict?true' Please check /etc/univention/base.conf for corruption! Is univention-config fully configured: dpkg --configure univention-config
Reported again, 4.0-1 errata162 (Walle) Die Ausführung des Kommandos udm/query dns/dns ist fehlgeschlagen: 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 520, in _thread ucr.load() File "%PY2.7%/univention/config_registry/backend.py", line 106, in load strict = self.is_true('ucr/encoding/strict') File "%PY2.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'
Reported again, 4.0-2 errata214
Reported again, 4.0-3 errata292 (Walle) (The same UMCP command) Die Ausführung des Kommandos udm/query dns/dns ist fehlgeschlagen: 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 532, in _thread ucr.load() File "%PY2.7%/univention/config_registry/backend.py", line 106, in load strict = self.is_true('ucr/encoding/strict') File "%PY2.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: Access subnet via DHCP module Version: 4.0-3 errata342 (Walle) Execution of command 'udm/query dhcp/dhcp' 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 532, in _thread ucr.load() File "%PY2.7%/univention/config_registry/backend.py", line 106, in load strict = self.is_true('ucr/encoding/strict') File "%PY2.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'
As the UCR "ucr/encoding/strict" is set very eraly, this looks like some serious base.conf corruption.
But it is set in the postinst of univention-config. Maybe somethings goes wrong? Shouldn't we do: univention-config-registry set 'ucr/encoding/strict?true' || exit 1 ?
Created attachment 7218 [details] Improve multi-threaded access in UCR I think is'a a multi-threading problem: > File "%PY2.7%/univention/management/console/modules/udm/__init__.py", line 532, in _thread UCR is *not* thread-safe; I can trigger the bug with the attached test_backend_threading.py. 1. UMC uses a global shared instance of ConfigRegistry: univention.management.console.config.ucr 2. there is a (small) time window in load() between the dict.clear() and the loading, where UCR is empty or might miss the required values The attached patch - improves is_true() and is_false() to better handle None - changes load() to not use dict.clear()
Reported again, 3.2-8 errata410 (Borgfeld)
Reported again, 4.1-2 errata183 (Vahr) Remark: error after enabling DHCP boot policy
Reported again, 4.1-2 errata220 (Vahr)
Reported again, 4.1-3 errata262 (Vahr)
r72644 | Bug #37402 ucr: Make boolean handling more robust. r72646 | Bug #37402 ucr: Improve multi-threaded load Package: univention-config-registry Version: 12.0.0-2A~4.2.0.201609161507 Branch: ucs_4.2-0
r72658 | Bug #37402 ucr: Fix check for corrupted base.conf Fix amd64 build Package: univention-config-registry Version: 12.0.0-3A~4.2.0.201609170709 Branch: ucs_4.2-0
OK: Code review OK: tests OK: API-change, no functions use it like the following: >>> ucr.is_true('update/secure_apt', None) False >>> ucr.is_true('update/secure_apt', None, 'true') True OK: Changelog
The change revealed wrong UCR usage in Bug #42527 comment 3.
Reported again, 4.1-2 errata202 (Vahr)
Reported again, Version: 4.1-3 errata318 (Vahr)
Reported again, 4.0-3 errata398 (Walle)
Reported again, 3.2-3 errata278 (Borgfeld)
Reported again, 4.1-3 errata324 (Vahr)
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".