Bug 53576 - regression: ucsschool.http_api.import_api.management moved to ucsschool.http_api.management due to dh_python migration
regression: ucsschool.http_api.import_api.management moved to ucsschool.http_...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v9-errata
Assigned To: Florian Best
Tobias Wenzel
:
Depends on: 52580
Blocks: 52578
  Show dependency treegraph
 
Reported: 2021-07-14 12:12 CEST by Florian Best
Modified: 2021-07-21 12:03 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2021071221000289, 2021071921000427
Bug group (optional): Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-07-14 12:12:59 CEST
The change moved django python libraries into the wrong directory:

git:768aac1eecad921675b573c049e1edf03605b03d

diff --git ucs-school-import/debian/ucs-school-import-http-api.install ucs-school-import/debian/ucs-school-import-http-api.install
index b22af1dde..2001f2e65 100644
--- ucs-school-import/debian/ucs-school-import-http-api.install
+++ ucs-school-import/debian/ucs-school-import-http-api.install
-modules/ucsschool/http_api/import_api/management/        usr/lib/python2.7/dist-packages/ucsschool/http_api/import_api/
-modules/ucsschool/http_api/import_api/migrations/        usr/lib/python2.7/dist-packages/ucsschool/http_api/import_api/

diff --git ucs-school-import/debian/python3-ucsschool-importer-http-api.pyinstall ucs-school-import/debian/python3-ucsschool-importer-http-api.pyinstall
new file mode 100644
index 000000000..5cbdc3b17
--- /dev/null
+++ ucs-school-import/debian/python3-ucsschool-importer-http-api.pyinstall
+modules/ucsschool/http_api/import_api/management/*.py ucsschool.http_api.management
+modules/ucsschool/http_api/import_api/management/commands/*.py ucsschool.http_api.management.commands


+++ This bug was initially created as a clone of Bug #52580 +++

The package ucs-school-import needs to be migrated to dh_python.

See: https://hutten.knut.univention.de/mediawiki/index.php/Python_DebHelper_Migration
Comment 1 Florian Best univentionstaff 2021-07-14 12:20:00 CEST
ucs-school-import (17.0.71)
4c095538e2a7 | Bug #53576: fix regression: revert moving django packages into the wrong location
Comment 2 Daniel Tröder univentionstaff 2021-07-15 11:19:44 CEST
Was this also done in 4.4 and must be reverted there as well?
Comment 3 Florian Best univentionstaff 2021-07-15 11:22:15 CEST
(In reply to Daniel Tröder from comment #2)
> Was this also done in 4.4 and must be reverted there as well?

Yes, that's why the Target Milestone is set to 4.4-errata and it's already fixed in there.
I don't know why it still works, but we should definitely release this soon.
Comment 4 Daniel Tröder univentionstaff 2021-07-15 11:41:59 CEST
Oh thanks. I misread: instead of the "MS" I read the "Version" line.
I removed myself from QA, as I'll be on vacation. I added it to our task board.
Comment 6 Christina Scheinig univentionstaff 2021-07-16 16:46:04 CEST
This causes a traceback opening the UMC import module:

Interner Server-Fehler in "schoolimport/schools".
Request: schoolimport/schools

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 359, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 641, in _decorated
    return function(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response
    result = _multi_response(self, request)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response
    return list(function(self, iterator, *nones))
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func
    yield function(self, *args)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/schoolimport/__init__.py", line 104, in schools
    dict(id=school.name, label=school.displayName) for school in self.client.school.list()
  File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line 593, in list
    return self._to_python(self._list_resource(**params))
  File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line 551, in _list_resource
    return self._resource_from_url(resource_url, **params)
  File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line 543, in _resource_from_url
    return self.client.call_api("get", url, params=params)
  File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line 524, in call_api
    raise exc(msg, status_code=response.status_code)
ServerError: Received status_code=500 with reason='Internal Server Error' for requests.get(**files=None, url=u'https://ucs-5069.iss.intranet/api/v1/schools/',
auth=(u'Administrator', u'************'), headers={u'Accept': u'application/json'}, params={}, data=None).

The UCS is fresh installed:
UCS: 4.4-8 errata1009
Installed: cups=2.2.1 dhcp-server=12.0 kde=5.8 samba4=4.10 self-service=4.0 self-service-backend=4.0 squid=3.5 ucsschool=4.4 v9 ucsschool-veyon-proxy=1.1
Comment 7 Tobias Wenzel univentionstaff 2021-07-19 12:36:38 CEST
QA -> verify

Code OK
Changelog  OK
YAML OK
Build OK

before fix

Python 2.7.13 (default, Apr 16 2021, 14:02:03) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ucsschool.http_api.import_api.management
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named management


after fix

>>> import ucsschool.http_api.import_api.management
-> no traceback
Comment 8 Christina Scheinig univentionstaff 2021-07-19 16:57:54 CEST
(In reply to Christina Scheinig from comment #6)
> This causes a traceback opening the UMC import module:
> 
> Interner Server-Fehler in "schoolimport/schools".
> Request: schoolimport/schools
> 
> Traceback (most recent call last):
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/base.py",
> line 359, in __error_handling
>     six.reraise(etype, exc, etraceback)
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/base.py",
> line 262, in execute
>     function.__func__(self, request, *args, **kwargs)
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/modules/
> decorators.py", line 641, in _decorated
>     return function(self, request, *args, **kwargs)
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/modules/
> decorators.py", line 321, in _response
>     result = _multi_response(self, request)
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/modules/
> decorators.py", line 181, in _response
>     return function(self, request)
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/modules/
> decorators.py", line 443, in _response
>     return list(function(self, iterator, *nones))
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/modules/
> decorators.py", line 289, in _fake_func
>     yield function(self, *args)
>   File
> "/usr/lib/python2.7/dist-packages/univention/management/console/modules/
> schoolimport/__init__.py", line 104, in schools
>     dict(id=school.name, label=school.displayName) for school in
> self.client.school.list()
>   File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line
> 593, in list
>     return self._to_python(self._list_resource(**params))
>   File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line
> 551, in _list_resource
>     return self._resource_from_url(resource_url, **params)
>   File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line
> 543, in _resource_from_url
>     return self.client.call_api("get", url, params=params)
>   File "/usr/lib/python2.7/dist-packages/ucsschool/http_api/client.py", line
> 524, in call_api
>     raise exc(msg, status_code=response.status_code)
> ServerError: Received status_code=500 with reason='Internal Server Error'
> for requests.get(**files=None,
> url=u'https://ucs-5069.iss.intranet/api/v1/schools/',
> auth=(u'Administrator', u'************'), headers={u'Accept':
> u'application/json'}, params={}, data=None).
> 
> The UCS is fresh installed:
> UCS: 4.4-8 errata1009
> Installed: cups=2.2.1 dhcp-server=12.0 kde=5.8 samba4=4.10 self-service=4.0
> self-service-backend=4.0 squid=3.5 ucsschool=4.4 v9 ucsschool-veyon-proxy=1.1


After installation of a school master, the UMC user import is not usable at all.
Is this the same issue here, or is this an other Bug? This "traceback" is blocking daily work and major usability.
Comment 9 Ole Schwiegert univentionstaff 2021-07-20 10:49:10 CEST
Errata updates for UCS@school 4.4 v9 have been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v9-de.html

If this error occurs again, please clone this bug.