pentaho/pentaho-kettle · error · KettleException

ERROR_0012_UNABLE_TO_UPDATE_ROLE

ERROR_0012_UNABLE_TO_UPDATE_ROLE

Error message

UserRoleDelegate.ERROR_0012_UNABLE_TO_UPDATE_ROLE

What it means

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.

Solutions

  1. Inspect the wrapped cause for the web-service error detail
  2. Verify the role still exists on the BA Server before updating
  3. Ensure all user logins passed in exist on the server
  4. Confirm the connected user has admin permissions
  5. Reconnect to the repository if the session expired

Example fix

// before
role.setDescription( "New desc" );
roleDelegate.updateRole( role );
// after
try {
  role.setDescription( "New desc" );
  roleDelegate.updateRole( role );
} catch ( KettleException e ) {
  logError( "Failed to update role " + role.getName(), e );
}
Defensive patterns

Strategy: try-catch

Validate before calling

// verify role and users exist first
IRole existing = delegate.findRole( role.getName() );
if ( existing != null && role.getUsers() != null ) { /* safe to update */ }

Try / catch

try { delegate.updateRole( role ); } catch ( KettleException e ) { logError( "Update of role " + role.getName() + " failed", e ); }

Prevention

When it happens

Trigger: 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.

Common situations: Assigning a user that was deleted on the server; role renamed/deleted by another admin concurrently; insufficient privileges (non-admin user); server connection lost.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/af3314db419068c8. Report an issue: GitHub.

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/UserRoleDelegate.java:431

    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,
          "UserRoleDelegate.ERROR_0011_UNABLE_TO_GET_ROLES" ), e ); //$NON-NLS-1$
    }
  }

  public void updateRole( IRole role ) throws KettleException {
    ensureHasPermissions();

    try {
      List<String> users = new ArrayList<String>();
      for ( IUser user : role.getUsers() ) {
        users.add( user.getLogin() );
      }
      userRoleWebService.updateRole( role.getName(), role.getDescription(), users );
      lookupCache.updateRoleInLookupSet( role );
      fireUserRoleListChange();
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,
          "UserRoleDelegate.ERROR_0012_UNABLE_TO_UPDATE_ROLE", role.getName() ), e ); //$NON-NLS-1$
    }
  }

  public void deleteRole( String name ) throws KettleException {
    ensureHasPermissions();

    try {
      ProxyPentahoRole roleToDelete = UserRoleHelper.getProxyPentahoRole( userRoleWebService, name );
      if ( roleToDelete != null ) {
        ProxyPentahoRole[] roleArray = new ProxyPentahoRole[1];
        roleArray[0] = roleToDelete;
        userRoleWebService.deleteRoles( roleArray );
        fireUserRoleListChange();
      } else {
        throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,
            "UserRoleDelegate.ERROR_0013_UNABLE_TO_DELETE_ROLE", name ) ); //$NON-NLS-1$
      }

View on GitHub (pinned to f3058517a1)