{"record":{"id":"0209a11b82f7a95b","repo":"apache/druid","slug":"do-not-know-how-to-handle-source-s","errorCode":null,"errorMessage":"Do not know how to handle source [%s]","messagePattern":"Do not know how to handle source \\[(.+?)\\]","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java","lineNumber":192,"sourceCode":"      catch (IOException e) {\n        throw new SegmentLoadingException(e, \"Unable to unzip file [%s]\", sourceFile.getAbsolutePath());\n      }\n    } else if (CompressionUtils.isGz(sourceFile.getName())) {\n      final File outFile = new File(dir, CompressionUtils.getGzBaseName(sourceFile.getName()));\n      final FileUtils.FileCopyResult result = CompressionUtils.gunzip(\n          Files.asByteSource(sourceFile),\n          outFile,\n          shouldRetryPredicate()\n      );\n      log.info(\n          \"Gunzipped %d bytes from [%s] to [%s]\",\n          result.size(),\n          sourceFile.getAbsolutePath(),\n          outFile.getAbsolutePath()\n      );\n      return result;\n    } else {\n      throw new SegmentLoadingException(\"Do not know how to handle source [%s]\", sourceFile.getAbsolutePath());\n    }\n  }\n\n\n  @Override\n  public InputStream getInputStream(URI uri) throws IOException\n  {\n    return buildFileObject(uri).openInputStream();\n  }\n\n  /**\n   * Returns the \"version\" (aka last modified timestamp) of the URI of interest\n   *\n   * @param uri The URI to check the last modified timestamp\n   *\n   * @return The last modified timestamp in ms of the URI in String format\n   */\n  @Override","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/server/src/main/java/org/apache/druid/segment/loading/LocalDataSegmentPuller.java#L174-L210","documentation":"LocalDataSegmentPuller.getSegmentFiles throws SegmentLoadingException when the local segment file's name is none of the recognized archive types (tgz/tar.gz, zip, gz). The puller dispatches on the file extension and cannot extract an unknown-format source. It indicates a segment file on local deep storage with an unexpected name or format.","triggerScenarios":"getSegmentFiles called with a sourceFile whose name does not match CompressionUtils.isTarGz, isZip, or isGz — e.g. loadSpec path pointing at a directory, an uncompressed file, or a misnamed archive.","commonSituations":"Hand-crafted loadSpec paths in segments.json; segments produced by a nonstandard pusher; files renamed manually; loadSpec pointing at the directory instead of index.zip; migration from other storage formats.","solutions":["Point the segment loadSpec 'path' at the actual archive file (e.g. index.zip), not a directory or plain file.","Confirm the segment was pushed with druid.storage.type=local so naming matches what the puller expects.","Re-ingest or re-push the segment to regenerate a standard archive layout.","If the segment really is uncompressed, place the files in the expected directory structure and re-push with the local pusher."],"exampleFix":"// before: loadSpec pointing at a directory\n{\"type\":\"local\",\"path\":\"/ds/druid/segments/wikipedia/2015-01-01T00_...\"}\n// after: loadSpec pointing at the zip\n{\"type\":\"local\",\"path\":\"/ds/druid/segments/wikipedia/2015-01-01T00_.../index.zip\"}","handlingStrategy":"validation","validationCode":"String path = (String) segment.getLoadSpec().get(\"path\");\nString name = new File(path).getName();\nboolean recognized = name.endsWith(\".zip\") || name.endsWith(\".gz\") || name.endsWith(\".tar.gz\") || name.endsWith(\".tgz\");\nif (!recognized) throw new IllegalStateException(\"puller cannot handle segment source: \" + name);","typeGuard":"boolean isRecognizedSegmentSource(Map<String,Object> loadSpec) {\n  Object p = loadSpec.get(\"path\");\n  if (!(p instanceof String)) return false;\n  String n = new File((String) p).getName();\n  return n.endsWith(\".zip\") || n.endsWith(\".tar.gz\") || n.endsWith(\".tgz\") || n.endsWith(\".gz\");\n}","tryCatchPattern":"try {\n  puller.getSegmentFiles(segment, outDir);\n} catch (SegmentLoadingException e) {\n  log.error(e, \"unsupported segment format for %s; re-push required\", segment.getId());\n}","preventionTips":["Only build segments with Druid's own pushers so archive naming stays standard.","Never hand-edit loadSpec paths in the metadata store.","Don't rename files inside deep-storage segment directories.","Point loadSpec 'path' at the archive file (e.g. index.zip), not a directory."],"tags":["segment-loading","unsupported-format","local-deep-storage"],"backgroundTag":"unsupported-source-format","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}