Univention Bugzilla – Bug 32107
Handle unexpected join script file names more gracefully
Last modified: 2017-11-29 12:56:56 CET
Seen on UCS 3.1-1 Errata130, seen on DC Slave The UMC module for calling join scripts throws a traceback if a join script from a customer generated UCC image lays under /usr/lib/univention-install (as recommended by UCC documentation). Calling the script with "univention-run-joinscripts" works fine but doesn't resolv the traceback in the UMC module -- the UMC module can't be used as long as the join script isn't removed. ------------------------------------------------------------------------ Die Ausführung des Kommandos join/scripts/query ist fehlgeschlagen: Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 282, in _response result = _multi_response(self, request) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 384, in _response for res in function(self, iterator, *nones): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/decorators.py", line 266, in _fake_func yield function(self, *args) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/join/__init__.py", line 288, in query files[name]['configured'] = False KeyError: '/usr/lib/univention-install/ucc-1.0-rev2-thinclient-image-lts-quantal.img' ------------------------------------------------------------------------
Could you please attach/paste the /var/univention-join/status file when this failure happens.
Created attachment 5341 [details] example ucc join script I thin the status file is not helpfull here, because the error occures directly afer copying the new join script to /usr/lib/univention-install/ (there is no information about this script yet in the status file). Attached is a typical ucc join script to reproduce the message. Remember to make it executable (chmod u+x).
The problem is the name of the join script ending on .img. The join module reads in all join scripts ending on .inst or .uinst. The exact regexp is: ^(?P<script>(?P<prio>\d+)(?P<name>.+))\.(inst|uinst)$ Now the UCC join script has already been executed and its name appears in /var/univention-join/status. As the file name does not appear in the list of the afore read file names, a key error is thrown. (a) This is a problem of the UMC join module as it should not throw a traceback. (b) Probably the name of the UCC join script should be adjusted, otherwise it will not be displayed in the UMC join module.
I cloned the bug for UCC (→ Bug 32136).
Created attachment 5503 [details] 32107.patch
(In reply to Alexander Kläser from comment #3) > The problem is the name of the join script ending on .img. No, the joinscripts for ucc images end on .inst, but they do not by default contain a sequence number (_95_ucc-...inst), which is only added by ucc-image-download. -> Will be fixed at Bug 32136 The UMC join module encounters an error whenever a executable file with a (.inst|.uinst) ending and without a sequencenumber at the start of the filename resides in /usr/lib/univention-install. This bug is present in UCS 3.1 and UCS 3.2
Die Ausführung des Kommandos join/scripts/query ist fehlgeschlagen: Traceback (most recent call last): File "%PY2.6%/univention/management/console/modules/__init__.py", line 218, in execute func( request ) File "%PY2.6%/univention/management/console/modules/decorators.py", line 305, in _response result = _multi_response(self, request) File "%PY2.6%/univention/management/console/modules/decorators.py", line 432, in _response for res in function(self, iterator, *nones): File "%PY2.6%/univention/management/console/modules/decorators.py", line 271, in _fake_func yield function(self, *args) File "%PY2.6%/univention/management/console/modules/join/__init__.py", line 303, in query files[name]['configured'] = False KeyError: '95ucc-1.0-rev3-thinclient-image.img'
Reported again: Version: 3.2-8 errata445 (Borgfeld) Remark: Only the file `/usr/lib/univention-install/9595ucc-2.0-lmz-desktop-efi-image.img.inst` is present on the server if that helps. ls -l /usr/lib/univention-install/9595ucc-2.0-lmz-desktop-efi-image.img.inst -rwxr-xr-x 1 root root 1938 14. Jun 15:21 /usr/lib/univention-install/9595ucc-2.0-lmz-desktop-efi-image.img.inst Traceback(ac86ca401eb2091d4d04d10ffdbacae8): Die Ausführung des Kommandos join/scripts/query ist fehlgeschlagen: Traceback (most recent call last): File "%PY2.6%/univention/management/console/modules/__init__.py", line 218, in execute func( request ) File "%PY2.6%/univention/management/console/modules/decorators.py", line 305, in _response result = _multi_response(self, request) File "%PY2.6%/univention/management/console/modules/decorators.py", line 432, in _response for res in function(self, iterator, *nones): File "%PY2.6%/univention/management/console/modules/decorators.py", line 271, in _fake_func yield function(self, *args) File "%PY2.6%/univention/management/console/modules/join/__init__.py", line 303, in query files[name]['configured'] = False KeyError: '95ucc-2.0-lmz-desktop-efi-image.img'
(In reply to Florian Best from comment #10) > KeyError: '95ucc-2.0-lmz-desktop-efi-image.img' We got this feedback from at least 4 different UCS@school customers.
(In reply to Florian Best from comment #11) > (In reply to Florian Best from comment #10) > > KeyError: '95ucc-2.0-lmz-desktop-efi-image.img' > > We got this feedback from at least 4 different UCS@school customers. I merged every of this feedback to Ticket#2016081221000144.
Seen on paedML Linux 6.0 (UCS 3.2-8-errata445 DC Master) In the directory /usr/lib/univention-install were two files named "9595ucc-2.0-lmz-desktop-efi-image.img" and "9595ucc-2.0-lmz-desktop-image.img". There were also these two files with single "95" in the name. Deleting these two "9595" files led to the message "Joined successfully" in "univention-check-join-status".
We received the KeyError: '95ucc-2.0-lmz-desktop-efi-image.img' again, 3.2-8 errata445 (Borgfeld).
Reported again, 3.2-8 errata445 (Borgfeld) KeyError: '95ucc-2.0-lmz-desktop-efi-image.img'
Reported again, 3.2-8 errata447 (Borgfeld)
Reported again, 3.2-8 errata448 (Borgfeld)
Reproduce: cat > /usr/lib/univention-install/9595foo.inst <<EOF #!/bin/bash VERSION=1 . /usr/share/univention-join/joinscripthelper.lib joinscript_init joinscript_save_current_version exit 0 EOF cp /usr/lib/univention-install/9595foo.inst /usr/lib/univention-install/bar.inst The prefix of joinscripts must be [0-9][0-9]. This wasn't evaluated everywhere correctly. All the joinscript libs don't do real checks for the validity of the filenames, I didn't adjust this. Files without prefix/suffix are executed. univention-join (9.0.0-3): r73030 | Bug #32107: fix crash in UMC module during detection of joinscripts with invalid names Patch is backportable to UCS 3, but seems not necessary due to comment #17.
Reported again, 3.2-8 errata451 (Borgfeld)
Reported again, 3.2-8 errata453 (Borgfeld)
Reported again, 3.2-8 errata455 (Borgfeld)
Tested with UCS 4.2: without patch: /usr/lib/univention-install/9595foo.inst -> KeyError: '95foo' /usr/lib/univention-install/bar.inst -> KeyError: '/usr/lib/univention-install/bar' with patch: /usr/lib/univention-install/9595foo.inst -> no error: script is listed in Domain join module /usr/lib/univention-install/bar.inst -> no error: script is not listed in Domain join module OK, verified
UCS 4.2 has been released: https://docs.software-univention.de/release-notes-4.2-0-en.html https://docs.software-univention.de/release-notes-4.2-0-de.html If this error occurs again, please use "Clone This Bug".
Version: 3.3-1 errata44 (Osterholz) Remark: Vor langer Zeit wollte ich gerne UCC-Clients auf Desktops verwenden und habe UCC-Images installiert. Zusammenhang?