{"record":{"id":"c988db474ebc888c","repo":"argoproj/argo-workflows","slug":"request-failed-s","errorCode":null,"errorMessage":"request failed %s","messagePattern":"request failed (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/cp.go","lineNumber":141,"sourceCode":"}\n\nfunc getAndStoreArtifactData(ctx context.Context, namespace string, workflowName string, nodeID string, artifactName string, fileName string, customPath string, c *http.Client, argoServerOpts apiclient.ArgoServerOpts) error {\n\trequest, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(\"%s/artifacts/%s/%s/%s/%s\", argoServerOpts.GetURL(), namespace, workflowName, nodeID, artifactName), nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create request: %w\", err)\n\t}\n\tauthString, err := client.GetAuthString(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.Header.Set(\"Authorization\", authString)\n\tresp, err := c.Do(request)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"request failed with: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"request failed %s\", resp.Status)\n\t}\n\tartifactFilePath := filepath.Join(customPath, fileName)\n\tfileWriter, err := os.Create(artifactFilePath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"creating file failed: %w\", err)\n\t}\n\tdefer fileWriter.Close()\n\t_, err = io.Copy(fileWriter, resp.Body)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"copying file contents failed: %w\", err)\n\t}\n\tlog.Printf(\"Created %q\", fileName)\n\treturn nil\n}\n","sourceCodeStart":123,"sourceCodeEnd":156,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/cp.go#L123-L156","documentation":"The argo cp HTTP GET to the argo-server artifact endpoint returned a non-200 status; the error text is the HTTP status line (e.g. 404 Not Found). Transport-level failures are reported separately as 'request failed with'.","triggerScenarios":"Thrown at cmd/argo/commands/cp.go:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the workflow/node/artifact names in the command","Verify argo-server URL, auth token, and RBAC permissions for artifact access"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}