Univention Bugzilla – Bug 52636
Migrate ucs-school-umc-import to Python 3
Last modified: 2021-11-29 17:20:24 CET
The package ucs-school-umc-import needs to be migrated to Python 3. See: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration
Migrated the UMC module to Python 3. It's not yet usable as python3-ucsschool-importer-http-api-client still has errors. ucs-school-umc-import (3.0.2) 8e3716df201b | Bug #52636: migrate ucs-school-umc-import to Python 3
I haven't found out why, but I used an import csv and uploaded it to the UMC module. In UCS4, I get shown a progress bar and then an error (invalid import file) immediatly. In UCS5, I don't get any progress bar and no error until it runs into a timeout. "A time out occurred during examining the data." In the Network viewer I can see, that univention/command/schoolimport/dry-run/progress is called until timeout. I haven't found any helpful logs yet, but I'll investigate.
Since Bug #47114 the error handling of the module is broken: wrong tracebacks are re-raised. e.g. Traceback (most recent call last): File "%PY2.7%/univention/management/console/base.py", line 344, in __error_handling six.reraise(etype, exc, etraceback) File "%PY2.7%/univention/management/console/base.py", line 247, in execute function.__func__(self, request, *args, **kwargs) File "%PY2.7%/univention/management/console/modules/decorators.py", line 643, in _decorated return function(self, request, *args, **kwargs) File "%PY2.7%/univention/management/console/modules/decorators.py", line 321, in _response result = _multi_response(self, request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "%PY2.7%/univention/management/console/modules/decorators.py", line 443, in _response return list(function(self, iterator, *nones)) File "%PY2.7%/univention/management/console/modules/decorators.py", line 289, in _fake_func yield function(self, *args) File "%PY2.7%/univention/management/console/modules/schoolimport/__init__.py", line 248, in poll_dry_run return progress.poll() File "%PY2.7%/univention/management/console/modules/mixins.py", line 102, in poll six.reraise(*self.exc_info) File "<string>", line 3, in reraise TypeError: string indices must be integers instead of: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/notifier/threads.py", line 80, in _run result = self._function() File "/usr/lib/python2.7/dist-packages/notifier/__init__.py", line 105, in __call__ return self._function(*tmp, **self._kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/schoolimport/__init__.py", line 195, in _dry_run message = "%s\n%s" % (message, job.result.result["description"]) TypeError: string indices must be integers Also the UMC error handling/displaying (e.g. for UMC_Error) doesn't work anymore. but at least I am getting the above traceback and no hanging progress bar. I would need your input data to reproduce this.
The traceback above is caused by an error in the import HTTP API. it returns a string instead of a dict in .result for URI `curl -k https://demo_admin:univention@localhost/api/v1/imports/users/33/ | python -m json.tool`: { "date_created": "2021-08-25T00:14:37.715908+02:00", "dryrun": true, "id": 33, "log_file": "https://localhost/api/v1/imports/users/33/logfile/", "password_file": "https://localhost/api/v1/imports/users/33/passwords/", "principal": "demo_admin", "result": { "date_done": "2021-08-25T00:14:37.944612+02:00", "result": "{\"description\": \"UserImportJob #33 (dry run) ended with error.\\n\\nRead users from input data: 5\\nErrors: 2\\nEntry | User | Error description\\n-------------------------------------\\n 0 | <No name> | source_uid or record_uid are not set (source_uid='demoschool-staff' record_uid=None).\\n 0 | <No name> | More than 0 errors.\", \"percentage\": 100, \"done\": 0, \"total\": 0}", "status": "SUCCESS", "traceback": null }, "school": "https://localhost/api/v1/schools/DEMOSCHOOL/", "status": "Aborted", "summary_file": "https://localhost/api/v1/imports/users/33/summary/", "url": "https://localhost/api/v1/imports/users/33/", "user_role": "staff" } So it doesn't belong to this bug.
(In reply to Julia Bremer from comment #3) > I haven't found out why, but I used an import csv and uploaded it to the UMC > module. > In UCS4, I get shown a progress bar and then an error (invalid import file) > immediatly. > > In UCS5, I don't get any progress bar and no error until it runs into a > timeout. > "A time out occurred during examining the data." > > In the Network viewer I can see, that > univention/command/schoolimport/dry-run/progress is called until timeout. > I haven't found any helpful logs yet, but I'll investigate. This is due to issues with Bug #53451.
(In reply to Julia Bremer from comment #6) > This is due to issues with Bug #53451. Yes, therefore RESOLVED again.
With fixes in Bug #53451: Graphical import with incorrect file: OK, Error is shown Graphical import with correct import file: OK works Verified
UCS@school 5.0 v1 has been released. https://docs.software-univention.de/release-notes-ucsschool-5.0v1-de.html If this error occurs again, please clone this bug.