apache/druid · error · IllegalArgumentException

Invalid input file path [%s]

Error message

Invalid input file path [%s]

What it means

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.

Source

Thrown at extensions-core/google-extensions/src/main/java/org/apache/druid/data/input/google/GoogleCloudStorageInputSourceFactory.java:59

  @JsonCreator
  public GoogleCloudStorageInputSourceFactory(
      @JacksonInject GoogleStorage storage,
      @JacksonInject GoogleInputDataConfig inputDataConfig
  )
  {
    this.storage = storage;
    this.inputDataConfig = inputDataConfig;
  }

  @Override
  public SplittableInputSource create(List<String> inputFilePaths)
  {
    final List<URI> uris = inputFilePaths.stream().map(chosenPath -> {
      try {
        return new URI(chosenPath);
      }
      catch (URISyntaxException e) {
        throw new IAE(e, "Invalid input file path [%s]", chosenPath);
      }
    }).collect(Collectors.toList());

    return new GoogleCloudStorageInputSource(
        storage,
        inputDataConfig,
        uris,
        null,
        null,
        null,
        SystemFields.none()
    );
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. URL-encode the offending path (spaces -> %20, etc.) or remove illegal characters
  2. Verify each file entry starts with a valid scheme 'gs://bucket/path'
  3. Validate all entries in the ingestion spec's source.files array before submitting
  4. Wrap the path in try { new URI(p) } locally or use a validator before building the spec

Example fix

// before
"files": ["gs://my-bucket/data file.json"]
// after
"files": ["gs://my-bucket/data%20file.json"]
Defensive patterns

Strategy: validation

Validate before calling

// Validate each files entry before building the inputSource
for (String p : paths) {
  try { java.net.URI u = new java.net.URI(p); if (!"gs".equals(u.getScheme())) throw new IllegalArgumentException("not gs://: " + p); }
  catch (java.net.URISyntaxException e) { throw new IllegalArgumentException("bad path: " + p, e); }
}

Type guard

static boolean isGcsUri(String p) { try { return "gs".equals(new java.net.URI(p).getScheme()); } catch (Exception e) { return false; } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/02e83858c30ab663. Report an issue: GitHub.