{"record":{"id":"7915854c917929bd","repo":"apache/druid","slug":"don-t-know-how-to-load-scheme-s-for-uri-s","errorCode":null,"errorMessage":"Don't know how to load SCHEME [%s] for URI [%s]","messagePattern":"Don't know how to load SCHEME \\[(.+?)\\] for URI \\[(.+?)\\]","errorType":"validation","errorClass":"IAE","httpStatus":null,"severity":"error","filePath":"extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentPuller.java","lineNumber":317,"sourceCode":"    if (emitter == null) {\n      return;\n    }\n    ServiceMetricEvent.Builder metricBuilder = ServiceMetricEvent.builder();\n    metricBuilder.setDimension(\"format\", format);\n    emitter.emit(metricBuilder.setMetric(\"hdfs/pull/size\", size));\n    emitter.emit(metricBuilder.setMetric(\"hdfs/pull/duration\", duration));\n  }\n\n  public InputStream getInputStream(Path path) throws IOException\n  {\n    return buildFileObject(path.toUri(), config).openInputStream();\n  }\n\n  @Override\n  public InputStream getInputStream(URI uri) throws IOException\n  {\n    if (!uri.getScheme().equalsIgnoreCase(HdfsStorageDruidModule.SCHEME)) {\n      throw new IAE(\"Don't know how to load SCHEME [%s] for URI [%s]\", uri.getScheme(), uri.toString());\n    }\n    return buildFileObject(uri, config).openInputStream();\n  }\n\n  /**\n   * Return the \"version\" (aka last modified timestamp) of the URI\n   *\n   * @param uri The URI of interest\n   *\n   * @return The last modified timestamp of the uri in String format\n   *\n   * @throws IOException\n   */\n  @Override\n  public String getVersion(URI uri) throws IOException\n  {\n    try {\n      return StringUtils.format(\"%d\", buildFileObject(uri, config).getLastModified());","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentPuller.java#L299-L335","documentation":"HdfsDataSegmentPuller.getInputStream() only knows how to read segments stored on HDFS. When the URI's scheme is not 'hdfs' it refuses to proceed, throwing this IllegalArgumentException before touching the filesystem. It guards against misconfigured deep-storage URIs being handed to the HDFS puller.","triggerScenarios":"Calling getInputStream(uri) with a URI whose scheme is not 'hdfs' (case-insensitive check fails), e.g. an 's3://', 'file://', or local-path segment URI routed to the HDFS puller.","commonSituations":"Deep storage misconfiguration: druid.storage.type=hdfs is loaded but historical nodes still resolve segment URIs written by another storage type (S3, local); mixing storage extensions on the same cluster; hand-written load specs pointing at the wrong scheme.","solutions":["Verify druid.storage.type is hdfs on all nodes that must pull these segments and that segments were actually pushed to HDFS","Check the loadSpec URI in the segment metadata in the metadata store; it must start with hdfs://","Ensure the hdfs-storage extension is the only active storage provider, or that deep storage is not mixed between S3/local and HDFS"],"exampleFix":"// before (URI from wrong storage)\nURI uri = new URI(\"s3://bucket/segment/index.zip\");\npuller.getInputStream(uri); // throws\n// after\nURI uri = new URI(\"hdfs://namenode/druid/segments/.../index.zip\");\npuller.getInputStream(uri);","handlingStrategy":"validation","validationCode":"if (!\"hdfs\".equalsIgnoreCase(uri.getScheme())) {\n  throw new IllegalArgumentException(\"Expected hdfs:// URI, got: \" + uri);\n}\npuller.getInputStream(uri);","typeGuard":"boolean isHdfsUri(java.net.URI uri) { return uri != null && \"hdfs\".equalsIgnoreCase(uri.getScheme()); }","tryCatchPattern":"try {\n  in = puller.getInputStream(uri);\n} catch (IllegalArgumentException e) {\n  throw new IllegalStateException(\"Segment URI not on HDFS, check druid.storage.type/loadSpec: \" + uri, e);\n}","preventionTips":["Keep druid.storage.type consistent across all nodes","Validate loadSpec URIs in the metadata store start with hdfs://","Avoid mixing deep-storage extensions on one cluster"],"tags":["hdfs","uri","deep-storage","invalid-argument"],"backgroundTag":"invalid-url","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"}