Nahappan Somasundaram created AMBARI-17350:
----------------------------------------------

             Summary: If two users are created differing in case then no users 
are shown due to error
                 Key: AMBARI-17350
                 URL: https://issues.apache.org/jira/browse/AMBARI-17350
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 2.4.0
            Reporter: Nahappan Somasundaram
            Assignee: Nahappan Somasundaram
            Priority: Critical
             Fix For: 2.4.0


When usernames that differ only by case are created, no users are show in the 
when clicking the Users link in Ambari Management page due to the following 
error.

The fix is to block creating usernames that differ only by case.

{code}
12 Jun 2016 03:59:28,569  WARN [ambari-client-thread-559] ServletHandler:628 - 
/api/v1/users/
javax.persistence.NonUniqueResultException: More than one result was returned 
from Query.getSingleResult()
        at 
org.eclipse.persistence.internal.jpa.QueryImpl.throwNonUniqueResultException(QueryImpl.java:980)
        at 
org.eclipse.persistence.internal.jpa.QueryImpl.getSingleResult(QueryImpl.java:529)
        at 
org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:400)
        at 
org.apache.ambari.server.orm.dao.UserDAO.findUserByName(UserDAO.java:69)
        at 
org.apache.ambari.server.orm.AmbariLocalSessionInterceptor.invoke(AmbariLocalSessionInterceptor.java:53)
        at 
org.apache.ambari.server.controller.internal.ActiveWidgetLayoutResourceProvider.getResources(ActiveWidgetLayoutResourceProvider.java:161)
        at 
org.apache.ambari.server.controller.internal.ClusterControllerImpl$ExtendedResourceProviderWrapper.queryForResources(ClusterControllerImpl.java:966)
        at 
org.apache.ambari.server.controller.internal.ClusterControllerImpl.getResources(ClusterControllerImpl.java:141)
        at 
org.apache.ambari.server.api.query.QueryImpl.doQuery(QueryImpl.java:512)
        at 
org.apache.ambari.server.api.query.QueryImpl.queryForSubResources(QueryImpl.java:464)
...
{code}

{code}
select * from users ;
***(press return to proceed or enter x and return to cancel)********************

 user_id | principal_id | ldap_user | user_name | user_type |        
create_time         |                                  user_password            
                       | active | active
_widget_layouts
---------+--------------+-----------+-----------+-----------+----------------------------+----------------------------------------------------------------------------------+--------+-------
----------------
       1 |            1 |         0 | admin     | LOCAL     | 2016-06-11 
16:08:51.300678 | 
538916f8943ec225d97a9a86a2c6ec0818c1cd400e09e03b660fdaaec4af29ddbb6f2b1033b81b00
 |      1 | [{"id"
:"6"}]
       3 |           14 |         0 | Abcd      | LOCAL     | 2016-06-12 
03:58:38.944    | 
ee677dc216a63092fd1e4dbb56c3661dcca0053feae5968bdf82e15cb95e9b83747f1b7d25c3badc
 |      1 |
       4 |           15 |         0 | abcd      | LOCAL     | 2016-06-12 
03:58:49.32     | 
f941a9570f1b42f2f74b164e9e419fb7d63660681e3ccd9e9313f0369c6d5d03e3249fcfc1fd835e
 |      1 |
(3 rows)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to