{"record":{"id":"b99c60ffcb42baa4","repo":"apache/hadoop","slug":"invalid-path-for-the-har-filesystem","errorCode":null,"errorMessage":"Invalid path for the Har Filesystem. {}","messagePattern":"Invalid path for the Har Filesystem\\. (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java","lineNumber":140,"sourceCode":"   * the uri of Har is \n   * har://underlyingfsscheme-host:port/archivepath.\n   * or \n   * har:///archivepath. This assumes the underlying filesystem\n   * to be used in case not specified.\n   */\n  @Override\n  public void initialize(URI name, Configuration conf) throws IOException {\n    // initialize the metadata cache, if needed\n    initializeMetadataCache(conf);\n\n    // decode the name\n    URI underLyingURI = decodeHarURI(name, conf);\n    // we got the right har Path- now check if this is \n    // truly a har filesystem\n    Path harPath = archivePath(\n      new Path(name.getScheme(), name.getAuthority(), name.getPath()));\n    if (harPath == null) { \n      throw new IOException(\"Invalid path for the Har Filesystem. \" + \n                           name.toString());\n    }\n    if (fs == null) {\n      fs = FileSystem.get(underLyingURI, conf);\n    }\n    uri = harPath.toUri();\n    archivePath = new Path(uri.getPath());\n    harAuth = getHarAuth(underLyingURI);\n    //check for the underlying fs containing\n    // the index file\n    Path masterIndexPath = new Path(archivePath, \"_masterindex\");\n    Path archiveIndexPath = new Path(archivePath, \"_index\");\n    if (!fs.exists(masterIndexPath) || !fs.exists(archiveIndexPath)) {\n      throw new IOException(\"Invalid path for the Har Filesystem. \" +\n          \"No index file in \" + harPath);\n    }\n\n    metadata = harMetaCache.get(uri);","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java#L122-L158","documentation":"Error \"Invalid path for the Har Filesystem. {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a properly formed har:// URI pointing at a valid archive.","Verify the archive path and that it was created with 'hadoop archive'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}