{"record":{"id":"4dab533671a007e2","repo":"pentaho/pentaho-kettle","slug":"salesforceinput-usernamemissing-error","errorCode":"SalesforceInput.UsernameMissing.Error","errorMessage":"SalesforceInput.UsernameMissing.Error","messagePattern":"SalesforceInput\\.UsernameMissing\\.Error","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java","lineNumber":133,"sourceCode":"    this.qr = null;\n    this.startDate = null;\n    this.endDate = null;\n    this.sObjects = null;\n    this.recordsFilter = SalesforceConnectionUtils.RECORDS_FILTER_ALL;\n    this.fieldsList = null;\n    this.queryResultSize = 0;\n    this.recordsCount = 0;\n    setUsingCompression( false );\n    setRollbackAllChangesOnError( false );\n\n    // check target URL\n    if ( Utils.isEmpty( getURL() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"SalesforceInput.TargetURLMissing.Error\" ) );\n    }\n\n    // check username\n    if ( Utils.isEmpty( getUsername() ) ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"SalesforceInput.UsernameMissing.Error\" ) );\n    }\n\n    if ( log.isDetailed() ) {\n      logInterface.logDetailed( BaseMessages.getString( PKG, \"SalesforceInput.Log.NewConnection\" ) );\n    }\n  }\n\n  public boolean isRollbackAllChangesOnError() {\n    return this.rollbackAllChangesOnError;\n  }\n\n  /**\n   *\n   * @see #isRollbackAllChangesOnError(boolean)\n   */\n  @Deprecated\n  public void rollbackAllChangesOnError( boolean value ) {\n    setRollbackAllChangesOnError( value );","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java#L115-L151","documentation":"After validating the URL, the SalesforceConnection constructor checks that a username is present. If getUsername() returns null or empty, it throws a KettleException with key SalesforceInput.UsernameMissing.Error, since Salesforce login requires credentials.","triggerScenarios":"Constructing SalesforceConnection with no username set in the step metadata, or with a username supplied only via an environment variable that resolves to empty.","commonSituations":"Empty 'Username' field in the Salesforce step; ${SF_USER} not defined on the executing server; switching to environment-variable config but forgetting kettle.properties entries; SSO/tooling migrations that drop credentials.","solutions":["Enter the Salesforce username in the step dialog or ensure the referenced variable is defined","Check kettle.properties / environment configuration on the executing machine","Use Test Connection to validate credentials before running the transformation","Confirm the username includes the full Salesforce login (user@example.com, plus sandbox suffix if applicable)"],"exampleFix":"// before\nusername = ${SF_USER}   // undefined\n// after\nusername = integration@example.com\n// or define SF_USER=integration@example.com in kettle.properties","handlingStrategy":"validation","validationCode":"String user = environmentSubstitute( meta.getUsername() );\nif ( user == null || user.trim().isEmpty() ) {\n  throw new IllegalStateException( \"Salesforce username is empty; set it or define its variable\" );\n}","typeGuard":null,"tryCatchPattern":"try {\n  SalesforceConnection conn = new SalesforceConnection( log, url, username, password );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"UsernameMissing\" ) ) {\n    fixCredentialsAndRetry();\n  } else throw e;\n}","preventionTips":["Define Salesforce credentials in kettle.properties per environment","Use Test Connection to catch missing credentials before execution","Include the full Salesforce username (with sandbox suffix when applicable)","Rotate credentials centrally so fields never go empty"],"tags":["salesforce","configuration","credentials","validation"],"backgroundTag":"missing-credentials","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"}