{"record":{"id":"e1e7daebc64cf3e7","repo":"argoproj/argo-workflows","slug":"copying-file-contents-failed-w","errorCode":null,"errorMessage":"copying file contents failed: %w","messagePattern":"copying file contents failed: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/cp.go","lineNumber":151,"sourceCode":"\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":133,"sourceCodeEnd":156,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/cp.go#L133-L156","documentation":"In getAndStoreArtifactData, after a successful artifact download HTTP response, the body bytes are streamed to the local file with io.Copy; this wraps any I/O failure that occurs while writing the downloaded artifact data to disk (e.g. disk full, permission denied, device error). It fires in the argo cp command after the server already returned 200, so the failure is purely local file writing, not the transfer itself.","triggerScenarios":"Thrown at cmd/argo/commands/cp.go:151 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the argo cp command; the artifact is re-downloaded from scratch","Check disk space and network stability"],"exampleFix":null,"handlingStrategy":"retry","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"}