{"record":{"id":"031c77d31b3d596f","repo":"argoproj/argo-workflows","slug":"codenotfound-031c77","errorCode":"CodeNotFound","errorMessage":"res.Status","messagePattern":"res\\.Status","errorType":"error_code","errorClass":null,"httpStatus":404,"severity":"error","filePath":"workflow/artifacts/http/http.go","lineNumber":60,"sourceCode":"\t\t}\n\t\tfor _, h := range inputArtifact.HTTP.Headers {\n\t\t\treq.Header.Add(h.Name, h.Value)\n\t\t}\n\t\tif h.Username != \"\" && h.Password != \"\" {\n\t\t\treq.SetBasicAuth(h.Username, h.Password)\n\t\t}\n\tdefault:\n\t\treturn http.Response{}, errors.InternalErrorf(\"Either Artifactory or HTTP artifact needs to be configured\")\n\t}\n\n\t// Note that we will close the response body in either `Load()`\n\t// or `ArtifactServer.returnArtifact()`, which is the caller of `OpenStream()`.\n\tres, err := h.Client.Do(req) //nolint:bodyclose\n\tif err != nil {\n\t\treturn http.Response{}, err\n\t}\n\tif res.StatusCode == http.StatusNotFound {\n\t\treturn http.Response{}, errors.New(errors.CodeNotFound, res.Status)\n\t}\n\tif res.StatusCode < 200 || res.StatusCode >= 300 {\n\t\treturn http.Response{}, errors.InternalErrorf(\"loading content from %s failed with reason: %s\", url, res.Status)\n\t}\n\treturn *res, nil\n}\n\n// Load reads the artifact from the HTTP URL\nfunc (h *ArtifactDriver) Load(ctx context.Context, inputArtifact *wfv1.Artifact, path string) error {\n\tlf, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\t_ = lf.Close()\n\t}()\n\tres, err := h.retrieveContent(ctx, inputArtifact)\n\tif err != nil {","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/http/http.go#L42-L78","documentation":"The HTTP artifact driver maps a 404 response from the remote server to a CodeNotFound Argo error whose message is the HTTP status line (e.g. \"404 Not Found\"). retrieveContent is shared by Load and OpenStream, so both artifact download and streaming surface this error.","triggerScenarios":"Calling Load() or OpenStream() on an http artifact when the remote server responds with HTTP status 404 to the GET request.","commonSituations":"URL typo or file renamed/moved; artifact expired on the remote (e.g. presigned URL or CI artifact TTL); template expression producing a wrong path; server path requires auth and returns 404 instead of 401.","solutions":["Open the artifact `url` in a browser/curl to confirm it exists and returns 200.","Fix the URL in the spec, including any templated segments that may resolve incorrectly.","If the URL requires auth, configure http headers (e.g. Authorization) on the artifact so the server doesn't return 404/403.","Check retention/TTL on the remote system so the file outlives the workflow."],"exampleFix":"# before\n- http:\n    url: https://example.com/builds/{{workflow.parameters.id}}/artifcat.zip\n# after\n- http:\n    url: https://example.com/builds/{{workflow.parameters.id}}/artifact.zip","handlingStrategy":"validation","validationCode":"resp, err := http.Head(artifactURL)\nif err != nil || resp.StatusCode != 200 {\n    return fmt.Errorf(\"artifact URL %s not reachable: %v\", artifactURL, err)\n}","typeGuard":null,"tryCatchPattern":"var coded errors.CodedError\nif errors.As(err, &coded) && coded.Code() == errors.CodeNotFound {\n    // treat as 404: check URL, auth headers, retention\n}","preventionTips":["curl/HEAD-check templated URLs after parameter resolution","Attach required http headers (auth) to the artifact spec","Ensure remote retention policy outlives the workflow run"],"tags":["http","artifact","not-found","network"],"backgroundTag":"http-404-artifact-fetch","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}