pentaho/pentaho-kettle · error · KettleException

Erreur inattendue

Error message

Erreur inattendue

What it means

MailInputMeta.readRep() wraps any exception raised while reading the 'Mail Input' (Get POP) step's field definitions back from the Kettle repository. The message 'Erreur inattendue' (French for 'Unexpected error') indicates repository metadata deserialization failed while loading field column/name attributes for the step. The original cause is attached as the nested exception.

Solutions

  1. Inspect the nested cause exception (e.getCause()) to identify the real repository failure
  2. Re-open the transformation and re-save the Mail Input step configuration so its step attributes are rewritten
  3. Verify the repository connection is healthy and the step attribute rows are intact
  4. Check that the Kettle plugin version that saved the metadata matches the one reading it

Example fix

// before
field.setColumn( MailInputField.getColumnByCode( rep.getStepAttributeString( id_step, i, "field_column" ) ) );
// after
String columnCode = rep.getStepAttributeString( id_step, i, "field_column" );
int column = MailInputField.getColumnByCode( columnCode );
if ( column < 0 ) {
  logError( "Unknown field_column code '" + columnCode + "', defaulting" );
  column = 0;
}
field.setColumn( column );
Defensive patterns

Strategy: try-catch

Try / catch

try {
  meta.readRep( rep, metaStore, idStep, databases );
} catch ( KettleException e ) {
  logError( "Failed to load Mail Input metadata", e.getCause() );
  // fall back to defaults or abort with a clear message
}

Prevention

When it happens

Trigger: Calling readRep() on a MailInputMeta when rep.getStepAttributeString() or MailInputField.getColumnByCode() throws — e.g. corrupted step attributes, a missing 'nr_of_fields' attribute mismatch, or a repository/database error mid-read.

Common situations: Opening a transformation stored in a repository whose mail input step attributes were written by an older/newer Pentaho version, or whose field_column values no longer map to a known column code.

Understand the failure class

Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/5cca003a3c14c937. Report an issue: GitHub.

Appendix: source

Thrown at plugins/email-messages/impl/src/main/java/org/pentaho/di/trans/steps/mailinput/MailInputMeta.java:411

      } catch ( Exception e ) {
        batchSize = DEFAULT_BATCH_SIZE;
      }
      start = rep.getStepAttributeString( id_step, TAG_START_MSG );
      end = rep.getStepAttributeString( id_step, TAG_END_MSG );
      stopOnError = rep.getStepAttributeBoolean( id_step, TAG_STOP_ON_ERROR );

      allocate( nrFields );
      for ( int i = 0; i < nrFields; i++ ) {
        MailInputField field = new MailInputField();

        field.setName( rep.getStepAttributeString( id_step, i, "field_name" ) );
        field
          .setColumn( MailInputField.getColumnByCode( rep.getStepAttributeString( id_step, i, "field_column" ) ) );

        inputFields[i] = field;
      }
    } catch ( Exception e ) {
      throw new KettleException( "Erreur inattendue", e );
    }
  }

  @Override
  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      rep.saveStepAttribute( id_transformation, id_step, TAG_SERVERNAME, serverName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_USERNAME, userName );
      rep.saveStepAttribute( id_transformation, id_step, TAG_PASSWORD, Encr
        .encryptPasswordIfNotUsingVariables( password ) );
      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_CLIENT_ID, clientId );
      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_SECRET_KEY, Encr
              .encryptPasswordIfNotUsingVariables( secretKey ) );
      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_SCOPE, scope );
      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_TOKEN_URL, tokenUrl );
      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_AUTHORIZATION_CODE, authorization_code );
      rep.saveStepAttribute( id_transformation, id_step, TAG_REDIRECT_URI, redirectUri );
      rep.saveStepAttribute( id_transformation, id_step, TAG_REFRESH_TOKEN, refresh_token );

View on GitHub (pinned to f3058517a1)