goreleaser/goreleaser · error

refresh artifacts: %w

Error message

refresh artifacts: %w

What it means

After processing all binaries, signAndNotarize calls binaries.Refresh() to update the in-memory artifact list. If that fails (file system or artifact store problem), the error is wrapped as 'refresh artifacts: %w' and the release fails even though notarization itself completed.

Source

Thrown at internal/pipe/notary/macos.go:158

			return fmt.Errorf("%s: %w", bin.Path, err)
		}

		switch status {
		case notary.AcceptedStatus:
			log.WithField("binary", bin.Path).Info("notarized")
		case notary.InvalidStatus:
			return fmt.Errorf("%s: invalid", bin.Path)
		case notary.RejectedStatus:
			return fmt.Errorf("%s: rejected", bin.Path)
		case notary.TimeoutStatus:
			log.WithField("binary", bin.Path).Info("notarize timeout")
		default:
			log.WithField("binary", bin.Path).Info("notarize still pending")
		}
	}

	if err := binaries.Refresh(); err != nil {
		return fmt.Errorf("refresh artifacts: %w", err)
	}
	return nil
}

View on GitHub (pinned to f5edd73956)

Solutions

  1. Check that the dist directory and all built binaries still exist and are readable after the build
  2. Re-run the release to rule out a transient file system race
  3. Ensure no external process (e.g. antivirus, cleanup script) touches dist during the release
  4. Inspect the wrapped inner error for the concrete file/permission problem
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: ensure dist artifacts exist and are readable
for _, f := range artifacts { if _, err := os.Stat(f); err != nil { return err } }

Try / catch

err := run(); if err != nil {
    var refErr *fs.PathError
    if errors.As(err, &refErr) {
        // missing/moved artifact file: clean dist and rebuild
    }
    return err
}

Prevention

When it happens

Trigger: binaries.Refresh() returns a non-nil error at the end of signAndNotarize — the artifacts registry cannot re-read/refresh the signed binaries from disk.

Common situations: Artifact files deleted or moved by another process during the release; disk errors; permission changes on the dist directory; concurrency issues when other pipes rewrite artifacts mid-run.

Related errors


AI-assisted analysis of goreleaser/goreleaser@f5edd73956 (2026-09-05). Data as JSON: /api/errors/8719863f193cf53a. Report an issue: GitHub.