{"record":{"id":"5cca003a3c14c937","repo":"pentaho/pentaho-kettle","slug":"erreur-inattendue","errorCode":null,"errorMessage":"Erreur inattendue","messagePattern":"Erreur inattendue","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/email-messages/impl/src/main/java/org/pentaho/di/trans/steps/mailinput/MailInputMeta.java","lineNumber":411,"sourceCode":"      } catch ( Exception e ) {\n        batchSize = DEFAULT_BATCH_SIZE;\n      }\n      start = rep.getStepAttributeString( id_step, TAG_START_MSG );\n      end = rep.getStepAttributeString( id_step, TAG_END_MSG );\n      stopOnError = rep.getStepAttributeBoolean( id_step, TAG_STOP_ON_ERROR );\n\n      allocate( nrFields );\n      for ( int i = 0; i < nrFields; i++ ) {\n        MailInputField field = new MailInputField();\n\n        field.setName( rep.getStepAttributeString( id_step, i, \"field_name\" ) );\n        field\n          .setColumn( MailInputField.getColumnByCode( rep.getStepAttributeString( id_step, i, \"field_column\" ) ) );\n\n        inputFields[i] = field;\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Erreur inattendue\", e );\n    }\n  }\n\n  @Override\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      rep.saveStepAttribute( id_transformation, id_step, TAG_SERVERNAME, serverName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_USERNAME, userName );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_PASSWORD, Encr\n        .encryptPasswordIfNotUsingVariables( password ) );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_CLIENT_ID, clientId );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_SECRET_KEY, Encr\n              .encryptPasswordIfNotUsingVariables( secretKey ) );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_SCOPE, scope );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_TOKEN_URL, tokenUrl );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_AUTH_AUTHORIZATION_CODE, authorization_code );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_REDIRECT_URI, redirectUri );\n      rep.saveStepAttribute( id_transformation, id_step, TAG_REFRESH_TOKEN, refresh_token );","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/email-messages/impl/src/main/java/org/pentaho/di/trans/steps/mailinput/MailInputMeta.java#L393-L429","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the nested cause exception (e.getCause()) to identify the real repository failure","Re-open the transformation and re-save the Mail Input step configuration so its step attributes are rewritten","Verify the repository connection is healthy and the step attribute rows are intact","Check that the Kettle plugin version that saved the metadata matches the one reading it"],"exampleFix":"// before\nfield.setColumn( MailInputField.getColumnByCode( rep.getStepAttributeString( id_step, i, \"field_column\" ) ) );\n// after\nString columnCode = rep.getStepAttributeString( id_step, i, \"field_column\" );\nint column = MailInputField.getColumnByCode( columnCode );\nif ( column < 0 ) {\n  logError( \"Unknown field_column code '\" + columnCode + \"', defaulting\" );\n  column = 0;\n}\nfield.setColumn( column );","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  meta.readRep( rep, metaStore, idStep, databases );\n} catch ( KettleException e ) {\n  logError( \"Failed to load Mail Input metadata\", e.getCause() );\n  // fall back to defaults or abort with a clear message\n}","preventionTips":["Keep the plugin that saves and the plugin that reads repository metadata at the same version","Test repository connectivity before loading transformations","Log the nested cause, not just the wrapper message"],"tags":["kettle","repository","metadata-deserialization","pdi-plugin"],"backgroundTag":"database-query-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"}