Bug 48741 - python-ucs-school postinst can destroy a system
python-ucs-school postinst can destroy a system
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v1
Assigned To: Jürn Brodersen
Ole Schwiegert
:
Depends on: 48226
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-22 14:19 CET by Jürn Brodersen
Modified: 2019-03-12 10:59 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: 7: Crash: Bug causes crash or data loss
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jürn Brodersen univentionstaff 2019-02-22 14:19:31 CET
python-ucs-school postinst can destroy a system

It looks like "update-python-modules -f" crashed:
'''
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 439, in <module>
shutil.rmtree(dir)
File "/usr/lib/python2.7/shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "/usr/lib/python2.7/shutil.py", line 256, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/usr/lib/python2.7/shutil.py", line 254, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/usr/lib/pymodules/python2.7/univention'
'''
Which resulted in a mostly empty /usr/lib/pymodules/python2.7/univention directory and therefore all univention python modules stopped working.

The problematic file seems to have been:
univention/management/console/modules/schoolinstaller/__init__.py

I expect this call to be a workaround for https://hutten.knut.univention.de/blog/reproducible-build-zeitstempel-und-python-support/

update-python-modules was called after the debhelper section and should not be necessary outside of development, since update-python-modules is called through python_support in the debhelper section.

TLDR:
"update-python-modules --force-rebuild-all" should not be called without a very good reason.

An alternative would be "update-python-modules python-ucs-school.public" to only update the relevant files for python-ucs-school.
Comment 1 Jürn Brodersen univentionstaff 2019-02-22 14:31:45 CET
[4.4 fb34dedd1] Bug #48741: Do not update all python modules in postinst

Package: ucs-school-lib
Version: 12.1.0-11A~4.4.0.201902221427
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 2 Ole Schwiegert univentionstaff 2019-02-25 09:09:43 CET
Changelog: OK
Advisory: REOP *missing
Package installs: OK
Upgrading U@s and installing U@s anew on a 4.4 dev setup works without problems: OK
Comment 3 Jürn Brodersen univentionstaff 2019-02-25 11:10:15 CET
(In reply to Ole Schwiegert from comment #2)
> Changelog: OK
> Advisory: REOP *missing
> Package installs: OK
> Upgrading U@s and installing U@s anew on a 4.4 dev setup works without
> problems: OK

[4.4 85f414ed5] Bug #48741: yaml
Comment 4 Ole Schwiegert univentionstaff 2019-02-25 11:19:20 CET
tiptop
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2019-03-12 10:59:02 CET
UCS@school 4.4 v1 has been released.

https://docs.software-univention.de/release-notes-ucsschool-4.4v1-de.html

If this error occurs again, please clone this bug.