Bug 53987 - Kelvin API can't handle counter larger than 100
Summary: Kelvin API can't handle counter larger than 100
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
Version: UCS@school 4.4
Hardware: Other Windows NT
: P5 normal
Target Milestone: ---
Assignee: Daniel Tröder
QA Contact: Tobias Wenzel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-25 22:51 CEST by Michael Grandjean
Modified: 2022-01-14 10:01 CET (History)
2 users (show)

See Also:
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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.286
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID: 10568
Max CVSS v3 score:


Attachments
Kelvin http.log (deleted)
2021-10-25 22:56 CEST, Michael Grandjean
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2021-10-25 22:51:32 CEST
root@ucs-001:~# univention-app info
UCS: 4.4-8 errata1072
Installed: self-service=4.0 self-service-backend=4.0 ucsschool=4.4 v9 ucsschool-id-connector=2.0.1 ucsschool-kelvin-rest-api=1.5.0 ucsschool-veyon-proxy=1.1
Upgradable: ucsschool-id-connector


Scenario: I want to create users via Kelvin API. I configure a username scheme in /var/lib/ucs-school-import/configs/kelvin.json that uses COUNTER2.


Observed behavior: I can only create users until counter "100". If I try to add the next user, which should get counter "101", there's  an error creating that user:

{"detail":"Error creating ImportTeacher(name='elements100', school='DEMOSCHOOL', dn='uid=elements100,cn=lehrer,cn=users,ou=DEMOSCHOOL,dc=example,dc=org', old_dn=None): {}"}

It looks as if the counter is not increased above 100:

root@ucs-001:~# univention-ldapsearch -LLL cn=elements
dn: cn=elements,cn=unique-usernames,cn=ucsschool,cn=univention,dc=example,dc=org
objectClass: ucsschoolUsername
cn: elements
ucsschoolUsernameNextNumber: 100

I will attach my simple test script, the kelvin.json config and the http.log of Kelvin.

----

Just for clarification: Going above 100 with COUNTER2 is possible using other import mechanisms such as the UMC-Module "Benutzerimport" (HTTP API / Newton) or "ucs-school-user-import" on the CLI. I verified this with another username:

dn: cn=colazero,cn=unique-usernames,cn=ucsschool,cn=univention,dc=example,dc=org
objectClass: ucsschoolUsername
cn: colazero
ucsschoolUsernameNextNumber: 111
Comment 6 Daniel Tröder univentionstaff 2021-10-27 08:46:16 CEST
[feature/kelvin 907ea84bf] Bug #53987: fix uldap fork and uldap usage
Comment 7 Daniel Tröder univentionstaff 2021-10-28 07:19:06 CEST
The Docker image for 1.5.1 has been rebuilt.
Comment 8 Tobias Wenzel univentionstaff 2021-11-01 09:38:47 CET
QA

OK code review
OK changelog
OK updated version 1.5.1
OK before fix: creation with test script fails 

2021-10-31 10:11:04 ERROR Error creating ImportTeacher(name='usertest100', school='DEMOSCHOOL', dn='uid=usertest100,cn=lehrer,cn=users,ou=DEMOSCHOOL,dc=dc-we,dc=intranet', old_dn=None): {}
2021-10-31 10:11:04 INFO  172.17.42.1:47064 - "POST /ucsschool/kelvin/v1/users/ HTTP/1.1" 400


OK after fix: succeeds
Comment 9 Tobias Wenzel univentionstaff 2022-01-14 10:01:21 CET
version 1.5.1 has been released