Bug 47408 - School model always tries to create given dc_name
School model always tries to create given dc_name
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Ucsschool-lib
UCS@school 4.3
Other Linux
: P5 normal (vote)
: UCS@school 4.3 v6
Assigned To: Ole Schwiegert
Jürn Brodersen
:
Depends on:
Blocks: 46765
  Show dependency treegraph
 
Reported: 2018-07-30 09:39 CEST by Ole Schwiegert
Modified: 2018-11-16 11:48 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
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?:
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 Ole Schwiegert univentionstaff 2018-07-30 09:39:32 CEST
When you create a new School with the ucsschool-lib and give a dc_name the model always tries to create the computer object in the ldap even if that computer already exists. Which causes an uidAlreadyUsed Exception.

This is a problem with the new create_ou script that is under development since it now uses the lib instead of manipulating the ldap directly. Right now it would not be possible to supply an educational dc that already exists.
This has to be handled.

We probably have to check in the school model if a PC with given name already exists and instead of creating a new one then, alter the existing object. Also we would have to check first if it is a master, slave or backup, since backup and master do not get the group addition (look at old ucs-school-import script)
Comment 1 Ole Schwiegert univentionstaff 2018-07-31 08:29:15 CEST
A fix has been added in oschwieg/4.3/47408
Has to be tested before build.
Comment 2 Jürn Brodersen univentionstaff 2018-09-04 13:42:06 CEST
Some quick feedback:

there seems to be some debug code left :)
* remove debug print and change "==" to "in" (but due to the next point that probably needs to be rewritten anyways)
* the computer name comparison should be case insensitive (the name is saved with its case in the ldap but some services ignore the case)
* merge check for backup and master if possible
* set role on existing servers if feature is activated

If it's not to much work, could you write for this?
Comment 3 Ole Schwiegert univentionstaff 2018-10-02 09:39:52 CEST
Package: ucs-school-lib
Version: 11.0.1-23A~4.3.0.201810020936
Comment 4 Jürn Brodersen univentionstaff 2018-10-18 12:31:21 CEST
Please use filter_format from ldap.filter to build the ldap filters.

I think the school lib needs some additional validation before these changes can be released :(
Setting a backup server as an edu server should throw an error.
Setting a master server as an edu server should check if the domain is a single server domain.
I can add an already existing school which throws a "notification" but adds the edu server anyways. (I'm not sure if that is indented behavior...)

Should the existing computer object moved into the ou it will manage? New edu servers are created there.
Comment 5 Ole Schwiegert univentionstaff 2018-10-24 09:02:18 CEST
Package: ucs-school-lib
Version: 11.0.1-27A~4.3.0.201810240853

As discussed I only implemented validation for dc_names referencing backups and masters in multi server envs.
To not stretch the scope of this bug I opened another (Bug #48048) to handle further improvements to validation and handling of dcs in the School object.
Comment 6 Jürn Brodersen univentionstaff 2018-10-29 11:45:21 CET
Small YAML change
[4.3 839b31e1f] Bug #47408: YAML

What I tested:
Backup as school server -> Error massage -> OK
Existing slave as school server -> OK
Non existing slave as school server -> OK

-> Verified
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2018-11-16 11:48:22 CET
UCS@school 4.3 v6 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.3v6-de.html

If this error occurs again, please clone this bug.