{"record":{"id":"4c046b056e1956fa","repo":"hashicorp/nomad","slug":"failed-to-download-artifact-q-v","errorCode":null,"errorMessage":"failed to download artifact %q: %v","messagePattern":"failed to download artifact %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/taskrunner/artifact_hook.go","lineNumber":58,"sourceCode":"\twg *sync.WaitGroup,\n\tresponseStateMutex *sync.Mutex,\n) {\n\tdefer wg.Done()\n\tfor artifact := range jobs {\n\t\taid := artifact.Hash()\n\t\tif req.PreviousState[aid] != \"\" {\n\t\t\th.logger.Trace(\"skipping already downloaded artifact\", \"artifact\", artifact.GetterSource)\n\t\t\tresponseStateMutex.Lock()\n\t\t\tresp.State[aid] = req.PreviousState[aid]\n\t\t\tresponseStateMutex.Unlock()\n\t\t\tcontinue\n\t\t}\n\n\t\th.logger.Debug(\"downloading artifact\", \"artifact\", artifact.GetterSource, \"aid\", aid)\n\n\t\tif err := h.getter.Get(req.TaskEnv, artifact, req.Task.User); err != nil {\n\t\t\twrapped := structs.NewRecoverableError(\n\t\t\t\tfmt.Errorf(\"failed to download artifact %q: %v\", artifact.GetterSource, err),\n\t\t\t\ttrue,\n\t\t\t)\n\t\t\therr := te.NewHookError(wrapped, structs.NewTaskEvent(structs.TaskArtifactDownloadFailed).SetDownloadError(wrapped))\n\n\t\t\terrorChannel <- herr\n\t\t\tcontinue\n\t\t}\n\n\t\t// Mark artifact as downloaded to avoid re-downloading due to\n\t\t// retries caused by subsequent artifacts failing. Any\n\t\t// non-empty value works.\n\t\tresponseStateMutex.Lock()\n\t\tresp.State[aid] = \"1\"\n\t\tresponseStateMutex.Unlock()\n\t}\n}\n\nfunc (*artifactHook) Name() string {","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/taskrunner/artifact_hook.go#L40-L76","documentation":"In the artifact hook's download worker, h.getter.Get failed to fetch an artifact (network error, bad URL, auth failure); it is wrapped as a recoverable error so the task runner can apply restart/backoff policy rather than immediately failing the task.","triggerScenarios":"Thrown at client/allocrunner/taskrunner/artifact_hook.go:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped getter error for the root cause (DNS, 404, TLS, auth)","Verify the artifact source URL is reachable from the client","Check artifact options (headers, checksum) in the job spec","Let Nomad retry; fix the artifact host if it is down"],"exampleFix":null,"handlingStrategy":"retry","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"}