{"record":{"id":"02e83858c30ab663","repo":"apache/druid","slug":"invalid-input-file-path-s","errorCode":null,"errorMessage":"Invalid input file path [%s]","messagePattern":"Invalid input file path \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-core/google-extensions/src/main/java/org/apache/druid/data/input/google/GoogleCloudStorageInputSourceFactory.java","lineNumber":59,"sourceCode":"  @JsonCreator\n  public GoogleCloudStorageInputSourceFactory(\n      @JacksonInject GoogleStorage storage,\n      @JacksonInject GoogleInputDataConfig inputDataConfig\n  )\n  {\n    this.storage = storage;\n    this.inputDataConfig = inputDataConfig;\n  }\n\n  @Override\n  public SplittableInputSource create(List<String> inputFilePaths)\n  {\n    final List<URI> uris = inputFilePaths.stream().map(chosenPath -> {\n      try {\n        return new URI(chosenPath);\n      }\n      catch (URISyntaxException e) {\n        throw new IAE(e, \"Invalid input file path [%s]\", chosenPath);\n      }\n    }).collect(Collectors.toList());\n\n    return new GoogleCloudStorageInputSource(\n        storage,\n        inputDataConfig,\n        uris,\n        null,\n        null,\n        null,\n        SystemFields.none()\n    );\n  }\n}\n","sourceCodeStart":41,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/google-extensions/src/main/java/org/apache/druid/data/input/google/GoogleCloudStorageInputSourceFactory.java#L41-L74","documentation":"GoogleCloudStorageInputSourceFactory.create parses each entry of the inputSpec's files list into a java.net.URI. If a path string is not a valid URI (illegal characters, missing scheme, unescaped spaces), it throws IAE with the offending path so the ingestion spec author knows exactly which entry is malformed.","triggerScenarios":"Calling create (via InputSourceModule/inputSource creation or a spec test) with a GoogleCloudStorageInputSourceFactory whose 'files' list contains a string that fails new URI(...): e.g. 'gs://bucket/my file.csv' with a space, 'gs:/bucket/path' with malformed scheme, or URIs with unescaped brackets or non-ASCII characters.","commonSituations":"Hand-edited ingestion specs with unescaped spaces or special characters in GCS paths; copy-pasting URLs with query strings; using 'gs://' paths that were HTML-encoded; missing 'gs://' scheme entirely.","solutions":["URL-encode the offending path (spaces -> %20, etc.) or remove illegal characters","Verify each file entry starts with a valid scheme 'gs://bucket/path'","Validate all entries in the ingestion spec's source.files array before submitting","Wrap the path in try { new URI(p) } locally or use a validator before building the spec"],"exampleFix":"// before\n\"files\": [\"gs://my-bucket/data file.json\"]\n// after\n\"files\": [\"gs://my-bucket/data%20file.json\"]","handlingStrategy":"validation","validationCode":"// Validate each files entry before building the inputSource\nfor (String p : paths) {\n  try { java.net.URI u = new java.net.URI(p); if (!\"gs\".equals(u.getScheme())) throw new IllegalArgumentException(\"not gs://: \" + p); }\n  catch (java.net.URISyntaxException e) { throw new IllegalArgumentException(\"bad path: \" + p, e); }\n}","typeGuard":"static boolean isGcsUri(String p) { try { return \"gs\".equals(new java.net.URI(p).getScheme()); } catch (Exception e) { return false; } }","tryCatchPattern":null,"preventionTips":["URL-encode spaces/special characters in GCS paths","Lint ingestion specs with a JSON schema before submitting","Always include the gs:// scheme and full bucket in file entries"],"tags":["uri","config-validation","google-cloud-storage","apache-druid"],"backgroundTag":"invalid-url-format","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}