pentaho/pentaho-kettle · error · KettleValueException
invalid hex digit ''.
Error message
invalid hex digit ''.
What it means
Character-level validation while decoding a hex string to bytes in the legacy Value hexDecode(): a character outside 0-9, A-F and a-f was encountered, so it cannot be mapped to a nibble. The offending character is interpolated into the message; a leading zero is assumed for odd-length input.
Solutions
- Remove or correct the non-hexadecimal character in the input string
- Validate/sanitize the hex string (regex [0-9a-fA-F]*) before decoding
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at core/src/main/java/org/pentaho/di/compatibility/Value.java:3605 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/363b843ef07ad220.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/compatibility/Value.java:3605
// we assume a leading 0 if the length is not even.
if ( ( len % 2 ) == 1 ) {
evenByte = false;
}
int nibble;
int i, j;
for ( i = 0, j = 0; i < len; i++ ) {
char c = hexString.charAt( i );
if ( ( c >= '0' ) && ( c <= '9' ) ) {
nibble = c - '0';
} else if ( ( c >= 'A' ) && ( c <= 'F' ) ) {
nibble = c - 'A' + 0x0A;
} else if ( ( c >= 'a' ) && ( c <= 'f' ) ) {
nibble = c - 'a' + 0x0A;
} else {
throw new KettleValueException( "invalid hex digit '" + c + "'." );
}
if ( evenByte ) {
nextByte = ( nibble << 4 );
} else {
nextByte += nibble;
chArray[j] = (char) nextByte;
j++;
}
evenByte = !evenByte;
}
setValue( new String( chArray ) );
return this;
}
/**View on GitHub (pinned to f3058517a1)