{"record":{"id":"4dc41cb84ac2a2c1","repo":"apache/hadoop","slug":"failed-to-parse-path-e","errorCode":null,"errorMessage":"Failed to parse \"{path}\" : {e}","messagePattern":"Failed to parse \"(.+?)\" : (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/committer/manifest/files/AbstractManifestData.java","lineNumber":70,"sourceCode":"   * @return a string value, or, if path==null, null.\n   */\n  public static String marshallPath(@Nullable Path path) {\n    return path != null\n        ? path.toUri().toString()\n        : null;\n  }\n\n  /**\n   * Convert a string path to Path type, by way of a URI.\n   * @param path path as a string\n   * @return path value\n   * @throws RuntimeException marshalling failure.\n   */\n  public static Path unmarshallPath(String path) {\n    try {\n      return new Path(new URI(requireNonNull(path, \"No path\")));\n    } catch (URISyntaxException e) {\n      throw new RuntimeException(\n          \"Failed to parse \\\"\" + path + \"\\\" : \" + e,\n          e);\n    }\n  }\n\n  /**\n   * Validate the data: those fields which must be non empty, must be set.\n   * @return the validated instance.\n   * @throws IOException if the data is invalid\n   */\n  public abstract T validate() throws IOException;\n\n  /**\n   * Serialize to JSON and then to a byte array, after performing a\n   * preflight validation of the data to be saved.\n   * @return the data in a persistable form.\n   * @throws IOException serialization problem or validation failure.\n   */","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/committer/manifest/files/AbstractManifestData.java#L52-L88","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the path string printed in the message to spot the offending character and its position (URISyntaxException includes an index).","Regenerate the manifest with the same committer version that will read it - do not mix writer/reader versions or edit manifests by hand.","Avoid raw special characters in output paths; percent-encode them (space as %20) before they enter job output paths.","If a task produced the bad manifest, rerun that task/job so a fresh, valid manifest is written."],"exampleFix":"// before: raw string goes straight to unmarshallPath\nPath p = AbstractManifestData.unmarshallPath(manifestEntry.getSourcePath());\n\n// after: validate syntax first and get a precise diagnostic\ntry {\n  URI u = new URI(rawPath); // URISyntaxException names the bad index\n  Path p = new Path(u);\n} catch (URISyntaxException e) {\n  throw new IOException(\"Corrupt manifest path field: \" + rawPath, e);\n}","handlingStrategy":"try-catch","validationCode":"// validate serialized path strings before handing them to unmarshallPath\nstatic Path safeUnmarshall(String raw) throws IOException {\n  try {\n    return new Path(new URI(java.util.Objects.requireNonNull(raw, \"No path\")));\n  } catch (URISyntaxException e) {\n    throw new IOException(\"Corrupt manifest path field: '\" + raw + \"'\", e);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Path p = AbstractManifestData.unmarshallPath(raw);\n} catch (RuntimeException e) {\n  if (e.getCause() instanceof URISyntaxException) {\n    // corrupt manifest data: quarantine it, alert - do not retry the same bytes\n  }\n}","preventionTips":["Write and read manifests with the same committer version; never hand-edit manifest JSON.","Keep output/partition paths free of unencoded spaces and URI metacharacters, or percent-encode them.","On parse failure, surface the offending string verbatim for quick root-cause."],"tags":["hadoop","manifest-committer","uri","json","path-encoding","data-corruption"],"backgroundTag":"uri-syntax-invalid","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}