Univention Bugzilla – Bug 57484
UDM syntax call wrong
Last modified: 2024-09-04 17:51:13 CEST
The UDM allocates syntax definitions in some cases as follows: syntax = univention.admin.syntax.string() setattr(prop, attr, syntax()) https://github.com/univention/univention-corporate-server/blob/5.0-8/management/univention-directory-manager-modules/modules/univention/admin/__init__.py#L113-L114 As an object is tried to be called, the following error is thrown: root@ucs-3999:~# python3 Python 3.7.3 (default, Mar 23 2024, 16:12:05) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import univention.admin.syntax >>> syntax = univention.admin.syntax.string() >>> syntax() Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'string' object is not callable >>> syntax <univention.admin.syntax.string object at 0x7f57ea153198> The correct setattr call would likely be as follows: setattr(prop, attr, syntax)
Another customer has this problem and this might be the cause for his current trouble with using group licenses which are sporadically missing in AAD. 19.08.24 11:05:42.800 ADMIN ( ERROR ) : ucr_overwrite_properties: failed to set property attribute: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/office365/udm_helper.py", line 151, in _get_module mod = self.modules[module_name] KeyError: 'groups/group' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/admin/__init__.py", line 114, in ucr_overwrite_properties setattr(prop, attr, syntax()) TypeError: 'string' object is not callable 19.08.24 11:05:42.941 ADMIN ( ERROR ) : ucr_overwrite_properties: failed to set property attribute: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/office365/udm_helper.py", line 151, in _get_module mod = self.modules[module_name] KeyError: 'groups/group' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/admin/__init__.py", line 114, in ucr_overwrite_properties setattr(prop, attr, syntax()) TypeError: 'string' object is not callable
FYI https://git.knut.univention.de/univention/ucs/-/issues/2410#note_370678
The traceback in the tickets probably was found in log files because ucr_overwrite_properties uses log.exception(), but it just does it to inform the customer that the syntax override via UCR didn't work and continues. I adjusted the error message, so the confusing traceback doesn't appear any longer. But AFAICS the *logged* traceback should not have caused any issues, as the code would continue running, just without the syntax override. So on the front side of the problem, there may have been a typo in the value of the customized UCR variable. As a result, this traceback was logged and the program continues without an adjusted syntax. Maybe *that* then caused further issues downstream, or it was just a red herring. This update addresses the following issues: * In case a UDM property syntax has been overridden via UCR but the specified value does not correspond to any defined syntax, UDM logged a traceback. This has now been replaced by a proper log message explaining the origin of the problem. f0d8ac38e7 | Fixup for 8d2c488c4d9 Package: univention-directory-manager-modules Version: 15.0.27-8 Branch: 5.0-0 Scope: errata5.0-8
Lean verification: * Code review done by colleague via issue. * Test installation of package from apt successful * Advisory ok * ErrataValidation looks ok
6ba61bf294 | cherry-pick to 5.2-0 Package: univention-directory-manager-modules Version: 17.0.20 Branch: 5.2-0
<https://errata.software-univention.de/#/?erratum=5.0x1114>