{"record":{"id":"d5aeae8a3305e22c","repo":"hashicorp/nomad","slug":"unable-to-check-available-disk-space-w","errorCode":null,"errorMessage":"unable to check available disk space: %w","messagePattern":"unable to check available disk space: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helper/raftutil/migrate.go","lineNumber":207,"sourceCode":"\t// Verify the WAL directory does not already exist.\n\tif _, err := os.Stat(walDir); err == nil {\n\t\treturn fmt.Errorf(\n\t\t\t\"WAL directory already exists at %s; remove it before retrying migration\",\n\t\t\twalDir)\n\t}\n\n\t// Check write permissions on raft directory.\n\ttestFile := filepath.Join(raftDir, \".permission-test\")\n\tif err := os.WriteFile(testFile, []byte(\"test\"), 0o600); err != nil {\n\t\treturn fmt.Errorf(\"insufficient write permissions in %s: %w\", raftDir, err)\n\t}\n\tos.Remove(testFile)\n\n\t// Check available disk space.\n\tusage, err := disk.Usage(raftDir)\n\tif err != nil {\n\t\t// Log warning but don't fail migration - disk space check is advisory.\n\t\treturn fmt.Errorf(\"unable to check available disk space: %w\", err)\n\t}\n\tavailableSpace := usage.Free\n\n\tboltSize := uint64(boltInfo.Size())\n\n\t// Require at least the BoltDB size + minimum free space buffer.\n\t// WAL format is typically similar in size to BoltDB, but we add a buffer.\n\trequiredSpace := boltSize + minRequiredSpace\n\tif availableSpace < requiredSpace {\n\t\treturn fmt.Errorf(\n\t\t\t\"insufficient disk space: have %d bytes available, need at least %d bytes (BoltDB size %d + %d buffer)\",\n\t\t\tavailableSpace, requiredSpace, boltSize, minRequiredSpace)\n\t}\n\n\treturn nil\n}\n\n// cleanupWAL removes the WAL directory, retrying on Windows to handle","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/helper/raftutil/migrate.go#L189-L225","documentation":"Fires in the WAL migration preflightChecks when the disk-usage query on the raft directory fails; despite the adjacent comment saying the check is advisory, the error is returned and migration aborts.","triggerScenarios":"Thrown at helper/raftutil/migrate.go:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the raft data directory exists and is readable by the nomad process","Run df or equivalent on the raft directory to confirm the filesystem is accessible and not unmounted","Fix any NFS/FUSE or device errors on the underlying storage, then retry nomad server migrate"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}