pentaho/pentaho-kettle · error · KettleStepException
Unable to clone row for metadata :
Error message
Unable to clone row for metadata :
What it means
TransPreviewDelegate registers a RowListener during preview whose rowWrittenEvent clones each incoming row via rowMeta.cloneRow(row) to buffer it for display. If cloning throws, a KettleStepException with 'Unable to clone row for metadata : ' + rowMeta is raised, aborting the preview data flow for that step.
Solutions
- Inspect the wrapped cause (logged with the exception) to find the field index and mismatch.
- Fix the producing step so emitted row objects match its RowMetaInterface (correct types per field).
- Re-run the step's 'Get Fields' so its declared row metadata matches actual output.
- If a plugin is at fault, update or fix the plugin's processRow implementation.
Example fix
// before: emitting Integer for a declared String field
Object[] row = { Integer.valueOf( 42 ) }; // rowMeta says String -> cloneRow fails
// after
Object[] row = { "42" }; // matches rowMeta String type Defensive patterns
Strategy: try-catch
Try / catch
try {
rowsData.add( new RowMetaAndData( rowMeta, rowMeta.cloneRow( row ) ) );
} catch ( Exception e ) {
log.logError( "Unable to clone row for metadata : " + rowMeta, e );
// inspect e to find the mismatching field index/type
} Prevention
- Ensure custom steps emit values whose types exactly match the declared RowMeta.
- Run 'Get Fields' on steps after changing their configuration.
- Test preview early on custom plugins to catch row/metadata drift.
When it happens
Trigger: Previewing a step whose row listener hits the default (non-first/non-last) branch and rowMeta.cloneRow(row) throws — typically when row data does not match the row metadata (wrong object type or null against a non-null field) or the row metadata itself is malformed.
Common situations: Custom step plugins produce rows inconsistent with their declared RowMeta; binary/object fields that cloneRow cannot deep-copy; rows passed after the metadata changed mid-execution.
Related errors
- XMLInputStream.NoIncomingRowsFound
- All fields must have an output type to do the preview
- AnalyticQueryMeta.Exception.SubjectFieldNotFound
- BaseStep.Exception.MetadataDoesntMatchDataRowSize
- BaseStep.SafeMode.Exception.DoubleFieldnames
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/855ff72d26b60fcc.
Report an issue: GitHub.
Appendix: source
Thrown at ui/src/main/java/org/pentaho/di/ui/spoon/trans/TransPreviewDelegate.java:491
previewDataMap.put( stepMeta, rowsData );
previewLogMap.put( stepMeta, loggingText );
StepInterface step = trans.findRunThread( stepMeta.getName() );
if ( step != null ) {
switch ( previewMode ) {
case LAST:
step.addRowListener( new RowAdapter() {
@Override
public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException {
try {
rowsData.add( new RowMetaAndData( rowMeta, rowMeta.cloneRow( row ) ) );
if ( rowsData.size() > PropsUI.getInstance().getDefaultPreviewSize() ) {
rowsData.remove( 0 );
}
} catch ( Exception e ) {
throw new KettleStepException( "Unable to clone row for metadata : " + rowMeta, e );
}
}
} );
break;
default:
step.addRowListener( new RowAdapter() {
@Override
public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException {
if ( rowsData.size() < PropsUI.getInstance().getDefaultPreviewSize() ) {
try {
rowsData.add( new RowMetaAndData( rowMeta, rowMeta.cloneRow( row ) ) );
} catch ( Exception e ) {
throw new KettleStepException( "Unable to clone row for metadata : " + rowMeta, e );
}
}
}
} );View on GitHub (pinned to f3058517a1)