Bug 47640 - Lock UMC during installation
Lock UMC during installation
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Installer
UCS@school 4.3
Other Linux
: P5 normal (vote)
: UCS@school 4.3 v6-errata
Assigned To: Ole Schwiegert
Jürn Brodersen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-23 14:25 CEST by Valentin Heidelberger
Modified: 2019-03-16 22:09 CET (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?:
School Customer affected?: Yes
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 Valentin Heidelberger univentionstaff 2018-08-23 14:25:12 CEST
It's currently possible to open other UMC modules and do stuff in them while the @school installer runs. However, doing things like simply creating a user while the installer is running can cause weird behaviour. I encountered this with a customer who created just one user. The UMC immediately threw him out of the session and didn't let him in until the installer had "finished". 3 joinscripts weren't executed in the installation and we had to restart the UMC server for the login to work again.

I think the UMC should be locked, maybe with a pop-up opening if the user clicks on the home icon to open another module for example, during the installation of UCS@school and basically any app that can act weird if changes are made to the LDAP during the installation.
Comment 1 Valentin Heidelberger univentionstaff 2018-11-19 13:13:17 CET
Maybe the UMC could be locked with the functionality introduced with 4.3 e212 as well to make sure no-one else makes changes while the installer is running

http://forge.univention.org/bugzilla/show_bug.cgi?id=37223
http://errata.software-univention.de/ucs/4.3/212.html
Comment 2 Ole Schwiegert univentionstaff 2018-12-04 09:04:05 CET
In the discussion about this bug the scope was extended to look into the installation in general, identify problems and fix them as well if possible.
Here are the 'user errors' that could occur during the installation:

A user opens another schoolinstaller in the same session: Impossible since it is unique (OK)

A user opens another schoolinstaller in another session:
- The user can go through the wizard, but gets an error about a not getting a lock for the package manager when he starts the installation. (OK)
Comment 3 Ole Schwiegert univentionstaff 2018-12-04 09:11:00 CET
- After the installation of packages is done the join scripts run. If the process is started in the other session at that very moment then nothing happens except running the join scripts again. (OK ~)

If you close the session after starting the installation and then open the wizard again you get the same behavior as above (OK ~)

Original problem -> Performing other operations during the installation of UCS@school: I tried multiple times by doing arbitrary operations like adding/removing users and groups, installing other apps, etc and could only get an error one time. Though it seems that UCS@school installed fine anyway.
Comment 4 Ole Schwiegert univentionstaff 2018-12-04 09:58:32 CET
The functionality introduced in 4.3 e212 cannot be used here easily in my understanding. It requires the presence of files generated by univention-update.
Comment 5 Ole Schwiegert univentionstaff 2018-12-05 09:18:04 CET
Package: ucs-school-umc-installer
Version: 6.0.0-5A~4.3.0.201812050855
Branch: ucs_4.3-0
Scope: ucs-school-4.3

After multiple discussions in the UCS@school team we decided to not change any code here. We could not reproduce the problem you describe here. Also if there is actually potential for errors when doing other things during the installation we have a more serious problem in general with UCS.

If you can reproduce and document the collisions you describe we will have to take another look at it.
For now we decided to alter the manual and the final text in the installation wizard to recommend to the user to not do anything else during the UCS@school installation and improve the user guidance that way. The installation manual also gives information about what to to if you close the browser window now.
Comment 6 Jürn Brodersen univentionstaff 2018-12-05 17:15:27 CET
I was able to force a failed schema registration by producing a constant load on the server.

'''
while true; do udm users/user create --set username="$(makepasswd)" --set password="$(makepasswd)" --set lastname="$(makepasswd)"; done
'''

Which resulted in a traceback. But I don't think that is the problem described above nor is fixing that in the scope of this bug.

05.12.18 16:50:35.910  MODULE      ( ERROR   ) : Failed to execute create_ou: ['/usr/share/ucs-school-import/scripts/create_ou', '--displayName', 'hb', 'hb']
Traceback (most recent call last):
  File "/usr/share/ucs-school-import/scripts/create_ou", line 243, in <module>
    main()
  File "/usr/share/ucs-school-import/scripts/create_ou", line 232, in main
    create_ou(ou_name, display_name, edu_name, admin_name, share_name, lo, baseDN, hostname, is_single_master)
  File "/usr/share/ucs-school-import/scripts/create_ou", line 162, in create_ou
    new_school.create(lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 458, in create
    success = self.create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/school.py", line 420, in create_without_hooks
    success = super(School, self).create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 486, in create_without_hooks
    self.do_create(udm_obj, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 505, in do_create
    self._alter_udm_obj(udm_obj)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/school.py", line 466, in _alter_udm_obj
    return super(School, self)._alter_udm_obj(udm_obj)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 447, in _alter_udm_obj
    udm_obj[attr.udm_name] = value
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 377, in __setitem__
    self.descriptions[key]
KeyError: 'displayName'
Create OU: hb
Comment 7 Jürn Brodersen univentionstaff 2018-12-05 17:24:58 CET
(In reply to Valentin Heidelberger from comment #0)
> It's currently possible to open other UMC modules and do stuff in them while
> the @school installer runs. However, doing things like simply creating a
> user while the installer is running can cause weird behaviour. I encountered
> this with a customer who created just one user. The UMC immediately threw
> him out of the session and didn't let him in until the installer had
> "finished". 3 joinscripts weren't executed in the installation and we had to
> restart the UMC server for the login to work again.
> 
> I think the UMC should be locked, maybe with a pop-up opening if the user
> clicks on the home icon to open another module for example, during the
> installation of UCS@school and basically any app that can act weird if
> changes are made to the LDAP during the installation.

Getting thrown out of the umc session sounds like the umc web server crashed. Maybe the machine had not enough resources?
Comment 8 Jürn Brodersen univentionstaff 2018-12-05 17:45:10 CET
Looks good :)
Package: OK
Docu: OK
YAML: OK
Comment 9 Sönke Schwardt-Krummrich univentionstaff 2018-12-10 13:43:38 CET
UCS@school 4.3 v6 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.3v6-de.html#changelog:ucsschool:2018-12-10

If this error occurs again, please clone this bug.