{"record":{"id":"a10fe8b6d0f4780f","repo":"apache/hadoop","slug":"not-an-executable-file","errorCode":null,"errorMessage":"Not an executable file: {}","messagePattern":"Not an executable file: (.+?)","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java","lineNumber":675,"sourceCode":"      throws FileNotFoundException {\n    String binDirText = \"Hadoop bin directory \";\n    File bin = new File(hadoopHomeDir, \"bin\");\n    if (!bin.exists()) {\n      throw new FileNotFoundException(addOsText(binDirText + E_DOES_NOT_EXIST\n          + \": \" + bin));\n    }\n    if (!bin.isDirectory()) {\n      throw new FileNotFoundException(addOsText(binDirText + E_NOT_DIRECTORY\n          + \": \" + bin));\n    }\n\n    File exeFile = new File(bin, executable);\n    if (!exeFile.exists()) {\n      throw new FileNotFoundException(\n          addOsText(E_NO_EXECUTABLE + \": \" + exeFile));\n    }\n    if (!exeFile.isFile()) {\n      throw new FileNotFoundException(\n          addOsText(E_NOT_EXECUTABLE_FILE + \": \" + exeFile));\n    }\n    try {\n      return exeFile.getCanonicalFile();\n    } catch (IOException e) {\n      // this isn't going to happen, because of all the upfront checks.\n      // so if it does, it gets converted to a FNFE and rethrown\n      throw fileNotFoundException(e.toString(), e);\n    }\n  }\n\n  /**\n   *  Fully qualify the path to a binary that should be in a known hadoop\n   *  bin location. This is primarily useful for disambiguating call-outs\n   *  to executable sub-components of Hadoop to avoid clashes with other\n   *  executables that may be in the path.  Caveat:  this call doesn't\n   *  just format the path to the bin directory.  It also checks for file\n   *  existence of the composed path. The output of this call should be","sourceCodeStart":657,"sourceCodeEnd":693,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java#L657-L693","documentation":"Shell.getQualifiedBinInner() found a filesystem entry at ${hadoopHome}/bin/<executable>, but java.io.File.isFile() reports it is not a regular file (a directory or special file), so it cannot be executed and FileNotFoundException with E_NOT_EXECUTABLE_FILE is thrown. The path resolves, but to the wrong kind of object.","triggerScenarios":"A directory named winutils.exe (or the requested executable) sits inside bin/; a FIFO/device or broken symlink occupies the path; getQualifiedBin is called while the executable is being replaced mid-deploy.","commonSituations":"Extraction tools that create a folder per archive entry; someone 'organized' binaries into folders; interrupted copies leaving directories; symlink farms pointing at directory targets.","solutions":["Inspect the entry: ls -la \"$HADOOP_HOME/bin/winutils.exe\" — look for 'd' mode or dangling link","If it is a directory, remove it and place the real binary file at that exact path","Repair or replace symlinks so they resolve to a regular file","Re-copy bin/ from a trusted archive and verify with test -f \"$HADOOP_HOME/bin/winutils.exe\""],"exampleFix":"# before\n$ ls -ld /opt/hadoop/bin/winutils.exe\ndrwxr-xr-x 2 user user 4096 winutils.exe/   # a directory\n\n# after\nrm -rf /opt/hadoop/bin/winutils.exe\ncp cdarwin-winutils/hadoop-3.3.6/bin/winutils.exe /opt/hadoop/bin/\ntest -f /opt/hadoop/bin/winutils.exe && echo OK","handlingStrategy":"validation","validationCode":"Path exe = Paths.get(System.getenv(\"HADOOP_HOME\"), \"bin\", \"winutils.exe\");\nif (Files.exists(exe) && !Files.isRegularFile(exe)) {\n  throw new IllegalStateException(exe + \" is not a regular file — repair the bin directory\");\n}","typeGuard":null,"tryCatchPattern":"try { Shell.getQualifiedBin(exe); } catch (FileNotFoundException e) { /* path resolves to a directory/special file: replace with real binary, retry */ }","preventionTips":["After installing binaries, verify with test -f (regular file), not just existence","Do not extract archives with tools that materialize folder-per-entry structures into bin/","Repair broken symlinks in bin/ during the same provisioning step that installs the executable"],"tags":["hadoop","shell","winutils","executable","filesystem"],"backgroundTag":"missing-executable","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}