{"record":{"id":"fd89476fab59ddcc","repo":"pentaho/pentaho-kettle","slug":"unable-to-clone-internet-address","errorCode":null,"errorMessage":"Unable to clone Internet Address","messagePattern":"Unable to clone Internet Address","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java","lineNumber":453,"sourceCode":"        return convertBigNumberToInternetAddress( meta2.getBigNumber( data2 ) );\n      case TYPE_INET:\n        return ( (ValueMetaInternetAddress) meta2 ).getInternetAddress( data2 );\n      default:\n        throw new KettleValueException( meta2.toStringMeta() + \" : can't be converted to an Internet Address\" );\n    }\n  }\n\n  @Override\n  public Object cloneValueData( Object object ) throws KettleValueException {\n    InetAddress inetAddress = getInternetAddress( object );\n    if ( inetAddress == null ) {\n      return null;\n    }\n\n    try {\n      return InetAddress.getByAddress( inetAddress.getAddress() );\n    } catch ( Exception e ) {\n      throw new KettleValueException( \"Unable to clone Internet Address\", e );\n    }\n  }\n\n  @Override\n  public ValueMetaInterface getMetadataPreview( DatabaseMeta databaseMeta, ResultSet rs )\n    throws KettleDatabaseException {\n\n    try {\n      if ( \"INET\".equalsIgnoreCase( rs.getString( \"TYPE_NAME\" ) ) ) {\n        ValueMetaInterface vmi = super.getMetadataPreview( databaseMeta, rs );\n        ValueMetaInterface valueMeta = new ValueMetaInternetAddress( name );\n        valueMeta.setLength( vmi.getLength() );\n        valueMeta.setOriginalColumnType( vmi.getOriginalColumnType() );\n        valueMeta.setOriginalColumnTypeName( vmi.getOriginalColumnTypeName() );\n        valueMeta.setOriginalNullable( vmi.getOriginalNullable() );\n        valueMeta.setOriginalPrecision( vmi.getOriginalPrecision() );\n        valueMeta.setOriginalScale( vmi.getOriginalScale() );\n        valueMeta.setOriginalSigned( vmi.getOriginalSigned() );","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java#L435-L471","documentation":"cloneValueData() duplicates the stored InetAddress via InetAddress.getByAddress(address bytes). If the JDK rejects the cloned byte array (malformed/unknown address family), the library wraps it in KettleValueException 'Unable to clone Internet Address'.","triggerScenarios":"Calling cloneValueData() (used when Kettle clones rows for row sets, join steps, and multi-target hops) on a value holding an InetAddress whose byte array is invalid for the default JVM provider — rare, usually from custom InetAddress subclasses or corrupted byte arrays.","commonSituations":"Row cloning in high-throughput transformations (Table Join, Split, sorted merge); exotic JDK network providers or unusual InetAddress implementations produced by custom user code.","solutions":["Ensure the value data is a standard java.net.InetAddress produced by the library's converters","Catch KettleValueException around row cloning and log/replace the offending value","Update the JDK if a known provider bug in getByAddress is the cause"],"exampleFix":"// before\nObject copy = inetMeta.cloneValueData(row[ipIdx]);\n// after\nObject copy;\ntry { copy = inetMeta.cloneValueData(row[ipIdx]); }\ncatch (KettleValueException e) { copy = null; log.warn(\"Bad IP value dropped: \" + e.getMessage()); }","handlingStrategy":"try-catch","validationCode":"Object d = row[ipIdx];\nboolean ok = d instanceof InetAddress && ((InetAddress) d).getAddress().length > 0;","typeGuard":"boolean isPlainInetAddress(Object o){ return o != null && InetAddress.class.equals(o.getClass()) && o instanceof InetAddress a && a.getAddress().length > 0; }","tryCatchPattern":"try { copy = inetMeta.cloneValueData(v); } catch (KettleValueException e) { copy = null; log.warn(...); }","preventionTips":["Store only standard InetAddress instances from the library converters","Avoid custom InetAddress subclasses in value data","Keep the JDK updated for network provider fixes"],"tags":["inetaddress","cloning","kettle"],"backgroundTag":"internal-invariant-violation","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"}