{"record":{"id":"0ad4eccf4e15ee8e","repo":"apache/hadoop","slug":"supplied-status-references-a-directory-provide","errorCode":null,"errorMessage":"Supplied status references a directory \" + providedStatus","messagePattern":"Supplied status references a directory \" \\+ providedStatus","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/OpenFileSupport.java","lineNumber":209,"sourceCode":"\n    // was a status passed in via a withStatus() invocation in\n    // the builder API?\n    FileStatus providedStatus = parameters.getStatus();\n    S3AFileStatus fileStatus = null;\n    if (providedStatus != null) {\n      // there's a file status\n\n      // make sure the file name matches -the rest of the path\n      // MUST NOT be checked.\n      Path providedStatusPath = providedStatus.getPath();\n      checkArgument(path.getName().equals(providedStatusPath.getName()),\n          \"Filename mismatch between file being opened %s and\"\n              + \" supplied filestatus %s\",\n          path, providedStatusPath);\n\n      // make sure the status references a file\n      if (providedStatus.isDirectory()) {\n        throw new FileNotFoundException(\n            \"Supplied status references a directory \" + providedStatus);\n      }\n      // build up the values\n      long len = providedStatus.getLen();\n      long modTime = providedStatus.getModificationTime();\n      String versionId;\n      String eTag;\n      // can use this status to skip our own probes,\n      LOG.debug(\"File was opened with a supplied FileStatus;\"\n              + \" skipping getFileStatus call in open() operation: {}\",\n          providedStatus);\n\n      // what type is the status (and hence: what information does it contain?)\n      if (providedStatus instanceof S3AFileStatus) {\n        // is it an S3AFileSystem status?\n        S3AFileStatus st = (S3AFileStatus) providedStatus;\n        versionId = st.getVersionId();\n        eTag = st.getEtag();","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/OpenFileSupport.java#L191-L227","documentation":"Error \"Supplied status references a directory \" + providedStatus\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/OpenFileSupport.java:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a file status, not a directory status, when opening a file with a supplied status."],"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"}