pentaho/pentaho-kettle · error · KettleValueException

Unable to convert Internet Address v6 to an Integer: " +…

Error message

Unable to convert Internet Address v6 to an Integer: " + getString( object ) + " (The precision is too high to be contained in a long integer value)

What it means

ValueMetaInternetAddress.getInteger() converts an InetAddress value to a numeric (long) representation. An IPv6 address is 16 bytes, so its full numeric value cannot fit into a 64-bit signed long. The library throws KettleValueException when the stored address has more than 8 bytes (i.e., any IPv6 address).

Solutions

  1. Only call getInteger() on fields guaranteed to be IPv4 (or otherwise <= 8 bytes); validate the address family first
  2. Use getString() (textual address) instead of a numeric representation when IPv6 may be present
  3. Catch KettleValueException around getInteger() and fall back to the string form
  4. Store the address as a BigNumber (BigDecimal) via getBigNumber() if a numeric form is truly required for IPv6

Example fix

// before
Long n = inetValueMeta.getInteger(rowData[i]);
// after
InetAddress addr = inetValueMeta.getInetAddress(rowData[i]);
Long n = (addr != null && addr.getAddress().length <= 8)
    ? inetValueMeta.getInteger(rowData[i])
    : null; // IPv6 has no long representation
Defensive patterns

Strategy: type-guard

Validate before calling

boolean isIPv4(InetAddress a){ return a != null && a.getAddress().length <= 8; }

Type guard

if (inetMeta.getInetAddress(value) instanceof InetAddress a && a.getAddress().length <= 8) { /* safe to getInteger */ }

Try / catch

try { n = inetMeta.getInteger(v); } catch (KettleValueException e) { /* IPv6 or invalid */ n = null; }

Prevention

When it happens

Trigger: Calling getInteger() (directly or via Integer/Number conversion of the value meta) on a ValueData holding an InetAddress whose byte length exceeds 8 — i.e., any IPv6 address such as '2001:db8::1'.

Common situations: Rows flowing from database columns or input files containing IPv6 addresses into steps that request the value as an Integer (e.g., a 'Value Mapper', calculator, or User Defined Java Expression reading the field as a number). Environments migrating to dual-stack IPv4/IPv6 networks where data sources now emit IPv6.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/37b3661f1c35352b. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java:163

  }

  @Override
  public Date getDate( Object object ) throws KettleValueException {
    throw new KettleValueException( toStringMeta()
      + ": it's not possible to convert from Internet Address to a date" );
  }

  @Override
  public Long getInteger( Object object ) throws KettleValueException {
    InetAddress address = getInternetAddress( object );
    if ( address == null ) {
      return null;
    }
    long total = 0L;
    byte[] addr = address.getAddress();

    if ( addr.length > 8 ) {
      throw new KettleValueException( "Unable to convert Internet Address v6 to an Integer: "
        + getString( object ) + " (The precision is too high to be contained in a long integer value)" );
    }

    for ( int i = 0; i < addr.length; i++ ) {
      total += ( addr[i] & 0xFF ) * ( (long) Math.pow( 256, ( addr.length - 1 - i ) ) );
    }

    return total;
  }

  @Override
  public Double getNumber( Object object ) throws KettleValueException {
    Long l = getInteger( object );
    if ( l == null ) {
      return null;
    }

    return l.doubleValue();

View on GitHub (pinned to f3058517a1)