argoproj/argo-workflows · error

copying file contents failed: %w

Error message

copying file contents failed: %w

What it means

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.

Source

Thrown at cmd/argo/commands/cp.go:151

	}
	request.Header.Set("Authorization", authString)
	resp, err := c.Do(request)
	if err != nil {
		return fmt.Errorf("request failed with: %w", err)
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return fmt.Errorf("request failed %s", resp.Status)
	}
	artifactFilePath := filepath.Join(customPath, fileName)
	fileWriter, err := os.Create(artifactFilePath)
	if err != nil {
		return fmt.Errorf("creating file failed: %w", err)
	}
	defer fileWriter.Close()
	_, err = io.Copy(fileWriter, resp.Body)
	if err != nil {
		return fmt.Errorf("copying file contents failed: %w", err)
	}
	log.Printf("Created %q", fileName)
	return nil
}

View on GitHub (pinned to 35bff19146)

Solutions

  1. Retry the argo cp command; the artifact is re-downloaded from scratch
  2. Check disk space and network stability
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/argo/commands/cp.go:151 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of argoproj/argo-workflows@35bff19146 (2026-09-03). Data as JSON: /api/errors/e1e7daebc64cf3e7. Report an issue: GitHub.