{"record":{"id":"c0a5f8240183f6a3","repo":"pentaho/pentaho-kettle","slug":"purrepositorysecuritymanager-error-0001-invalid-name","errorCode":"PurRepositorySecurityManager.ERROR_0001_INVALID_NAME","errorMessage":"PurRepositorySecurityManager.ERROR_0001_INVALID_NAME","messagePattern":"PurRepositorySecurityManager\\.ERROR_0001_INVALID_NAME","errorType":"validation","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepositorySecurityManager.java","lineNumber":109,"sourceCode":"    return user;\n  }\n\n  public IUser loadUserInfo( String login, String password ) throws KettleException {\n    // Create a UserInfo object\n    IUser user = constructUser();\n    user.setLogin( login );\n    user.setPassword( password );\n    user.setName( login );\n    return user;\n  }\n\n  public void renameUser( ObjectId id_user, String newname ) throws KettleException {\n  }\n\n  public void saveUserInfo( IUser user ) throws KettleException {\n    normalizeUserInfo( user );\n    if ( !validateUserInfo( user ) ) {\n      throw new KettleException( BaseMessages.getString( PurRepositorySecurityManager.class,\n          \"PurRepositorySecurityManager.ERROR_0001_INVALID_NAME\" ) );\n    }\n    userRoleDelegate.createUser( user );\n  }\n\n  @Override\n  public boolean validateUserInfo( IUser user ) {\n    return RepositoryCommonValidations.checkUserInfo( user );\n  }\n\n  @Override\n  public void normalizeUserInfo( IUser user ) {\n    RepositoryCommonValidations.normalizeUserInfo( user );\n  }\n\n  public void createRole( IRole newRole ) throws KettleException {\n    normalizeRoleInfo( newRole );\n    if ( !validateRoleInfo( newRole ) ) {","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepositorySecurityManager.java#L91-L127","documentation":"saveUserInfo validates a user (name, etc.) after normalizing it and throws this KettleException with the ERROR_0001_INVALID_NAME message key when validateUserInfo fails. It is thrown before any call to the server-side createUser, so the user record is not persisted. The localized message indicates the supplied user data (typically name/username) is invalid.","triggerScenarios":"Calling PurRepositorySecurityManager.saveUserInfo(IUser) with a user whose name/login is null, empty, or otherwise fails validateUserInfo after normalizeUserInfo runs.","commonSituations":"Creating users programmatically without setting login/name, importing user data from CSV/LDAP with blank usernames, or whitespace-only names that fail validation.","solutions":["Set a non-empty, valid login and name on the IUser before calling saveUserInfo.","Trim and validate the username in your calling code (non-blank, allowed characters).","Check validateUserInfo in PurRepositorySecurityManager for the exact rules being violated.","If data comes from an external source, sanitize/normalize it (trim, strip illegal chars) before creating the user."],"exampleFix":"// before\nIUser user = securityManager.constructUser();\nuser.setName( inputName ); // may be null/empty\nsecurityManager.saveUserInfo( user );\n// after\nIUser user = securityManager.constructUser();\nString name = inputName == null ? \"\" : inputName.trim();\nif ( name.isEmpty() ) {\n  throw new IllegalArgumentException( \"User name is required\" );\n}\nuser.setName( name );\nuser.setLogin( name );\nsecurityManager.saveUserInfo( user );","handlingStrategy":"validation","validationCode":"boolean isUserValid( IUser u ) {\n  return u != null && u.getName() != null && !u.getName().trim().isEmpty()\n    && u.getLogin() != null && !u.getLogin().trim().isEmpty();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set both login and name before saveUserInfo","Trim user input from external sources","Unit-test user creation with empty/null names","Run normalizeUserInfo semantics yourself before calling"],"tags":["validation","user-management","pentaho-kettle"],"backgroundTag":"empty-required-field","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"}