{"record":{"id":"85508150480503c1","repo":"apache/hadoop","slug":"no-sharedfiledescriptorfactory-paths-were-configur","errorCode":null,"errorMessage":"no SharedFileDescriptorFactory paths were configured.","messagePattern":"no SharedFileDescriptorFactory paths were configured\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java","lineNumber":81,"sourceCode":"  /**\n   * Create a new SharedFileDescriptorFactory.\n   *\n   * @param prefix       The prefix to prepend to all the file names created\n   *                       by this factory.\n   * @param paths        An array of paths to use.  We will try each path in \n   *                       succession, and return a factory using the first \n   *                       usable path.\n   * @return             The factory.\n   * @throws IOException If a factory could not be created for any reason.\n   */\n  public static SharedFileDescriptorFactory create(String prefix,\n      String paths[]) throws IOException {\n    String loadingFailureReason = getLoadingFailureReason();\n    if (loadingFailureReason != null) {\n      throw new IOException(loadingFailureReason);\n    }\n    if (paths.length == 0) {\n      throw new IOException(\"no SharedFileDescriptorFactory paths were \" +\n          \"configured.\");\n    }\n    StringBuilder errors = new StringBuilder();\n    String strPrefix = \"\";\n    for (String path : paths) {\n      try {\n        FileInputStream fis = \n            new FileInputStream(createDescriptor0(prefix + \"test\", path, 1));\n        fis.close();\n        deleteStaleTemporaryFiles0(prefix, path);\n        return new SharedFileDescriptorFactory(prefix, path);\n      } catch (IOException e) {\n        errors.append(strPrefix).append(\"Error creating file descriptor in \").\n               append(path).append(\": \").append(e.getMessage());\n        strPrefix = \", \";\n      }\n    }\n    throw new IOException(errors.toString());","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/nativeio/SharedFileDescriptorFactory.java#L63-L99","documentation":"SharedFileDescriptorFactory.create(prefix, paths[]) builds the shared-memory descriptor directory used by HDFS short-circuit reads to pass file descriptors between client and DataNode (/dev/shm or /tmp candidates). It requires at least one candidate directory; an empty array is a configuration error and fails immediately with this IOException.","triggerScenarios":"Calling create with a zero-length paths array — usually because the config that supplies the list (e.g. dfs.datanode.shared.file.descriptor.paths, default '/dev/shm,/tmp', or the client-side equivalent) was set to an empty string and parsed into no entries.","commonSituations":"Short-circuit local reads enabled while the shared-file-descriptor paths property was blanked in site.xml; embedded/custom code passing an empty list; deployment templates that zero out paths 'to use defaults' but actually disable them.","solutions":["Set the paths property to a comma-separated candidate list, e.g. dfs.datanode.shared.file.descriptor.paths=/dev/shm,/tmp.","If you call the factory directly, always pass at least one existing, writable directory.","If you do not need short-circuit shared-memory features, disable short-circuit reads instead of blanking the paths."],"exampleFix":"// before\nfactory = SharedFileDescriptorFactory.create(prefix, new String[0]);\n\n// after\nfactory = SharedFileDescriptorFactory.create(prefix,\n    new String[] { \"/dev/shm\", \"/tmp\" });","handlingStrategy":"validation","validationCode":"String[] candidates = conf.getTrimmedStrings(\n    \"dfs.datanode.shared.file.descriptor.paths\",\n    new String[] { \"/dev/shm\", \"/tmp\" });\nif (candidates == null || candidates.length == 0) {\n  throw new IOException(\"no shared-file-descriptor paths configured\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate list-valued config at service startup, not on first lazy use.","Keep the '/dev/shm,/tmp' default unless the environment truly lacks /dev/shm.","Integration-test the derived config on every deployment target."],"tags":["short-circuit-reads","shared-memory","configuration","hdfs"],"backgroundTag":"missing-configuration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}