Univention Bugzilla – Bug 54521
ERROR Getting ... UDM object: No DN!
Last modified: 2022-07-04 11:55:36 CEST
Creating a user without an explicit username logs an error. It seems that error can (and must be) ignored. This is confusing. I think we should lower the log level. The error is logged by ucs-school-lib/modules/ucsschool/lib/models/base.py::get_udm_object and the function returns None as a fallback. That function is later used to check for existence of the user object: `self.get_udm_object(lo) is not None` This can be reproduced running the test: `tests/test_route_user.py::test_create_without_username` and checking the log file `/var/log/univention/ucsschool-kelvin-rest-api/http.log` for the following errors: ERROR Getting ImportTeacher UDM object: No DN! ERROR Getting ImportStudent UDM object: No DN! ERROR Getting ImportStaff UDM object: No DN! ERROR Getting ImportTeachersAndStaff UDM object: No DN! Note: This seems to be a more general school lib problem, but I only saw it in combination with kelvin. I might just have missed it in our tests or we just don't test it?
Hm... bad logging creates problems... And returning different types (UDM object and None) is also not good... Maybe get_udm_object() can throw an exception instead of returning None, which the callers can catch and log according to the context: ERROR if it indeed was an error or nothing/debug if it was an expected test result.