{"record":{"id":"d26cee07b94e603f","repo":"hashicorp/nomad","slug":"failed-to-read-local-task-runner-state-v","errorCode":null,"errorMessage":"failed to read local task runner state: %v","messagePattern":"failed to read local task runner state: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/state/db_bolt.go","lineNumber":664,"sourceCode":"\t\t}\n\n\t\tallocBkt := allAllocsBkt.Bucket([]byte(allocID))\n\t\tif allocBkt == nil {\n\t\t\t// No state for alloc, return\n\t\t\treturn nil\n\t\t}\n\n\t\ttaskBkt := allocBkt.Bucket(taskBucketName(taskName))\n\t\tif taskBkt == nil {\n\t\t\t// No state for task, return\n\t\t\treturn nil\n\t\t}\n\n\t\t// Restore Local State if it exists\n\t\tls = &trstate.LocalState{}\n\t\tif err := taskBkt.Get(taskLocalStateKey, ls); err != nil {\n\t\t\tif !boltdd.IsErrNotFound(err) {\n\t\t\t\treturn fmt.Errorf(\"failed to read local task runner state: %v\", err)\n\t\t\t}\n\n\t\t\t// Key not found, reset ls to nil\n\t\t\tls = nil\n\t\t}\n\n\t\t// Restore Task State if it exists\n\t\tts = &structs.TaskState{}\n\t\tif err := taskBkt.Get(taskStateKey, ts); err != nil {\n\t\t\tif !boltdd.IsErrNotFound(err) {\n\t\t\t\treturn fmt.Errorf(\"failed to read task state: %v\", err)\n\t\t\t}\n\n\t\t\t// Key not found, reset ts to nil\n\t\t\tts = nil\n\t\t}\n\n\t\treturn nil","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/state/db_bolt.go#L646-L682","documentation":"In the task-restore path of BoltStateDB, taskBkt.Get(taskLocalStateKey, ls) fails with an error other than not-found while restoring a task runner's LocalState, so GetTaskRunnerState aborts the whole restore transaction with this wrapped error.","triggerScenarios":"Thrown at client/state/db_bolt.go:664 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the Bolt DB bucket for the affected alloc/task","If state is unrecoverable, delete the alloc bucket or wipe client state dir and let the client re-adopt","Ensure Nomad version compatibility of the stored state format"],"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"}