{"record":{"id":"99110e9dfe0f42d4","repo":"hashicorp/nomad","slug":"insufficient-disk-space-have-d-bytes-available","errorCode":null,"errorMessage":"insufficient disk space: have %d bytes available, need at least %d bytes (BoltDB size %d + %d buffer)","messagePattern":"insufficient disk space: have (.+?) bytes available, need at least (.+?) bytes \\(BoltDB size (.+?) \\+ (.+?) buffer\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helper/raftutil/migrate.go","lineNumber":217,"sourceCode":"\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\n// delayed file handle releases.\nfunc cleanupWAL(walDir string) {\n\t// First attempt immediate cleanup.\n\tif err := os.RemoveAll(walDir); err == nil {\n\t\treturn\n\t}\n\n\t// On failure (common on Windows), retry with delays.\n\tfor range 3 {\n\t\ttime.Sleep(100 * time.Millisecond)","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/helper/raftutil/migrate.go#L199-L235","documentation":"Fires in preflightChecks when free space on the raft directory is less than the BoltDB size plus the required buffer: the WAL migration could fill the disk, so it refuses to start.","triggerScenarios":"Thrown at helper/raftutil/migrate.go:217 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Free disk space on the raft volume until available bytes exceed BoltDB size plus the minimum buffer","Move or shrink the BoltDB store (e.g. take and restore a snapshot) before migrating","Extend the underlying disk/partition"],"exampleFix":null,"handlingStrategy":"validation","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"}