Bug 1343213

Summary: IDM fires DatabaseError when updating user which has a login with 4 chars long
Product: Red Hat Enterprise Linux 7 Reporter: deco <deco>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Kaleem <ksiddiqu>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.1CC: deco, pvoborni, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-17 13:15:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description deco 2016-06-06 20:13:18 UTC
Description of problem:

Cannot update user when its login is lower than 5 chars with user_mod.


Version-Release number of selected component (if applicable):

[root@ibpidm01 ~]# cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.1 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.1"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.1:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.1
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.1"
Red Hat Enterprise Linux Server release 7.1 (Maipo)


How reproducible:

Code a client to authenticate, add and update users using RedHat's IPA JSON API.



Steps to Reproduce:

Add a new user with login name "nana" (user_add) and try to update user data finding with (user_mod).
Perhaps there is a problem with user_mod function when trying to find the created user. User_mod fires 4203, Type or value exists, DatabaseError exception.



Actual results (FROM ERROR_LOG):

FIRST AUTHENTICATE USER AS ADMIN, THEN ADD USER, LOGIN HAS HERE 5 CHARS LONG

[Mon Jun 06 15:41:18.585157 2016] [:error] [pid 37981] ipa: INFO: [jsonserver_session] admin@XYZ: user_add(u'nanas', givenname=u'Johanna', sn=u'Sanchez', mail=u'johanna', userpassword=u'********', random=False, noprivate=False, all=False, raw=False, no_members=False): SUCCESS


UPDATE USER DATA (LOGIN WON'T BE AFFECTED)
[Mon Jun 06 15:41:23.661572 2016] [:error] [pid 37981] ipa: INFO: [jsonserver_session] admin@XYZ: user_mod(u'nanas', givenname=u'Joha', sn=u'Sanchez', cn=u'Joha Sanchez', displayname=u'Joha Sanchez', gecos=u'Joha Sanchez', mail=u'johanna', userpassword=u'********', random=False, rights=False, all=False, raw=False, no_members=False): SUCCESS


FIRST AUTHENTICATE USER AS ADMIN, THEN ADD USER, LOGIN HAS HERE 4 CHARS LONG

[Mon Jun 06 15:41:18.585157 2016] [:error] [pid 37981] ipa: INFO: [jsonserver_session] admin@XYZ: user_add(u'nana', givenname=u'Johanna', sn=u'Sanchez', mail=u'johanna', userpassword=u'********', random=False, noprivate=False, all=False, raw=False, no_members=False): SUCCESS


UPDATE USER DATA (LOGIN WON'T BE AFFECTED) -> exception fires because user login is 4 chars long?

[Mon Jun 06 15:30:44.843877 2016] [:error] [pid 37981] ipa: INFO: [jsonserver_session] admin@XYZ: user_mod(u'nana', givenname=u'Joha', sn=u'Sanchez', cn=u'Joha Sanchez', displayname=u'Joha Sanchez', gecos=u'Joha Sanchez', mail=u'johanna', userpassword=u'********', random=False, rights=False, all=False, raw=False, no_members=False): DatabaseError


Expected results:

Any lenght constraint should be returned in exception errors. "Type or value exists" is not helpful.

I understand that login won't be updated and the is correct, but the other user fields should get updated and find by login with 4 chars should be possible.

Comment 1 deco 2016-06-06 20:27:38 UTC
I have repeated the tests by adding and updating users, now login is not interfering anymore in user_mod, not sure why it is working now. 

I think any constraint such as Field lenght restriction in IPA (IDM) could be added in JSON IPA error messages.

Comment 2 Rob Crittenden 2016-06-06 20:46:33 UTC
I don't think the issue is with login name length, it has to do with this particular entry and the data being changed.

Type or value exists occurs when you try to add the same value to a multi-valued attribute, for example. Just nothing is jumping out at me, this looks fairly benign.

It might be helpful to see the command-line you're using, or are you using the UI?

Comment 4 Petr Vobornik 2016-06-17 13:15:11 UTC
We are not able to reproduce this issue. Closing until more info is known.

Comment 5 Red Hat Bugzilla 2023-09-14 03:26:27 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days