RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1343213 - IDM fires DatabaseError when updating user which has a login with 4 chars long
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: 2023-09-14 03:26 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:
Embargoed:


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', 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


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