{"record":{"id":"d5a648d33b5a5311","repo":"pentaho/pentaho-kettle","slug":"userinfo-error-savinguser","errorCode":null,"errorMessage":"UserInfo.Error.SavingUser","messagePattern":"UserInfo\\.Error\\.SavingUser","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryUserDelegate.java","lineNumber":124,"sourceCode":"      // Do we have a user id already?\n      if ( userInfo.getObjectId() == null ) {\n        userInfo.setObjectId( getUserID( userInfo.getLogin() ) ); // Get userid in the repository\n      }\n\n      if ( userInfo.getObjectId() == null ) {\n        // This means the login doesn't exist in the database\n        // and we have no id, so we don't know the old one...\n        // Just grab the next user ID and do an insert:\n        userInfo.setObjectId( repository.connectionDelegate.getNextUserID() );\n        repository.connectionDelegate.insertTableRow( \"R_USER\", fillTableRow( userInfo ) );\n      } else {\n        repository.connectionDelegate.updateTableRow( \"R_USER\", \"ID_USER\", fillTableRow( userInfo ) );\n      }\n\n      // Put a commit behind it!\n      repository.commit();\n    } catch ( KettleDatabaseException dbe ) {\n      throw new KettleException(\n        BaseMessages.getString( PKG, \"UserInfo.Error.SavingUser\", userInfo.getLogin() ), dbe );\n    }\n\n  }\n\n  public RowMetaAndData fillTableRow( IUser userInfo ) {\n    RowMetaAndData r = new RowMetaAndData();\n    r.addValue( new ValueMetaInteger( \"ID_USER\" ), userInfo.getObjectId() );\n    r.addValue( new ValueMetaString( \"LOGIN\" ), userInfo.getLogin() );\n    r.addValue( new ValueMetaString( \"PASSWORD\" ), Encr.encryptPassword( userInfo\n      .getPassword() ) );\n    r.addValue( new ValueMetaString( \"NAME\" ), userInfo.getUsername() );\n    r.addValue( new ValueMetaString( \"DESCRIPTION\" ), userInfo.getDescription() );\n    r.addValue( new ValueMetaBoolean( \"ENABLED\" ), Boolean.valueOf( userInfo.isEnabled() ) );\n    return r;\n  }\n\n  public synchronized int getNrUsers() throws KettleException {","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryUserDelegate.java#L106-L142","documentation":"saveUserInfo() wraps all repository writes in a try/catch and rethrows any KettleDatabaseException as a generic KettleException 'UserInfo.Error.SavingUser <login>', preserving the cause. It means the insert/update of the user row into R_USER (or the commit) failed at the database level.","triggerScenarios":"repository.userDelegate.saveUserInfo(userInfo) or repository.save(userInfo) when insertTableRow/updateTableRow on R_USER throws KettleDatabaseException (duplicate login, constraint violation, connection failure, read-only DB).","commonSituations":"Creating a user whose login already exists in R_USER; repository database down or credentials changed; schema out of date after a Kettle version upgrade; disk full on the DB server.","solutions":["Check the chained cause (dbe) for the real SQL error","Ensure the login is unique before saving (look up existing user first)","Verify repository database connectivity, credentials, and that the schema is upgraded (RepositoryConnectController / upgrade scripts)"],"exampleFix":"// before\nrepo.userDelegate.saveUserInfo(userInfo);\n// after\ntry {\n  repo.userDelegate.saveUserInfo(userInfo);\n} catch (KettleException e) {\n  throw new KettleException(\"Failed to save user \" + userInfo.getLogin() + \": \" + e.getCause().getMessage(), e);\n}","handlingStrategy":"try-catch","validationCode":"ObjectId existing = repo.userDelegate.getUserID(userInfo.getLogin());\nif (existing != null) throw new IllegalStateException(\"User already exists: \" + userInfo.getLogin());","typeGuard":null,"tryCatchPattern":"try { repo.userDelegate.saveUserInfo(userInfo); } catch (KettleException e) { throw new KettleException(\"Save user failed: \" + e.getCause(), e); }","preventionTips":["Always log/print the chained cause — it contains the real SQL error","Check login uniqueness before insert","Keep the repository schema upgraded to your Pentaho version","Verify DB connectivity and disk space before bulk user operations"],"tags":["repository","database","persistence","user-management"],"backgroundTag":"database-write-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"}