You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2018/01/31 10:58:00 UTC

[jira] [Commented] (AMBARI-22882) Long cannot be cast to String error when changing a user's password

    [ https://issues.apache.org/jira/browse/AMBARI-22882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346602#comment-16346602 ] 

Hudson commented on AMBARI-22882:
---------------------------------

FAILURE: Integrated in Jenkins build Ambari-trunk-Commit #8660 (See [https://builds.apache.org/job/Ambari-trunk-Commit/8660/])
[AMBARI-22882] Long cannot be cast to String error when changing a (rlevas: [https://gitbox.apache.org/repos/asf?p=ambari.git&a=commit&h=e40e7e5bfcfffac78351278d74e1310a8aa35cc5])
* (edit) ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserResourceProviderTest.java
* (edit) ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UserResourceProvider.java


> Long cannot be cast to String error when changing a user's password
> -------------------------------------------------------------------
>
>                 Key: AMBARI-22882
>                 URL: https://issues.apache.org/jira/browse/AMBARI-22882
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-server
>    Affects Versions: 2.7.0
>            Reporter: Robert Levas
>            Assignee: Robert Levas
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 2.7.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Long cannot be cast to String error when changing a user's password:
> {noformat}
> 30 Jan 2018 18:21:11,308 ERROR [ambari-client-thread-38] AbstractResourceProvider:353 - Caught AmbariException when modifying a resource
> org.apache.ambari.server.AmbariException: java.lang.Long cannot be cast to java.lang.String
> at org.apache.ambari.server.controller.internal.UserResourceProvider.addOrUpdateLocalAuthenticationSource(UserResourceProvider.java:559)
> at org.apache.ambari.server.controller.internal.UserResourceProvider.updateUsers(UserResourceProvider.java:486)
> at org.apache.ambari.server.controller.internal.UserResourceProvider.access$200(UserResourceProvider.java:69)
> at org.apache.ambari.server.controller.internal.UserResourceProvider$3.invoke(UserResourceProvider.java:264)
> at org.apache.ambari.server.controller.internal.UserResourceProvider$3.invoke(UserResourceProvider.java:261)
> at org.apache.ambari.server.controller.internal.AbstractResourceProvider.invokeWithRetry(AbstractResourceProvider.java:465)
> at org.apache.ambari.server.controller.internal.AbstractResourceProvider.modifyResources(AbstractResourceProvider.java:346)
> at org.apache.ambari.server.controller.internal.UserResourceProvider.updateResources(UserResourceProvider.java:261)
> at org.apache.ambari.server.controller.internal.ClusterControllerImpl.updateResources(ClusterControllerImpl.java:317)
> ...
> {noformat}
> *Steps to reproduce*
>  # Create a {{LOCAL}} user account (using either the Ambari UI or REST API)
> {noformat}
> POST /api/v1/users
> {noformat}
> {code:title=Payload}
> { 
>   "Users" : {
>     "user_name" : "myuser",
>     "password" : "hadoop"
>   }
> }
> {code}
>  # Change the user's password (using either the Ambari UI or REST API via the users entry point)
> {noformat}
> PUT /api/v1/users/myuser
> {noformat}
> {code:title=Payload}
> { 
>   "Users" : {
>     "old_password" : "hadoop"
>     "password" : "hadoop1234"
>   }
> }
> {code}
> {code:title=Response}
> {
>   "status" : 500,
>   "message" : "org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: java.lang.Long cannot be cast to java.lang.String"
> }
> {code}
> *Cause*
> When building the internal request to set the user's password via the UserAuthenticationSource resource provider, the authentication source key is set as a {{Long}}. The UserAuthenticationSource resource provider expects this value to be a {{String}}.
> *Solution*
> The User resource provider should set the {{AuthenticationSourceInfo/source_id}} as a {{String}} value.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)