pentaho/pentaho-kettle · error · KettleException

ERROR_0004_UNABLE_TO_DELETE_USER

ERROR_0004_UNABLE_TO_DELETE_USER

Error message

UserRoleDelegate.ERROR_0004_UNABLE_TO_DELETE_USER

What it means

Thrown by UserRoleDelegate.deleteUser(String) when the named user cannot be found, so no ProxyPentahoUser can be constructed and the delete call is never made. It is raised in the explicit `user == null` branch: lookupUser returned nothing for the given name. Message key ERROR_0004_UNABLE_TO_DELETE_USER includes the user name.

Solutions

  1. Verify the user name exists via getUsers() or the Pentaho User Console before deleting.
  2. Check name spelling and case against the server's list.
  3. Ensure you are connected to the intended Pentaho repository/tenant.

Example fix

// before
userRoleDelegate.deleteUser("jdoe"); // fails if jdoe doesn't exist
// after
if (userRoleDelegate.getUser("jdoe") != null) {
  userRoleDelegate.deleteUser("jdoe");
}
Defensive patterns

Strategy: validation

Validate before calling

boolean exists = userRoleDelegate.getUsers().stream()
    .anyMatch(u -> u.getLogin().equals(name));
if (!exists) { log.warn("User " + name + " not found; skipping delete"); return; }

Try / catch

try {
  userRoleDelegate.deleteUser(name);
} catch (KettleException e) {
  if (e.getCause() == null) { log.warn("User not found: " + name); }
}

Prevention

When it happens

Trigger: Calling deleteUser(name) where the name does not exist in the Pentaho security database (lookupUser returned null), i.e. a plain misspelling, a deleted user, or a user living in a different tenant/workspace.

Common situations: Scripts cleaning up users after a stale metadata export; case-sensitivity mismatches ('Admin' vs 'admin'); connecting to a different repository than the one the user list came from.

Understand the failure class

Background: "User not found", "Invalid user", and "does not exist": what missing-user lookup errors mean across Rocket.Chat, LiteLLM, Phabricator, rustfs, and pnpm — this error's family across 10 libraries.

Related errors


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

Appendix: source

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

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

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

    try {
      ProxyPentahoUser user = userRoleWebService.getUser( name );
      if ( user != null ) {
        ProxyPentahoUser[] users = new ProxyPentahoUser[1];
        users[0] = user;
        userRoleWebService.deleteUsers( users );
        fireUserRoleListChange();
      } else {
        throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,
            "UserRoleDelegate.ERROR_0004_UNABLE_TO_DELETE_USER", name ) ); //$NON-NLS-1$
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,
          "UserRoleDelegate.ERROR_0004_UNABLE_TO_DELETE_USER", name ), e ); //$NON-NLS-1$
    }
  }

  public void setUsers( List<IUser> users ) throws KettleException {
    // TODO Figure out what to do here
  }

  public IUser getUser( String name, String password ) throws KettleException {
    ensureHasPermissions();

    IUser userInfo = null;
    try {
      ProxyPentahoUser user = userRoleWebService.getUser( name );

View on GitHub (pinned to f3058517a1)