{"record":{"id":"08b53a428a122c54","repo":"hashicorp/nomad","slug":"cannot-specify-both-deprecated-raft-boltdb-and","errorCode":null,"errorMessage":"cannot specify both deprecated 'raft_boltdb' and 'raft_logstore' blocks; use 'raft_logstore' only","messagePattern":"cannot specify both deprecated 'raft_boltdb' and 'raft_logstore' blocks; use 'raft_logstore' only","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/agent.go","lineNumber":659,"sourceCode":"\t\tAdditionalPubKeys: agentConfig.Server.licenseAdditionalPublicKeys,\n\t\tLicenseEnvBytes:   agentConfig.Server.LicenseEnv,\n\t\tLicensePath:       agentConfig.Server.LicensePath,\n\t\tNonProduction:     agentConfig.Server.NonProduction,\n\t}\n\n\t// Add the search configuration\n\tif search := agentConfig.Server.Search; search != nil {\n\t\tconf.SearchConfig = &structs.SearchConfig{\n\t\t\tFuzzyEnabled:  search.FuzzyEnabled,\n\t\t\tLimitQuery:    search.LimitQuery,\n\t\t\tLimitResults:  search.LimitResults,\n\t\t\tMinTermLength: search.MinTermLength,\n\t\t}\n\t}\n\n\t// Validate that legacy and new raft config aren't both set\n\tif agentConfig.Server.RaftBoltConfig != nil && agentConfig.Server.RaftLogStoreConfig != nil {\n\t\treturn nil, fmt.Errorf(\"cannot specify both deprecated 'raft_boltdb' and 'raft_logstore' blocks; use 'raft_logstore' only\")\n\t}\n\n\t// Set the raft log store parameters. The new raft_logstore block takes\n\t// precedence, but we still support the deprecated top-level raft_boltdb\n\t// block for backwards compatibility.\n\tconf.RaftLogStoreConfig = &nomad.RaftLogStoreConfig{\n\t\tBackend:              nomad.LogStoreBackendBoltDB,\n\t\tWALSegmentSize:       raftwal.DefaultSegmentSize, // 64MB by default\n\t\tVerificationEnabled:  false,\n\t\tVerificationInterval: 5 * time.Minute,\n\t}\n\tif lsc := agentConfig.Server.RaftLogStoreConfig; lsc != nil {\n\t\tif lsc.Backend != \"\" {\n\t\t\tconf.RaftLogStoreConfig.Backend = lsc.Backend\n\t\t}\n\t\tconf.RaftLogStoreConfig.DisableLogCache = lsc.DisableLogCache\n\t\tif lsc.BoltDB != nil {\n\t\t\tconf.RaftLogStoreConfig.BoltDBNoFreelistSync = lsc.BoltDB.NoFreelistSync","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/agent.go#L641-L677","documentation":"convertServerConfig rejects a server configuration that supplies both the deprecated top-level raft_boltdb block and the newer raft_logstore block. The new raft_logstore block supersedes raft_boltdb, and specifying both is ambiguous, so the agent fails conversion instead of silently picking one. This check runs at agent start (serverConfig), at reload (handleReload), and in tests of the conversion path.","triggerScenarios":"Server config contains both a `raft_boltdb { ... }` block (legacy) and a `raft_logstore { ... }` block simultaneously, during `nomad agent -server` startup or a SIGHUP reload.","commonSituations":"Migrating to raft_logstore but leaving the old raft_boltdb block commented-in or merged by a config management tool (Chef/Ansible/Puppet) that appends blocks; copying a community example that mixes eras; incremental config upgrades where the old block was forgotten.","solutions":["Remove the deprecated raft_boltdb block and keep only raft_logstore (it takes precedence and is the supported form).","If you must stay on the legacy layout temporarily, remove the raft_logstore block instead.","Audit generated/merged HCL for duplicate raft blocks after config tooling runs.","Restart the agent or SIGHUP reload after cleaning the config."],"exampleFix":"// before\nserver {\n  raft_boltdb {\n    data_dir = \"/var/lib/nomad\"\n  }\n  raft_logstore {\n    store {\n      path = \"/var/lib/nomad/raft\"\n    }\n  }\n}\n// after\nserver {\n  raft_logstore {\n    store {\n      path = \"/var/lib/nomad/raft\"\n    }\n  }\n}","handlingStrategy":"validation","validationCode":"// fail fast if both raft blocks are present in the config source\nblocks := countConfigBlocks(hcl, \"raft_boltdb\", \"raft_logstore\")\nif blocks[\"raft_boltdb\"] > 0 && blocks[\"raft_logstore\"] > 0 {\n    return fmt.Errorf(\"remove deprecated raft_boltdb; keep only raft_logstore\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Migrate fully to raft_logstore and delete raft_boltdb in the same change.","Grep config templates for `raft_boltdb` after upgrades.","Run `nomad validate` before rolling config to server fleets."],"tags":["nomad","config-validation","raft","deprecated-config"],"backgroundTag":"conflicting-config-options","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"}