{"record":{"id":"3c71ce9bc5469e77","repo":"apache/hadoop","slug":"failed-to-instantiate-datanode-3c71ce","errorCode":null,"errorMessage":"Failed to instantiate DataNode","messagePattern":"Failed to instantiate DataNode","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java","lineNumber":3427,"sourceCode":"   * given data directories (and their parent directories, if necessary)\n   * can be created.\n   * @param dataDirs List of directories, where the new DataNode instance should\n   * keep its files.\n   * @param conf Configuration instance to use.\n   * @param resources Secure resources needed to run under Kerberos\n   * @return DataNode instance for given list of data dirs and conf, or null if\n   * no directory from this directory list can be created.\n   * @throws IOException\n   */\n  static DataNode makeInstance(Collection<StorageLocation> dataDirs,\n      Configuration conf, SecureResources resources) throws IOException {\n    List<StorageLocation> locations;\n    StorageLocationChecker storageLocationChecker =\n        new StorageLocationChecker(conf, new Timer());\n    try {\n      locations = storageLocationChecker.check(conf, dataDirs);\n    } catch (InterruptedException ie) {\n      throw new IOException(\"Failed to instantiate DataNode\", ie);\n    }\n    DefaultMetricsSystem.initialize(\"DataNode\");\n\n    assert locations.size() > 0 : \"number of data directories should be > 0\";\n    return new DataNode(conf, locations, storageLocationChecker, resources);\n  }\n\n  @Override\n  public String toString() {\n    return \"DataNode{data=\" + data + \", localName='\" + getDisplayName()\n        + \"', datanodeUuid='\" + storage.getDatanodeUuid() + \"', xmitsInProgress=\"\n        + xmitsInProgress.get() + \"}\";\n  }\n\n  private static void printUsage(PrintStream out) {\n    out.println(USAGE + \"\\n\");\n  }\n","sourceCodeStart":3409,"sourceCodeEnd":3445,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L3409-L3445","documentation":"Error \"Failed to instantiate DataNode\" thrown in apache/hadoop.","triggerScenarios":"DataNode creation via createDataNode fails, aborting startup.","commonSituations":"DataNode instantiation failed during secure startup. Verify Kerberos credentials, keytab paths, and privileged port configuration.","solutions":["Fix the root cause reported by the underlying exception: configuration errors, unwritable data directories, or Kerberos misconfiguration.","Run the DataNode in the foreground with verbose logging to capture the full stack trace during instantiation."],"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-22T20:17:22.307Z"}