{"record":{"id":"80b7dbc1da186fe4","repo":"pentaho/pentaho-kettle","slug":"unable-to-clone-meta-for-lazy-conversion","errorCode":null,"errorMessage":"Unable to clone meta for lazy conversion: ","messagePattern":"Unable to clone meta for lazy conversion: ","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java","lineNumber":279,"sourceCode":"        row.addRowMeta( add );\n      } catch ( KettleException ke ) {\n        throw new KettleStepException( \"Unable to get queryfields for SQL: \" + Const.CR + sNewSQL, ke );\n      } finally {\n        db.close();\n      }\n    }\n    if ( isLazyConversionActive() ) {\n      for ( int i = 0; i < row.size(); i++ ) {\n        ValueMetaInterface v = row.getValueMeta( i );\n        try {\n          if ( v.getType() == ValueMetaInterface.TYPE_STRING ) {\n            ValueMetaInterface storageMeta = ValueMetaFactory.cloneValueMeta( v );\n            storageMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\n            v.setStorageMetadata( storageMeta );\n            v.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );\n          }\n        } catch ( KettlePluginException e ) {\n          throw new KettleStepException( \"Unable to clone meta for lazy conversion: \" + Const.CR + v, e );\n        }\n      }\n    }\n  }\n\n  private void attachOrigin( RowMetaInterface rmi, String origin ) {\n    for ( int i = 0; i < rmi.size(); i++ ) {\n      ValueMetaInterface v = rmi.getValueMeta( i );\n      v.setOrigin( origin );\n    }\n  }\n\n  public String getXML() {\n    StringBuilder retval = new StringBuilder();\n\n    retval.append( \"    \"\n      + XMLHandler.addTagValue( \"connection\", databaseMeta == null ? \"\" : databaseMeta.getName() ) );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"sql\", sql ) );","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java#L261-L297","documentation":"TableInputMeta.getFields() wraps any KettlePluginException raised while cloning a value's metadata for lazy conversion into a KettleStepException. When a field is stored as a binary string, the step must clone its metadata into a normal-storage 'storage metadata' copy; if the ValueMeta plugin cannot be cloned/instantiated, this error is thrown. It signals a value-metadata plugin resolution failure, not a data problem.","triggerScenarios":"getFields() is called (e.g. via TransMeta.analyseImpact or layout preview) on a TableInput step whose row contains a field with STORAGE_TYPE_BINARY_STRING, and ValueMetaFactory.cloneValueMeta(v) throws KettlePluginException because the value meta's plugin type cannot be resolved or instantiated.","commonSituations":"Repositories or .ktr files saved with a custom/removed ValueMeta plugin type; classpath missing the kettle value-meta plugin jar; corrupt legacy transformations where the field's type id no longer maps to a registered plugin.","solutions":["Check the cause chain (KettlePluginException) to identify which value type/plugin failed to resolve","Reinstall or restore the missing ValueMeta plugin jar to the classpath (plugins directory)","Open the transformation in Spoon and change the offending field's storage type from 'Binary string' to 'Normal'","Resave the transformation with a current Pentaho/Kettle version so metadata is rewritten with resolvable plugin types"],"exampleFix":"// before\nv.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING ); // clone fails for unknown plugin type\n// after\nif ( v.getStorageType() == ValueMetaInterface.STORAGE_TYPE_BINARY_STRING\n  && ValueMetaFactory.getValueMetaName( v.getType() ) != null ) {\n  ValueMetaInterface storageMeta = ValueMetaFactory.cloneValueMeta( v );\n  storageMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );\n  v.setStorageMetadata( storageMeta );\n  v.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );\n}","handlingStrategy":"try-catch","validationCode":"// before running the transformation, verify each field's type resolves\nfor ( ValueMetaInterface v : inputRowMeta.getValueMetaList() ) {\n  try {\n    ValueMetaFactory.cloneValueMeta( v );\n  } catch ( KettlePluginException e ) {\n    throw new IllegalStateException( \"Unresolvable value meta type \" + v.getType()\n      + \" for field \" + v.getName() + \": \" + e.getMessage(), e );\n  }\n}","typeGuard":"boolean hasResolvablePlugin( ValueMetaInterface v ) {\n  try { ValueMetaFactory.getValueMetaName( v.getType() ); return true; }\n  catch ( Exception e ) { return false; }\n}","tryCatchPattern":"try {\n  transMeta.analyseImpact( ... );\n} catch ( KettleStepException e ) {\n  if ( e.getMessage().startsWith( \"Unable to clone meta for lazy conversion\" ) ) {\n    // disable lazy conversion / fix plugin classpath, then retry\n  } else { throw e; }\n}","preventionTips":["Keep all ValueMeta plugin jars on the classpath when running headless","Avoid hand-editing .ktr XML field type ids","Disable lazy conversion for fields not needing binary-string storage","Resave legacy transformations with the current Kettle version"],"tags":["kettle","metadata","lazy-conversion","plugin"],"backgroundTag":"missing-dependency","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"}