Univention Bugzilla – Bug 51606
The graphical user import cannot be opened and terminates with the following traceback
Last modified: 2020-07-30 13:14:54 CEST
Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 358, in __error_handling six.reraise(etype, exc, etraceback) File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/modserver.py", line 188, in _recv self.handle(msg) File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/modserver.py", line 257, in handle six.reraise(self.__init_etype, self.__init_exc, self.__init_etraceback) File "/usr/lib/python2.7/dist-packages/univention/management/console/protocol/modserver.py", line 298, in handle self.__handler.init() File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolimport/__init__.py", line 69, in init ssl_verify=ssl_verify, File "/usr/lib/pymodules/python2.7/ucsschool/http_api/client.py", line 383, in __init__ setattr(self, cls_name, kls(self)) File "/usr/lib/pymodules/python2.7/ucsschool/http_api/client.py", line 475, in __init__ self.resource_url = self.client.resource_urls[self.resource_name] File "/usr/lib/pymodules/python2.7/ucsschool/http_api/client.py", line 396, in resource_urls raise IllegalURLError('URL {!r} for resource {!r} from API root does not start with {!r}.'.format(url, resource, self.base_url)) IllegalURLError: URL u'https://foobucs01.schulen.schein.de/api/v1/schools/' for resource u'schools' from API root does not start with u'https://fOOBucs01.schulen.schein.de/api/v1/'.
Does this happen directly after an installation? Or are other steps needed to reproduce the traceback?
there are no users imported to the system yet, this occured from the first try on the customers system.
(In reply to Marc Schwarz from comment #2) > there are no users imported to the system yet, this occured from the first > try on the customers system. Thanks, I increase "Who will be affected by this bug?" then.
Created attachment 10422 [details] screenshot of succesful import
I tried to reproduce the problem with the graphical user import (see screenshot), but had no problem/ error while importing the students. Maybe the problem lies somewhere else? If not, a possible fix can be fount in [twenzel/51606_import_traceback] e1947b9f3 Bug #51606: case insensitive checking of school base_url UCS: 4.4-3 errata456 Installed: cups=2.2.1 samba4=4.10 squid=3.5 ucsschool=4.4 v4
I could finally reproduce the problem: Simply set ucsschool/import/http_api/client/server="ucs-2890.Wenzel-univention.intranet" instead of lowercase 'wenzel'. When running into this exact error, this can also work as a quick-fix, because the address is composed this way: server = ucr.get("ucsschool/import/http_api/client/server") or "{}.{}".format( ucr["hostname"], ucr["domainname"]) The fix, which I added in comment #5 is already working.
OK: reproducible by calling ucsschool.http_api.client.Client() with the DC masters FQDN in a case different from that saved in UCR: ---------------------------------------------------------------- # ucr get hostname; ucr get domainname m70 uni.dtr # python -c "from ucsschool.http_api.client import Client; client = Client(name='Administrator', password='univention', server='m70.uni.dtr')" (m70.uni.dtr → no error) # python -c "from ucsschool.http_api.client import Client; client = Client(name='Administrator', password='univention', server='M70.uni.dtr')" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/pymodules/python2.7/ucsschool/http_api/client.py", line 411, in __init__ setattr(self, cls_name, kls(self)) File "/usr/lib/pymodules/python2.7/ucsschool/http_api/client.py", line 531, in __init__ self.resource_url = self.client.resource_urls[self.resource_name] File "/usr/lib/pymodules/python2.7/ucsschool/http_api/client.py", line 432, in resource_urls url, resource, self.base_url ucsschool.http_api.client.IllegalURLError: URL u'https://m70.uni.dtr/api/v1/schools/' for resource u'schools' from API root does not start with u'https://M70.uni.dtr/api/v1/'. (M70.uni.dtr → error) ---------------------------------------------------------------- OK: after applying the patch in e1947b9f3 from twenzel/51606_import_traceback, the same call (with M70.uni.dtr) does not raise an error anymore. I added a test for this: [twenzel/51606_import_traceback f62a1b8ba] Bug #51606: test Newton client server name not matching hosts fqdn regarding case Please merge.
Merged and built [4.4] 07723d218 Bug #51606: changelog & yaml [4.4] 30bceaeaa Bug #51606: Merge branch 'twenzel/51606_import_traceback' into 4.4 [4.4] f62a1b8ba Bug #51606: test Newton client server name not matching hosts fqdn regarding case [4.4] e1947b9f3 Bug #51606: case insensitive checking of school base_url Package: ucs-school-import Version: 17.0.39A~4.4.0.202007171700 Branch: ucs_4.4-0 Scope: ucs-school-4.4 Package: ucs-test-ucsschool Version: 6.0.124A~4.4.0.202007171716 Branch: ucs_4.4-0 Scope: ucs-school-4.4
OK: merge and build OK: advisory
UCS@school 4.4 v5 has been released (errata update to the release). http://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html#changelog:ucsschool:2020-07-30 If this error occurs again, please clone this bug.