Bug 43286

Summary: Fix all errors like "Type or value exists: value #1 provided more than once"
Product: UCS Reporter: Florian Best <best>
Component: UDM (Generic)Assignee: UMC maintainers <umc-maintainers>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P3 CC: best, botner, cristina.luengo, gohmann, petersen, requate, stoeckigt, thorp-hansen
Version: UCS 5.0Flags: best: Patch_Available+
Target Milestone: ---   
Hardware: Other   
OS: Linux   
URL: https://git.knut.univention.de/univention/ucs/-/merge_requests/339
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=47349
https://forge.univention.org/bugzilla/show_bug.cgi?id=49092
https://forge.univention.org/bugzilla/show_bug.cgi?id=50645
https://forge.univention.org/bugzilla/show_bug.cgi?id=51808
https://forge.univention.org/bugzilla/show_bug.cgi?id=53213
https://forge.univention.org/bugzilla/show_bug.cgi?id=52949
https://forge.univention.org/bugzilla/show_bug.cgi?id=52760
https://forge.univention.org/bugzilla/show_bug.cgi?id=54650
What kind of report is it?: Bug Report What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.171 Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): Debt Technical
Max CVSS v3 score:
Bug Depends on: 43247    
Bug Blocks:    
Attachments: patch
patch
patch (git:fbest/43286-fix-all-errors-like-type-or-value-exists)

Description Florian Best univentionstaff 2017-01-04 14:05:04 CET
In Bug #43247 it was fixed that groups/group detects different cases when adding / setting / modifying the group members.

The UDM-CLI server implements a different logic for --remove so that the logic of groups/group is never reached.

# eval "$(ucr shell)"
# udm computers/windows create --set name=mm187n3mhs
Object created: cn=mm187n3mhs,dc=AutoTest091,dc=local
# udm groups/group create --position "cn=groups,$ldap_base" --set name=i5ilw1abiq --set hosts="cn=mm187n3mhs,$ldap_base"
Object created: cn=i5ilw1abiq,cn=groups,dc=AutoTest091,dc=local
# udm groups/group modify --dn "cn=i5ilw1abiq,cn=groups,$ldap_base" --remove hosts="CN=mm187n3mhs,$ldap_base"
WARNING: cannot remove CN=mm187n3mhs,dc=AutoTest091,dc=local from hosts, value does not exist
No modification: cn=i5ilw1abiq,cn=groups,dc=AutoTest091,dc=local

+++ This bug was initially created as a clone of Bug #43247 +++
Comment 1 Florian Best univentionstaff 2017-01-04 16:43:44 CET
Created attachment 8330 [details]
patch

The syntax class of the groups/group properties hosts/nestedGroup/users has been adapted to have a comparision function.
This function is now evaluated by extending the API of simpleLDAP to include a method remove_value(). The logic from admincli has therefore been moved in a generic way into simpleLDAP. The same should be done for e.g. "append_value()".
Comment 2 Florian Best univentionstaff 2017-01-04 17:27:03 CET
Created attachment 8331 [details]
patch

Updated patch, which also implements the same logic for --append.
We can also replace/(revert some of) the manual adjustments done in groups/group.py (Bug #43247) when this patch is applied.
Comment 3 Florian Best univentionstaff 2017-06-29 19:13:17 CEST
*** Bug 41072 has been marked as a duplicate of this bug. ***
Comment 4 Florian Best univentionstaff 2017-07-04 13:03:28 CEST
*** Bug 12964 has been marked as a duplicate of this bug. ***
Comment 5 Stefan Gohmann univentionstaff 2019-01-03 07:22:48 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
Comment 6 Florian Best univentionstaff 2021-05-05 15:15:45 CEST
(In reply to Philipp Hahn from Bug #53213 comment #0)
> Remove IPv6.short
> -----------------
> udm computers/ipmanagedclient modify --dn cn=bug53165,$LB --remove
> ip=2001:1:2::f
> # WARNING: cannot remove 2001:1:2::f from ip, value does not exist
> # No modification: cn=bug53165,dc=phahn,dc=dev
> 
> It would be nice if UDM would expand IPv6 addresses itself

With the patch it should be possible to easily implement this as well.
Comment 7 Florian Best univentionstaff 2022-03-30 07:05:00 CEST
Created attachment 10935 [details]
patch (git:fbest/43286-fix-all-errors-like-type-or-value-exists)

rebased patch.
It fixes also comment #6.
Comment 8 Florian Best univentionstaff 2024-01-04 19:46:35 CET
Patch in: https://git.knut.univention.de/univention/ucs/-/merge_requests/339