Bug 1343213 - IDM fires DatabaseError when updating user which has a login with 4 chars long [NEEDINFO]
Summary: IDM fires DatabaseError when updating user which has a login with 4 chars long
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Kaleem
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-06 20:13 UTC by deco
Modified: 2016-06-17 13:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-17 13:15:11 UTC
Target Upstream Version:
rcritten: needinfo? (deco)


Attachments (Terms of Use)

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@outlook.com', 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@gmail.com', 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@outlook.com', 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@hotmail.com', 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.


Note You need to log in before you can comment on or make changes to this bug.