pentaho/pentaho-kettle · error · KettleException
Unable to convert stored depth '...' to depth at position…
Error message
Unable to convert stored depth '...' to depth at position ...
What it means
JobEntryZipFile.determineDepth() throws this KettleException when the stored source-path depth string parses only partially: ParsePosition.getErrorIndex()==0 means no usable number could be consumed at the start. The message includes the offending string and error position.
Solutions
- Open the .kjb / repository attributes and correct 'stored_source_path_depth' to a valid non-negative integer (e.g. 1, 2, 3)
- Re-open and re-save the zip job entry in Spoon to rewrite the stored depth
- If the value is intentionally absent, remove the tag so the code falls back to the default depth of 1
Example fix
// before <stored_source_path_depth>abc</stored_source_path_depth> // after <stored_source_path_depth>2</stored_source_path_depth>
Defensive patterns
Strategy: validation
Validate before calling
// validate depth before calling depth()
String d = jobEntry.getStoredSourcePathDepth();
if ( d != null && !d.matches( "\\d+" ) ) {
throw new IllegalArgumentException( "stored_source_path_depth must be a non-negative integer, got: " + d );
} Type guard
boolean isValidDepth( String s ) {
return s != null && s.matches( "\\d+" );
} Try / catch
try {
int depth = jobEntry.depth();
} catch ( KettleException e ) {
logError( "Bad stored depth, using default 1: " + e.getMessage() );
int depth = 1; // fallback
} Prevention
- Always persist depth as a plain integer string
- Avoid editing depth values by hand in .kjb files
- Re-save entries in Spoon after upgrading PDI versions
When it happens
Trigger: Calling depth() on a JobEntryZipFile whose 'stored_source_path_depth' value is non-numeric or starts with characters ParsePosition cannot parse (e.g. 'abc', empty handled separately by default, but '-x' or '\u0000' hitting errorIndex 0).
Common situations: Job file edited by hand with a bad depth value; older PDI versions that did not persist depth producing garbage; string attributes saved where a number was expected.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Unable to convert stored depth '...' to depth
- Can not append to an existing zip file
- JobEntrySetVariables.Meta.UnableLoadXML
- JobEntryZipFile.UnableLoadJobEntryXML
- Unable to get zip filename '...' to depth ...
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/157626f069a80fed.
Report an issue: GitHub.
Appendix: source
Thrown at engine/src/main/java/org/pentaho/di/job/entries/zipfile/JobEntryZipFile.java:709
try {
Files.delete( tempFile.toPath() );
} catch ( IOException e ) {
logError( "Could not delete temporary ZIP file '" + tempFile + "'", e );
}
}
}
private int determineDepth( String depthString ) throws KettleException {
DecimalFormat df = new DecimalFormat( "0" );
ParsePosition pp = new ParsePosition( 0 );
df.setParseIntegerOnly( true );
try {
Number n = df.parse( depthString, pp );
if ( n == null ) {
return 1; // default
}
if ( pp.getErrorIndex() == 0 ) {
throw new KettleException( "Unable to convert stored depth '"
+ depthString + "' to depth at position " + pp.getErrorIndex() );
}
return n.intValue();
} catch ( Exception e ) {
throw new KettleException( "Unable to convert stored depth '" + depthString + "' to depth", e );
}
}
/**
* Get the requested part of the filename
*
* @param filename
* the filename (full) (/path/to/a/file.txt)
* @param depth
* the depth to get. 0 means: the complete filename, 1: the name only (file.txt), 2: one folder (a/file.txt)
* 3: two folders (to/a/file.txt) and so on.
* @return the requested part of the file name up to a certain depth
* @throws KettleFileExceptionView on GitHub (pinned to f3058517a1)