{"record":{"id":"a3d549db88dd39ff","repo":"apache/hadoop","slug":"startup-option-not-set","errorCode":null,"errorMessage":"Startup option not set.","messagePattern":"Startup option not set\\.","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":2258,"sourceCode":"    return blockPoolManager.get(bpid);\n  }\n  \n  public int getBpOsCount() {\n    return blockPoolManager.getAllNamenodeThreads().size();\n  }\n  \n  /**\n   * Initializes the {@link #data}. The initialization is done only once, when\n   * handshake with the the first namenode is completed.\n   */\n  private void initStorage(final NamespaceInfo nsInfo) throws IOException {\n    final FsDatasetSpi.Factory<? extends FsDatasetSpi<?>> factory\n        = FsDatasetSpi.Factory.getFactory(getConf());\n    \n    if (!factory.isSimulated()) {\n      final StartupOption startOpt = getStartupOption(getConf());\n      if (startOpt == null) {\n        throw new IOException(\"Startup option not set.\");\n      }\n      final String bpid = nsInfo.getBlockPoolID();\n      //read storage info, lock data dirs and transition fs state if necessary\n      synchronized (this) {\n        storage.recoverTransitionRead(this, nsInfo, dataDirs, startOpt);\n      }\n      final StorageInfo bpStorage = storage.getBPStorage(bpid);\n      LOG.info(\"Setting up storage: nsid={};bpid={};lv={};\" +\n              \"nsInfo={};dnuuid={}\",\n          bpStorage.getNamespaceID(), bpid, storage.getLayoutVersion(),\n          nsInfo, storage.getDatanodeUuid());\n    }\n\n    // If this is a newly formatted DataNode then assign a new DatanodeUuid.\n    checkDatanodeUuid();\n\n    synchronized(this)  {\n      if (data == null) {","sourceCodeStart":2240,"sourceCodeEnd":2276,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java#L2240-L2276","documentation":"Error \"Startup option not set.\" thrown in apache/hadoop.","triggerScenarios":"The DataNode main/init path is invoked without a StartupOption set, usually from custom tooling calling DataNode APIs directly.","commonSituations":"The DataNode was started without a startup option in its descriptor. Usually caused by invoking DataNode internals directly; start it via the standard scripts.","solutions":["Start the DataNode with a valid startup option (regular, -format, -rollback, etc.) as required by the operation being performed.","When scripting DataNode startup, ensure the startup option argument is passed through correctly."],"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"}