{"record":{"id":"b5a6949faaf54dd6","repo":"pentaho/pentaho-kettle","slug":"error-0007-unable-to-update-user","errorCode":"ERROR_0007_UNABLE_TO_UPDATE_USER","errorMessage":"UserRoleDelegate.ERROR_0007_UNABLE_TO_UPDATE_USER","messagePattern":"UserRoleDelegate\\.ERROR_0007_UNABLE_TO_UPDATE_USER","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/UserRoleDelegate.java","lineNumber":315,"sourceCode":"      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n          \"UserRoleDelegate.ERROR_0006_UNABLE_TO_GET_USERS\" ), e ); //$NON-NLS-1$\n    }\n  }\n\n  public void updateUser( IUser user ) throws KettleException {\n    ensureHasPermissions();\n\n    try {\n      ProxyPentahoUser proxyUser = UserRoleHelper.convertToPentahoProxyUser( user );\n      userRoleWebService.updateUser( proxyUser );\n      if ( user instanceof IEEUser ) {\n        userRoleWebService.setRoles( proxyUser, UserRoleHelper.convertToPentahoProxyRoles( ( (IEEUser) user )\n            .getRoles() ) );\n      }\n      lookupCache.updateUserInLookupSet( user );\n      fireUserRoleListChange();\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n          \"UserRoleDelegate.ERROR_0007_UNABLE_TO_UPDATE_USER\", user.getLogin() ), e ); //$NON-NLS-1$\n    }\n  }\n\n  public void createRole( IRole newRole ) throws KettleException {\n    ensureHasPermissions();\n\n    ProxyPentahoRole role = UserRoleHelper.convertToPentahoProxyRole( newRole );\n    try {\n      ProxyPentahoRole[] existingRoles = userRoleWebService.getRoles();\n      if ( existsAmong( existingRoles, role ) ) {\n        throw roleExistsException();\n      }\n    } catch ( UserRoleException e ) {\n      throw cannotCreateRoleException( newRole, e );\n    }\n\n    try {","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/UserRoleDelegate.java#L297-L333","documentation":"Thrown by UserRoleDelegate.updateUser(IUser) when persisting changes to a user fails via userRoleWebService (updateUsers or setRoles). The original exception is wrapped in a KettleException with ERROR_0007_UNABLE_TO_UPDATE_USER and the user's login name. Calls to ensureHasPermissions() precede it, so permission issues on the client side throw a different error; this one wraps server-side update failures.","triggerScenarios":"Calling updateUser(user) when updateUsers(...) or setRoles(...) throws: server rejects the update (validation, password policy), transport failure, expired session, or the user no longer exists server-side.","commonSituations":"Changing a password that violates server password policy; reassigning roles the client isn't allowed to manage; concurrent modification where the user was deleted by another admin.","solutions":["Inspect the cause for the server's rejection message.","Verify the user still exists before updating.","Ensure new values (password, description, roles) meet server policy.","Re-login if the session may have expired."],"exampleFix":"// before\nuserRoleDelegate.updateUser(user);\n// after\ntry {\n  userRoleDelegate.updateUser(user);\n} catch (KettleException e) {\n  logger.error(\"Update of \" + user.getLogin() + \" failed: \" + e.getCause(), e);\n}","handlingStrategy":"try-catch","validationCode":"if (userRoleDelegate.getUser(user.getLogin()) == null) {\n  throw new IllegalStateException(\"User no longer exists: \" + user.getLogin());\n}","typeGuard":null,"tryCatchPattern":"try {\n  userRoleDelegate.updateUser(user);\n} catch (KettleException e) {\n  log.error(\"Update of \" + user.getLogin() + \" failed: \" + e.getCause(), e);\n}","preventionTips":["Reload the user from the server before modifying to avoid stale state.","Validate password/role changes against server policy first.","Handle concurrent deletions by other admins.","Re-login if the session may have expired."],"tags":["pentaho","user-management","webservice","kettle"],"backgroundTag":"api-error-response","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}