{"record":{"id":"75b676ce3e96a399","repo":"apache/hadoop","slug":"no-storage-directories-contained-version-informati","errorCode":null,"errorMessage":"No storage directories contained VERSION information","messagePattern":"No storage directories contained VERSION information","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java","lineNumber":1120,"sourceCode":"      StorageDirectory sd = it.next();\n      if (!sd.getVersionFile().exists()) {\n        FSImage.LOG.warn(\"Storage directory \" + sd +\n            \" contains no VERSION file. Skipping...\");\n        continue;\n      }\n      readProperties(sd, startupOption); // sets layoutVersion\n      int lv = getLayoutVersion();\n      if (layoutVersion == null) {\n        layoutVersion = lv;\n      } else if (!layoutVersion.equals(lv)) {\n        multipleLV = true;\n      }\n      layoutVersions.append(\"(\").append(sd.getRoot()).append(\", \").append(lv)\n          .append(\") \");\n    }\n    \n    if (layoutVersion == null) {\n      throw new IOException(\"No storage directories contained VERSION\" +\n          \" information\");\n    }\n    if (multipleLV) {            \n      throw new IOException(\n          \"Storage directories contain multiple layout versions: \"\n              + layoutVersions);\n    }\n    // If the storage directories are with the new layout version\n    // (ie edits_<txnid>) then use the new inspector, which will ignore\n    // the old format dirs.\n    FSImageStorageInspector inspector;\n    if (NameNodeLayoutVersion.supports(\n        LayoutVersion.Feature.TXID_BASED_LAYOUT, getLayoutVersion())) {\n      inspector = new FSImageTransactionalStorageInspector(fileTypes);\n    } else {\n      inspector = new FSImagePreTransactionalStorageInspector();\n    }\n    ","sourceCodeStart":1102,"sourceCodeEnd":1138,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L1102-L1138","documentation":"After readProperties has looped over every current storage directory, a still-null layoutVersion means no directory produced readable VERSION data at all. NNStorage refuses to proceed because nothing about the on-disk format is known - effectively 'no usable storage' rather than a problem with one dir.","triggerScenarios":"Every dfs.namenode.name.dir is empty, unformatted, corrupt or unmounted when the NN starts (or during recovery/rollback scans); alternatively the config points at paths that never held this cluster's storage.","commonSituations":"Fresh install without format; wrong mount(s) or paths in a new environment; all VERSION files removed after an incident; config drift pointing NN at scratch dirs.","solutions":["Confirm formatting was done and where: 'hdfs getconf -nameDirs', then ls <dir>/current/VERSION for each.","Restore from backup or sibling copies, or run 'hdfs namenode -format' only if the cluster is genuinely new (it destroys data).","Fix mounts and paths so the NN sees the formatted storage, then restart."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-start check: at least one readable VERSION with a layout version\nboolean any = false;\nfor (String loc : conf.getTrimmedStrings(\"dfs.namenode.name.dir\")) {\n  Map<String, String> p = parseVersion(Paths.get(stripScheme(loc), \"current\", \"VERSION\"));\n  if (p.containsKey(\"layoutVersion\")) { any = true; break; }\n}\nif (!any) throw new IllegalStateException(\"No readable VERSION in any name dir - format or restore before start\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate NN start on a pre-start script verifying at least one formatted dir.","Double-check mount points and effective dfs.namenode.name.dir after environment clones.","Keep offline copies of name dirs for restore drills."],"tags":["hdfs","namenode","storage","version-file","startup"],"backgroundTag":"missing-version-file","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}