{"record":{"id":"a2ec7a02edb4b888","repo":"pentaho/pentaho-kettle","slug":"error-0005-unable-to-get-user","errorCode":"ERROR_0005_UNABLE_TO_GET_USER","errorMessage":"UserRoleDelegate.ERROR_0005_UNABLE_TO_GET_USER","messagePattern":"UserRoleDelegate\\.ERROR_0005_UNABLE_TO_GET_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":267,"sourceCode":"          \"UserRoleDelegate.ERROR_0004_UNABLE_TO_DELETE_USER\", name ), e ); //$NON-NLS-1$\n    }\n  }\n\n  public void setUsers( List<IUser> users ) throws KettleException {\n    // TODO Figure out what to do here\n  }\n\n  public IUser getUser( String name, String password ) throws KettleException {\n    ensureHasPermissions();\n\n    IUser userInfo = null;\n    try {\n      ProxyPentahoUser user = userRoleWebService.getUser( name );\n      if ( user != null && user.getName().equals( name ) && user.getPassword().equals( password ) ) {\n        userInfo = UserRoleHelper.convertToUserInfo( user, userRoleWebService.getRolesForUser( user ), rsm );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n          \"UserRoleDelegate.ERROR_0005_UNABLE_TO_GET_USER\", name ), e ); //$NON-NLS-1$\n    }\n    return userInfo;\n  }\n\n  public IUser getUser( String name ) throws KettleException {\n    ensureHasPermissions();\n\n    IUser userInfo = null;\n    try {\n      ProxyPentahoUser user = userRoleWebService.getUser( name );\n      if ( user != null && user.getName().equals( name ) ) {\n        userInfo = UserRoleHelper.convertToUserInfo( user, userRoleWebService.getRolesForUser( user ), rsm );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( UserRoleDelegate.class,\n          \"UserRoleDelegate.ERROR_0005_UNABLE_TO_GET_USER\", name ), e ); //$NON-NLS-1$\n    }","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/UserRoleDelegate.java#L249-L285","documentation":"Thrown by the password-accepting getUser(String name, String password) overload when the user lookup or authentication fails. The delegate wraps any exception from userRoleWebService.getUser/getRolesForUser in a KettleException with ERROR_0005_UNABLE_TO_GET_USER. Note it also returns null silently when the user exists but name/password don't match — this error fires only on exceptions (server/transport failures, missing user causing remote errors).","triggerScenarios":"Calling getUser(name, password) when the web service call throws: server unreachable, session invalid, or the user does not exist and the server errors instead of returning null.","commonSituations":"Authentication checks against a Pentaho repository with an unreachable server, wrong tenant, or a SOAP/HTTP failure; programmatic login validation in Spoon plugins.","solutions":["Check the cause for the underlying server/transport error.","Verify server connectivity and that the repository session is valid.","Confirm the user exists before authenticating (getUsers()/User Console)."],"exampleFix":"// before\nIUserInfo info = delegate.getUser(\"bob\", \"secret\"); // throws on server failure\n// after\nIUserInfo info = null;\ntry {\n  info = delegate.getUser(\"bob\", \"secret\");\n} catch (KettleException e) {\n  logger.error(\"Lookup failed: \" + e.getCause(), e);\n}\nif (info != null) { /* authenticated */ }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  IUserInfo info = userRoleDelegate.getUser(name, password);\n  if (info == null) { /* bad credentials */ }\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  log.error(\"Auth check failed: \" + (cause != null ? cause.getLocalizedMessage() : \"unknown\"), e);\n}","preventionTips":["Treat null return as 'wrong credentials' and exception as 'infrastructure failure' — handle them differently.","Verify server availability before auth flows.","Don't assume a server error means bad password."],"tags":["pentaho","authentication","webservice"],"backgroundTag":"user-not-found","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"}