{"record":{"id":"abc1c60c546db577","repo":"apache/hadoop","slug":"properties-not-found-for-storage-directory-sd","errorCode":null,"errorMessage":"Properties not found  for storage directory \" + sd","messagePattern":"Properties not found  for storage directory \" \\+ sd","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":683,"sourceCode":"    if (layoutVersion == 0) {\n      throw new IOException(\"NameNode directory \"\n                            + sd.getRoot() + \" is not formatted.\");\n    }\n\n    // Set Block pool ID in version with federation support\n    if (NameNodeLayoutVersion.supports(\n        LayoutVersion.Feature.FEDERATION, getLayoutVersion())) {\n      String sbpid = props.getProperty(\"blockpoolID\");\n      setBlockPoolID(sd.getRoot(), sbpid);\n    }\n    setDeprecatedPropertiesForUpgrade(props);\n  }\n\n  void readProperties(StorageDirectory sd, StartupOption startupOption)\n      throws IOException {\n    Properties props = readPropertiesFile(sd.getVersionFile());\n    if (props == null) {\n      throw new IOException(\n          \"Properties not found  for storage directory \" + sd);\n    }\n    if (HdfsServerConstants.RollingUpgradeStartupOption.ROLLBACK\n        .matches(startupOption)) {\n      int lv = Integer.parseInt(getProperty(props, sd, \"layoutVersion\"));\n      if (lv > getServiceLayoutVersion()) {\n        // we should not use a newer version for rollingUpgrade rollback\n        throw new IncorrectVersionException(getServiceLayoutVersion(), lv,\n            \"storage directory \" + sd.getRoot().getAbsolutePath());\n      }\n      props.setProperty(\"layoutVersion\",\n          Integer.toString(getServiceLayoutVersion()));\n    }\n    setFieldsFromProperties(props, sd);\n  }\n\n  /**\n   * Pull any properties out of the VERSION file that are from older","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L665-L701","documentation":"readProperties loads a storage directory's VERSION via readPropertiesFile; a null return (file absent or unopenable) yields 'Properties not found for storage directory sd'. Unlike the layoutVersion==0 'not formatted' case, this fires when the VERSION file itself is missing or unreadable for that directory - presence of the file, not its content, is the problem.","triggerScenarios":"VERSION deleted, the directory unmounted or mounted read-only, permissions denying read, or a partial restore that skipped VERSION - hit while the NN starts, or during rollback/recovery reads of a storage dir.","commonSituations":"Storage unmounted at boot so NN sees an empty mountpoint; cleanup scripts removing files in the name dir; one failed disk among several name dirs; restore from backup that copied image/edits but not VERSION.","solutions":["Inspect the directory named in the message: ls -l <root>/VERSION and df <root> - often it is simply an unmounted volume.","Restore VERSION (with consistent fsimage/edits) from a healthy sibling dir or backup; every ID field must match the other directories.","If the cluster is brand new, just format properly rather than hand-crafting VERSION."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-start check: VERSION must exist and be readable in every dir\nfor (String loc : conf.getTrimmedStrings(\"dfs.namenode.name.dir\")) {\n  Path v = Paths.get(stripScheme(loc)).resolve(\"current\").resolve(\"VERSION\");\n  if (!Files.isReadable(v)) {\n    throw new IllegalStateException(\"VERSION missing/unreadable - check mount and permissions: \" + v);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify mounts before NN start (df per dir) - unmounted volumes look like missing VERSION.","Keep VERSION in backup snapshots; restoring image without VERSION just moves the failure.","Restrict cleanup tooling from touching name dirs."],"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"}