nektos/act · warning

Unable to io.Copy: %v

Error message

Unable to io.Copy: %v

What it means

Thrown by hashFiles() when closing a successfully hashed file fails. Rare — usually indicates a deferred filesystem error (NFS close semantics, file already deleted, descriptor issues). The hash computation itself already succeeded.

Source

Thrown at pkg/exprparser/functions.go:233

		return nil
	}); err != nil {
		return "", fmt.Errorf("Unable to filepath.Walk: %v", err)
	}

	if len(files) == 0 {
		return "", nil
	}

	hasher := sha256.New()

	for _, file := range files {
		f, err := os.Open(file)
		if err != nil {
			return "", fmt.Errorf("Unable to os.Open: %v", err)
		}

		if _, err := io.Copy(hasher, f); err != nil {
			return "", fmt.Errorf("Unable to io.Copy: %v", err)
		}

		if err := f.Close(); err != nil {
			return "", fmt.Errorf("Unable to Close file: %v", err)
		}
	}

	return hex.EncodeToString(hasher.Sum(nil)), nil
}

func (impl *interperterImpl) getNeedsTransitive(job *model.Job) []string {
	needs := job.Needs()

	for _, need := range needs {
		parentNeeds := impl.getNeedsTransitive(impl.config.Run.Workflow.GetJob(need))
		needs = append(needs, parentNeeds...)
	}

View on GitHub (pinned to 4f41128141)

Solutions

  1. Move the workspace to a local filesystem.
  2. Raise the open-file limit (ulimit -n) if hashing many files.
  3. Narrow patterns to reduce the number of opened files.
  4. Retry the run once — transient FS conditions often clear.

Example fix

# shell
# before
ulimit -n 1024
act -j build
# after
ulimit -n 65536
act -j build
Defensive patterns

Strategy: try-catch

Try / catch

if _, err := hashFiles(p...); err != nil {
  if strings.Contains(err.Error(), 'Close file') {
    log.Warn('close failed after successful hash; treating as non-fatal')
    err = nil
  }
}

Prevention

When it happens

Trigger: Hashing files on network filesystems where close() reports stale writes; files deleted between open and close; file-descriptor exhaustion surfacing at close.

Common situations: Workspaces on NFS/SMB mounts inside act; huge trees where ulimit -n is reached; aggressive concurrent cleanup jobs.

Related errors


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/4094a17018a56161. Report an issue: GitHub.