{"record":{"id":"d43a89328479aca9","repo":"hashicorp/nomad","slug":"destroy-hook-q-failed-v","errorCode":null,"errorMessage":"destroy hook %q failed: %v","messagePattern":"destroy hook %q failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/alloc_runner_hooks.go","lineNumber":325,"sourceCode":"\t\t}()\n\t}\n\n\tvar merr multierror.Error\n\tfor _, hook := range ar.runnerHooks {\n\t\th, ok := hook.(interfaces.RunnerDestroyHook)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tname := h.Name()\n\t\tvar start time.Time\n\t\tif ar.logger.IsTrace() {\n\t\t\tstart = time.Now()\n\t\t\tar.logger.Trace(\"running destroy hook\", \"name\", name, \"start\", start)\n\t\t}\n\n\t\tif err := h.Destroy(); err != nil {\n\t\t\tmerr.Errors = append(merr.Errors, fmt.Errorf(\"destroy hook %q failed: %v\", name, err))\n\t\t}\n\n\t\tif ar.logger.IsTrace() {\n\t\t\tend := time.Now()\n\t\t\tar.logger.Trace(\"finished destroy hooks\", \"name\", name, \"end\", end, \"duration\", end.Sub(start))\n\t\t}\n\t}\n\n\treturn merr.ErrorOrNil()\n}\n\nfunc (ar *allocRunner) preKillHooks() {\n\tfor _, hook := range ar.runnerHooks {\n\t\tpre, ok := hook.(interfaces.RunnerPreKillHook)\n\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/alloc_runner_hooks.go#L307-L343","documentation":"During alloc runner destroy, a registered RunnerDestroyHook's Destroy method returned an error; it is wrapped with the hook name and appended to a multierror so remaining destroy hooks still run. The allocation teardown proceeds but cleanup for that hook may be incomplete.","triggerScenarios":"Thrown at client/allocrunner/alloc_runner_hooks.go:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped inner error to identify which hook failed and why","Check client logs around destroy time for the hook's own error details","Re-run cleanup manually if resources were leaked (e.g. network, cgroups)","Restart the client if the alloc is stuck in a non-terminal state"],"exampleFix":null,"handlingStrategy":"fallback","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"}