pentaho/pentaho-kettle · error · KettleException
MappingInputMeta.Exception.UnexpectedErrorInReadingStepInfo
MappingInputMeta.Exception.UnexpectedErrorInReadingStepInfo
Error message
MappingInputMeta.Exception.UnexpectedErrorInReadingStepInfo
What it means
MappingInputMeta.readRep() wraps any exception thrown while reading the Mapping Input step's attributes (field names, types, lengths, precisions, select_unspecified flag) from the Kettle repository into a KettleException with this message key. It signals that the stored step definition could not be loaded, typically due to repository connectivity issues or corrupt/missing metadata. The original exception is chained as the cause.
Solutions
- Verify the repository connection is alive and re-connect, then retry loading the transformation.
- Check the chained cause exception for the underlying repository/database error and fix it (permissions, missing rows, network).
- Confirm id_step refers to an existing step in R_STEP_ATTRIBUTE; if the step row is corrupt, re-create the step in Spoon and re-save the transformation.
- If caused by a version mismatch, upgrade/repair the repository tables and re-export the transformation.
Example fix
// before: loading directly, connection may be stale
meta.readRep(repository, metastore, transObjectId, stepObjectId);
// after: ensure a live repository first
if (repository == null || !repository.isConnected()) {
repository.connect(user, password);
}
try {
meta.readRep(repository, metastore, transObjectId, stepObjectId);
} catch (KettleException e) {
logError("Failed to read MappingInput step metadata: " + e.getCause(), e);
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
if (repository == null || !repository.isConnected()) {
repository.connect(user, password);
}
// confirm the step exists before readRep
if (repository.getStepAttributeCount(id_step) <= 0) {
throw new IllegalStateException("Step attributes missing for id_step=" + id_step);
} Type guard
boolean isReadable(Repository rep, ObjectId idStep) {
return rep != null && rep.isConnected() && idStep != null;
} Try / catch
try {
meta.readRep(repository, metastore, transObjectId, stepObjectId);
} catch (KettleException e) {
logError("MappingInput metadata read failed: " + e.getCause(), e);
throw new RuntimeException("Repository read failed; check connection and step metadata", e);
} Prevention
- Validate repository connectivity before loading transformations.
- Never edit R_STEP_ATTRIBUTE rows directly in the database.
- Keep Pentaho client and repository schema versions aligned.
- Log e.getCause() to surface the real database error.
When it happens
Trigger: Calling readRep() on a MappingInputMeta when Repository.getStepAttributeInteger/getStepAttributeBoolean throws — e.g. repository connection dropped mid-read, id_step points to a deleted/nonexistent step row, or a stored attribute has an unexpected value that fails conversion.
Common situations: Opening a transformation from a repository where the step metadata was manually edited or corrupted; stale repository connections after a database restart; reading transformations created in a much older Pentaho version with incompatible stored attributes; permission problems on the repository database.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- CubeInputMeta.Exception.UnableToSaveStepInfo
- CubeOutputMeta.Exception.UnableToSaveStepInfo
- CubeOutputMeta.Exception.UnexpectedErrorInReadingStepInfo
- DelayMeta.Exception.UnexpectedErrorReadingStepInfo
- DelayMeta.Exception.UnexpectedErrorSavingStepInfo
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/4592355d50cae65d.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/trans/steps/mappinginput/MappingInputMeta.java:353
}
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )
throws KettleException {
try {
int nrfields = rep.countNrStepAttributes( id_step, "field_name" );
allocate( nrfields );
for ( int i = 0; i < nrfields; i++ ) {
fieldName[ i ] = rep.getStepAttributeString( id_step, i, "field_name" );
fieldType[ i ] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) );
fieldLength[ i ] = (int) rep.getStepAttributeInteger( id_step, i, "field_length" );
fieldPrecision[ i ] = (int) rep.getStepAttributeInteger( id_step, i, "field_precision" );
}
selectingAndSortingUnspecifiedFields = rep.getStepAttributeBoolean( id_step, "select_unspecified" );
} catch ( Exception e ) {
throw new KettleException( BaseMessages.getString(
PKG, "MappingInputMeta.Exception.UnexpectedErrorInReadingStepInfo" ), e );
}
}
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
throws KettleException {
try {
for ( int i = 0; i < fieldName.length; i++ ) {
if ( fieldName[ i ] != null && fieldName[ i ].length() != 0 ) {
rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldName[ i ] );
rep.saveStepAttribute( id_transformation, id_step, i, "field_type",
ValueMetaFactory.getValueMetaName( fieldType[ i ] ) );
rep.saveStepAttribute( id_transformation, id_step, i, "field_length", fieldLength[ i ] );
rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", fieldPrecision[ i ] );
}
}
rep.saveStepAttribute(View on GitHub (pinned to f3058517a1)