hashicorp/nomad · error
failed to parse raft_logstore verification interval %q: %w
Error message
failed to parse raft_logstore verification interval %q: %w
What it means
Within convertServerConfig, a raft_logstore verification_interval string is parsed with time.ParseDuration. If the string is not a valid Go duration (e.g. missing unit, wrong syntax), the agent wraps the underlying error and aborts config conversion. Valid values look like "10s", "1m", "2h".
Source
Thrown at command/agent/agent.go:687
VerificationInterval: 5 * time.Minute,
}
if lsc := agentConfig.Server.RaftLogStoreConfig; lsc != nil {
if lsc.Backend != "" {
conf.RaftLogStoreConfig.Backend = lsc.Backend
}
conf.RaftLogStoreConfig.DisableLogCache = lsc.DisableLogCache
if lsc.BoltDB != nil {
conf.RaftLogStoreConfig.BoltDBNoFreelistSync = lsc.BoltDB.NoFreelistSync
}
if lsc.WAL != nil && lsc.WAL.SegmentSizeMB > 0 {
conf.RaftLogStoreConfig.WALSegmentSize = lsc.WAL.SegmentSizeMB * 1024 * 1024
}
if lsc.Verification != nil {
conf.RaftLogStoreConfig.VerificationEnabled = lsc.Verification.Enabled
if lsc.Verification.Interval != "" {
dur, err := time.ParseDuration(lsc.Verification.Interval)
if err != nil {
return nil, fmt.Errorf("failed to parse raft_logstore verification interval %q: %w",
lsc.Verification.Interval, err)
}
conf.RaftLogStoreConfig.VerificationInterval = dur
}
}
} else if bolt := agentConfig.Server.RaftBoltConfig; bolt != nil {
// Backwards compatibility: migrate deprecated raft_boltdb settings
conf.RaftLogStoreConfig.BoltDBNoFreelistSync = bolt.NoFreelistSync
// Clear the legacy field after migration
agentConfig.Server.RaftBoltConfig = nil
}
// Interpret job_max_source_size as bytes from string value
if agentConfig.Server.JobMaxSourceSize == nil {
agentConfig.Server.JobMaxSourceSize = new("1M")
}
jobMaxSourceBytes, err := humanize.ParseBytes(*agentConfig.Server.JobMaxSourceSize)
if err != nil {View on GitHub (pinned to 482b49bf1a)
Solutions
- Change verification.interval to a valid Go duration with an explicit unit, e.g. interval = "10s".
- If a template/variable supplies the value, verify its rendered output (nomad agent -config ... output or `nomad validate`).
- Remove the interval key to fall back to the default verification interval if custom timing is not needed.
- Validate config with `nomad validate <config>` before restarting.
Example fix
// before
raft_logstore {
verification {
enabled = true
interval = "30"
}
}
// after
raft_logstore {
verification {
enabled = true
interval = "30s"
}
} Defensive patterns
Strategy: validation
Validate before calling
if _, err := time.ParseDuration(interval); err != nil {
return fmt.Errorf("raft_logstore verification interval %q is not a valid Go duration (e.g. 10s, 1m): %v", interval, err)
} Prevention
- Always include a unit in duration strings (s, m, h) — Go durations have no default unit.
- Avoid non-standard units like "min"; use "m".
- Validate templated configs with `nomad validate` before restart.
When it happens
Trigger: Server config has server.raft_logstore.verification { interval = "..." } with a non-empty string that time.ParseDuration cannot parse — e.g. "10" (no unit), "ten minutes", "5m30" (malformed), or an interpolated variable that expanded to empty/garbage.
Common situations: Writing interval = "30" assuming seconds are the default (Go durations require a unit); environment-variable templating injecting an unquoted or empty value; typos like "1Omin"; copying Prometheus-style durations like "5m0s" variants that are fine, vs "5min" which is not.
Understand the failure class
Background: "invalid duration" / "failed to parse duration": why your timeout, interval, or TTL string is rejected and which formats each library accepts — this error's family across 32 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- cannot specify both deprecated 'raft_boltdb' and 'raft_logst
- failed to parse start_timeout: %v
- run_for %v not a valid duration: %v
- stdout_repeat_duration %v not a valid duration: %v
- stderr_repeat_duration %v not a valid duration: %v
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/707a702ff7788091.
Report an issue: GitHub.