{"record":{"id":"d097008c380e8581","repo":"pentaho/pentaho-kettle","slug":"can-t-be-converted-to-an-internet-address","errorCode":null,"errorMessage":" : can't be converted to an Internet Address","messagePattern":" : can't be converted to an Internet Address","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java","lineNumber":439,"sourceCode":"   * @return the object in the data type of this value metadata object\n   * @throws KettleValueException\n   *           in case there is a data conversion error\n   */\n  @Override\n  public Object convertData( ValueMetaInterface meta2, Object data2 ) throws KettleValueException {\n    switch ( meta2.getType() ) {\n      case TYPE_STRING:\n        return convertStringToInternetAddress( meta2.getString( data2 ) );\n      case TYPE_INTEGER:\n        return convertIntegerToInternetAddress( meta2.getInteger( data2 ) );\n      case TYPE_NUMBER:\n        return convertNumberToInternetAddress( meta2.getNumber( data2 ) );\n      case TYPE_BIGNUMBER:\n        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","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java#L421-L457","documentation":"convertData(fromMeta, data) supports converting only from String, Number, BigNumber, and Internet Address source types. Any other source value meta type falls into the default branch and throws KettleValueException 'can't be converted to an Internet Address'.","triggerScenarios":"Calling convertData()/convertDataFromString with a source meta of an unsupported type — e.g., Boolean, Date, Timestamp, or Binary source data being converted into an Internet Address field.","commonSituations":"Field-type remapping in a transformation where a Date or Boolean field was retargeted as Internet Address; generic conversion utilities that pass arbitrary ValueMeta pairs; Excel input producing Date-typed fields routed to IP columns.","solutions":["Change the source field type to String/Number/BigNumber before conversion (insert a 'Select values' type-change step)","Convert the source to its String form and let convertStringToInternetAddress handle it","Correct the transformation mapping so Internet Address fields are fed only from compatible types"],"exampleFix":"// before\nrow[ipIdx] = inetMeta.convertData(dateMeta, row[dateIdx]);\n// after\nrow[ipIdx] = inetMeta.convertData(strMeta, strMeta.getString(row[dateIdx])); // or fix mapping","handlingStrategy":"type-guard","validationCode":"int t = fromMeta.getType();\nboolean convertible = t == ValueMetaInterface.TYPE_STRING || t == ValueMetaInterface.TYPE_NUMBER || t == ValueMetaInterface.TYPE_BIGNUMBER || t == ValueMetaInterface.TYPE_INET;","typeGuard":"boolean canConvertToInet(ValueMetaInterface m){ int t=m.getType(); return t==ValueMetaInterface.TYPE_STRING||t==ValueMetaInterface.TYPE_NUMBER||t==ValueMetaInterface.TYPE_BIGNUMBER||t==ValueMetaInterface.TYPE_INET; }","tryCatchPattern":"try { v = inetMeta.convertData(fromMeta, data); } catch (KettleValueException e) { /* unsupported source type */ }","preventionTips":["Insert a type-change (Select values) step before Internet Address targets","Route Date/Boolean sources through String first","Audit transformation field mappings after edits"],"tags":["type-conversion","incompatible-types","kettle"],"backgroundTag":"incompatible-source-type","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"}