{"record":{"id":"653f8163840f672f","repo":"pentaho/pentaho-kettle","slug":"unable-to-convert-stored-depth-to-depth","errorCode":null,"errorMessage":"Unable to convert stored depth '...' to depth","messagePattern":"Unable to convert stored depth '\\.\\.\\.' to depth","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/zipfile/JobEntryZipFile.java","lineNumber":714,"sourceCode":"    }\n  }\n\n  private int determineDepth( String depthString ) throws KettleException {\n    DecimalFormat df = new DecimalFormat( \"0\" );\n    ParsePosition pp = new ParsePosition( 0 );\n    df.setParseIntegerOnly( true );\n    try {\n      Number n = df.parse( depthString, pp );\n      if ( n == null ) {\n        return 1; // default\n      }\n      if ( pp.getErrorIndex() == 0 ) {\n        throw new KettleException( \"Unable to convert stored depth '\"\n          + depthString + \"' to depth at position \" + pp.getErrorIndex() );\n      }\n      return n.intValue();\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to convert stored depth '\" + depthString + \"' to depth\", e );\n    }\n  }\n\n  /**\n   * Get the requested part of the filename\n   *\n   * @param filename\n   *          the filename (full) (/path/to/a/file.txt)\n   * @param depth\n   *          the depth to get. 0 means: the complete filename, 1: the name only (file.txt), 2: one folder (a/file.txt)\n   *          3: two folders (to/a/file.txt) and so on.\n   * @return the requested part of the file name up to a certain depth\n   * @throws KettleFileException\n   */\n  private String determineZipfilenameForDepth( String filename, int depth ) throws KettleException {\n    try {\n      if ( Utils.isEmpty( filename ) ) {\n        return null;","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/zipfile/JobEntryZipFile.java#L696-L732","documentation":"JobEntryZipFile.determineDepth() throws this KettleException in its catch-all when parsing the stored depth string throws for any reason (null input, unparsable format). The message includes the raw depth string and the parse exception is the cause.","triggerScenarios":"Calling depth() with a 'stored_source_path_depth' value that is null or cannot be parsed by DecimalFormat with the given ParsePosition, throwing inside the try block.","commonSituations":"Null depth from a repository that never saved the attribute; locale-sensitive number formats saved on one machine and parsed on another; corrupted job files.","solutions":["Set 'stored_source_path_depth' to a plain integer string (e.g. \"3\") in the job XML or repository attributes","Re-save the job entry in Spoon so a valid depth is persisted","Check the cause exception; if null, provide the depth explicitly in the job configuration"],"exampleFix":"// before\njobEntry.setStoredSourcePathDepth( null );\n// after\njobEntry.setStoredSourcePathDepth( \"2\" ); // plain integer, locale-safe","handlingStrategy":"validation","validationCode":"// validate depth string before use\nString d = jobEntry.getStoredSourcePathDepth();\nif ( d == null || !d.matches( \"\\\\d+\" ) ) {\n  jobEntry.setStoredSourcePathDepth( \"1\" ); // safe default\n}","typeGuard":"boolean hasValidDepth( JobEntryZipFile je ) {\n  String s = je.getStoredSourcePathDepth();\n  return s != null && s.matches( \"\\\\d+\" );\n}","tryCatchPattern":"try {\n  int depth = jobEntry.depth();\n} catch ( KettleException e ) {\n  logError( \"Depth parse failed ('\" + e.getMessage() + \"'), defaulting to 1\" );\n  int depth = 1;\n}","preventionTips":["Initialize depth explicitly when creating JobEntryZipFile programmatically","Avoid locale-dependent number formatting for stored depth","Treat null stored depth as 'not set' and use the default"],"tags":["parsing","pdi","zip","invalid-value"],"backgroundTag":"invalid-argument-format","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"}