apache/hadoop · error · RuntimeException

Failed to parse "{path}" : {e}

Error message

Failed to parse "{path}" : {e}

What it means

Manifest files (TaskManifest etc.) store paths as strings; AbstractManifestData.unmarshallPath() converts them back by constructing java.net.URI first. A string with invalid URI syntax (unencoded spaces, brackets, malformed percent-escapes) raises URISyntaxException, which is rethrown as RuntimeException('Failed to parse "<path>" : <cause>'). It means the serialized manifest contains a path the reader cannot parse, i.e. corrupt or mismatched manifest data.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/committer/manifest/files/AbstractManifestData.java:70

   * @return a string value, or, if path==null, null.
   */
  public static String marshallPath(@Nullable Path path) {
    return path != null
        ? path.toUri().toString()
        : null;
  }

  /**
   * Convert a string path to Path type, by way of a URI.
   * @param path path as a string
   * @return path value
   * @throws RuntimeException marshalling failure.
   */
  public static Path unmarshallPath(String path) {
    try {
      return new Path(new URI(requireNonNull(path, "No path")));
    } catch (URISyntaxException e) {
      throw new RuntimeException(
          "Failed to parse \"" + path + "\" : " + e,
          e);
    }
  }

  /**
   * Validate the data: those fields which must be non empty, must be set.
   * @return the validated instance.
   * @throws IOException if the data is invalid
   */
  public abstract T validate() throws IOException;

  /**
   * Serialize to JSON and then to a byte array, after performing a
   * preflight validation of the data to be saved.
   * @return the data in a persistable form.
   * @throws IOException serialization problem or validation failure.
   */

View on GitHub (pinned to 2add963021)

Solutions

  1. Inspect the path string printed in the message to spot the offending character and its position (URISyntaxException includes an index).
  2. Regenerate the manifest with the same committer version that will read it - do not mix writer/reader versions or edit manifests by hand.
  3. Avoid raw special characters in output paths; percent-encode them (space as %20) before they enter job output paths.
  4. If a task produced the bad manifest, rerun that task/job so a fresh, valid manifest is written.

Example fix

// before: raw string goes straight to unmarshallPath
Path p = AbstractManifestData.unmarshallPath(manifestEntry.getSourcePath());

// after: validate syntax first and get a precise diagnostic
try {
  URI u = new URI(rawPath); // URISyntaxException names the bad index
  Path p = new Path(u);
} catch (URISyntaxException e) {
  throw new IOException("Corrupt manifest path field: " + rawPath, e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// validate serialized path strings before handing them to unmarshallPath
static Path safeUnmarshall(String raw) throws IOException {
  try {
    return new Path(new URI(java.util.Objects.requireNonNull(raw, "No path")));
  } catch (URISyntaxException e) {
    throw new IOException("Corrupt manifest path field: '" + raw + "'", e);
  }
}

Try / catch

try {
  Path p = AbstractManifestData.unmarshallPath(raw);
} catch (RuntimeException e) {
  if (e.getCause() instanceof URISyntaxException) {
    // corrupt manifest data: quarantine it, alert - do not retry the same bytes
  }
}

Prevention

When it happens

Trigger: Loading a manifest JSON whose sourcePath/destPath fields contain characters illegal in a URI - typically unencoded spaces, '{', '}', '|', '^' or broken percent-encoding; manifests produced or hand-edited by different tooling/versions than the reader.

Common situations: Partition values with spaces or special characters flowing into paths; hand-edited or externally generated manifest files; a writer version that stored raw strings meeting a reader version that added URI parsing; log-copy corruption of manifest JSON.

Understand the failure class

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/4dc41cb84ac2a2c1. Report an issue: GitHub.