{"record":{"id":"0ca372cfa2094d55","repo":"pentaho/pentaho-kettle","slug":"userinfo-error-usernotloaded","errorCode":null,"errorMessage":"UserInfo.Error.UserNotLoaded","messagePattern":"UserInfo\\.Error\\.UserNotLoaded","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryUserDelegate.java","lineNumber":72,"sourceCode":"    try {\n      userInfo.setObjectId( getUserID( login ) );\n      if ( userInfo.getObjectId() != null ) {\n        RowMetaAndData r = getUser( userInfo.getObjectId() );\n        if ( r != null ) {\n          userInfo.setLogin( r.getString( \"LOGIN\", null ) );\n          userInfo.setPassword( Encr.decryptPassword( r.getString( \"PASSWORD\", null ) ) );\n          userInfo.setUsername( r.getString( \"NAME\", null ) );\n          userInfo.setDescription( r.getString( \"DESCRIPTION\", null ) );\n          userInfo.setEnabled( r.getBoolean( \"ENABLED\", false ) );\n          return userInfo;\n        } else {\n          throw new KettleDatabaseException( BaseMessages.getString( PKG, \"UserInfo.Error.UserNotFound\", login ) );\n        }\n      } else {\n        throw new KettleDatabaseException( BaseMessages.getString( PKG, \"UserInfo.Error.UserNotFound\", login ) );\n      }\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"UserInfo.Error.UserNotLoaded\", login, \"\" ), dbe );\n    }\n  }\n\n  /**\n   * Load user with login from repository and verify the password...\n   *\n   * @param rep\n   * @param login\n   * @param passwd\n   * @throws KettleException\n   */\n  public IUser loadUserInfo( IUser userInfo, String login, String passwd ) throws KettleException {\n    if ( userInfo == null || login == null || login.length() <= 0 ) {\n      throw new KettleDatabaseException( BaseMessages.getString( PKG, \"UserInfo.Error.IncorrectPasswortLogin\" ) );\n    }\n\n    try {\n      loadUserInfo( userInfo, login );","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryUserDelegate.java#L54-L90","documentation":"The outer wrapper in loadUserInfo(): any KettleDatabaseException raised while loading the user — including the UserNotFound throws above — is caught and re-thrown as KettleException with message UserInfo.Error.UserNotLoaded plus the login. This is the exception callers actually receive; check its cause to distinguish 'no such user' from a database access failure.","triggerScenarios":"Any failure in loadUserInfo(login): unknown login (UserNotFound cause), failed query against R_USER, connection error, or decryption failure while reading the stored password.","commonSituations":"Repository login/auth flows (including verifyLogin) hitting a nonexistent user, an unreachable repository DB, or password encryption inconsistencies after moving a repository between environments.","solutions":["Unwrap e.getCause() (KettleDatabaseException) to see if it is UserNotFound or a real DB failure","If user-not-found: verify/create the login in R_USER","If DB failure: check connectivity, grants on R_USER, and schema version","Use rep.getUserManager()/user listing API to validate the login before calling loadUserInfo"],"exampleFix":"// before\nUserInfo user = rep.loadUserInfo(login); // UserNotLoaded wraps everything\n\n// after\ntry {\n  UserInfo user = rep.loadUserInfo(login);\n} catch (KettleException e) {\n  Throwable cause = e.getCause();\n  logError(\"User load failed for \" + login + \": \" + cause.getMessage(), e);\n  // branch on cause: missing user vs. database problem\n}","handlingStrategy":"try-catch","validationCode":"// Java: pre-check user existence to avoid the wrapper entirely\n// SELECT COUNT(*) FROM R_USER WHERE NAME = ?\nboolean exists = ...;\nif (!exists) throw new IllegalArgumentException(\"User not in repository: \" + login);","typeGuard":null,"tryCatchPattern":"try {\n  UserInfo user = rep.loadUserInfo(login);\n} catch (KettleException e) {\n  Throwable cause = e.getCause(); // KettleDatabaseException\n  if (String.valueOf(cause == null ? \"\" : cause.getMessage()).contains(\"UserNotFound\")) {\n    log.warn(\"Unknown user: \" + login);\n  } else {\n    log.error(\"DB failure loading user \" + login + \": \" + cause, e);\n  }\n}","preventionTips":["Always inspect getCause() — UserNotLoaded hides the real reason","Distinguish user-not-found from database outages in error handling","Verify repository connectivity and R_USER grants in deployment checks","Keep password encryption settings consistent when cloning repositories across environments"],"tags":["repository","kettle","user","authentication","wrapper-exception"],"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"}