{"record":{"id":"af3314db419068c8","repo":"pentaho/pentaho-kettle","slug":"error-0012-unable-to-update-role","errorCode":"ERROR_0012_UNABLE_TO_UPDATE_ROLE","errorMessage":"UserRoleDelegate.ERROR_0012_UNABLE_TO_UPDATE_ROLE","messagePattern":"UserRoleDelegate\\.ERROR_0012_UNABLE_TO_UPDATE_ROLE","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/UserRoleDelegate.java","lineNumber":431,"sourceCode":"    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n          \"UserRoleDelegate.ERROR_0011_UNABLE_TO_GET_ROLES\" ), e ); //$NON-NLS-1$\n    }\n  }\n\n  public void updateRole( IRole role ) throws KettleException {\n    ensureHasPermissions();\n\n    try {\n      List<String> users = new ArrayList<String>();\n      for ( IUser user : role.getUsers() ) {\n        users.add( user.getLogin() );\n      }\n      userRoleWebService.updateRole( role.getName(), role.getDescription(), users );\n      lookupCache.updateRoleInLookupSet( role );\n      fireUserRoleListChange();\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n          \"UserRoleDelegate.ERROR_0012_UNABLE_TO_UPDATE_ROLE\", role.getName() ), e ); //$NON-NLS-1$\n    }\n  }\n\n  public void deleteRole( String name ) throws KettleException {\n    ensureHasPermissions();\n\n    try {\n      ProxyPentahoRole roleToDelete = UserRoleHelper.getProxyPentahoRole( userRoleWebService, name );\n      if ( roleToDelete != null ) {\n        ProxyPentahoRole[] roleArray = new ProxyPentahoRole[1];\n        roleArray[0] = roleToDelete;\n        userRoleWebService.deleteRoles( roleArray );\n        fireUserRoleListChange();\n      } else {\n        throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n            \"UserRoleDelegate.ERROR_0013_UNABLE_TO_DELETE_ROLE\", name ) ); //$NON-NLS-1$\n      }","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/UserRoleDelegate.java#L413-L449","documentation":"Thrown by UserRoleDelegate.updateRole() when updating a role via userRoleWebService (name, description, assigned users) fails. The delegate catches any Exception and wraps it in a KettleException with key ERROR_0012_UNABLE_TO_UPDATE_ROLE including the role name. The local lookup cache and change listeners are only updated after the web-service call succeeds.","triggerScenarios":"Calling updateRole(IRole) where userRoleWebService.updateRole throws: role no longer exists on the server, user logins in the list don't exist, session expired, or network/permission failure to the Pentaho security web service.","commonSituations":"Assigning a user that was deleted on the server; role renamed/deleted by another admin concurrently; insufficient privileges (non-admin user); server connection lost.","solutions":["Inspect the wrapped cause for the web-service error detail","Verify the role still exists on the BA Server before updating","Ensure all user logins passed in exist on the server","Confirm the connected user has admin permissions","Reconnect to the repository if the session expired"],"exampleFix":"// before\nrole.setDescription( \"New desc\" );\nroleDelegate.updateRole( role );\n// after\ntry {\n  role.setDescription( \"New desc\" );\n  roleDelegate.updateRole( role );\n} catch ( KettleException e ) {\n  logError( \"Failed to update role \" + role.getName(), e );\n}","handlingStrategy":"try-catch","validationCode":"// verify role and users exist first\nIRole existing = delegate.findRole( role.getName() );\nif ( existing != null && role.getUsers() != null ) { /* safe to update */ }","typeGuard":null,"tryCatchPattern":"try { delegate.updateRole( role ); } catch ( KettleException e ) { logError( \"Update of role \" + role.getName() + \" failed\", e ); }","preventionTips":["Confirm the role exists server-side before updating","Ensure referenced user logins exist on the server","Use an admin account for role mutations"],"tags":["kettle","pentaho","roles","web-service"],"backgroundTag":"api-request-failed","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"}