hashicorp/nomad · error
failed to get source last index: %w
Error message
failed to get source last index: %w
What it means
Fires in verifyMigration when querying LastIndex on the source raft log store returns an error; the migration's index-range comparison cannot proceed because the source range is unreadable.
Source
Thrown at helper/raftutil/migrate.go:259
// verifyMigration performs sanity checks on the migrated data.
// src and dst should implement both LogStore and StableStore interfaces.
func verifyMigration(src interface {
raft.LogStore
raft.StableStore
}, dst interface {
raft.LogStore
raft.StableStore
}) error {
// Verify log index ranges match.
srcFirst, err := src.FirstIndex()
if err != nil {
return fmt.Errorf("failed to get source first index: %w", err)
}
srcLast, err := src.LastIndex()
if err != nil {
return fmt.Errorf("failed to get source last index: %w", err)
}
dstFirst, err := dst.FirstIndex()
if err != nil {
return fmt.Errorf("failed to get destination first index: %w", err)
}
dstLast, err := dst.LastIndex()
if err != nil {
return fmt.Errorf("failed to get destination last index: %w", err)
}
if srcFirst != dstFirst {
return fmt.Errorf("first index mismatch: source=%d, destination=%d", srcFirst, dstFirst)
}
if srcLast != dstLast {
return fmt.Errorf("last index mismatch: source=%d, destination=%d", srcLast, dstLast)View on GitHub (pinned to 482b49bf1a)
Solutions
- Inspect the source BoltDB store for corruption or lock contention
- Re-run the migration after fixing the underlying storage issue
- Fall back to the pre-migration BoltDB backup if verification keeps failing
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at helper/raftutil/migrate.go:259 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/9e6f1d44588a69e9.
Report an issue: GitHub.