chenhg5/cc-connect · error

zip: %w

Error message

zip: %w

What it means

Raised when extractFromZip cannot open the downloaded update archive as a valid ZIP file — corrupt download, truncated file, or wrong archive format. It wraps zip.OpenReader's error and aborts the self-update before the cc-connect binary is extracted.

Source

Thrown at cmd/cc-connect/update.go:360

			if err != nil {
				return "", err
			}
			if _, err := io.Copy(tmp, tr); err != nil {
				tmp.Close()
				os.Remove(tmp.Name())
				return "", fmt.Errorf("extract: %w", err)
			}
			tmp.Close()
			return tmp.Name(), nil
		}
	}
	return "", fmt.Errorf("binary not found in archive")
}

func extractFromZip(archivePath string) (string, error) {
	r, err := zip.OpenReader(archivePath)
	if err != nil {
		return "", fmt.Errorf("zip: %w", err)
	}
	defer r.Close()

	for _, f := range r.File {
		if !strings.HasPrefix(f.Name, "cc-connect") {
			continue
		}
		rc, err := f.Open()
		if err != nil {
			return "", err
		}
		tmp, err := os.CreateTemp("", "cc-connect-update-*")
		if err != nil {
			rc.Close()
			return "", err
		}
		if _, err := io.Copy(tmp, rc); err != nil {
			tmp.Close()

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Retry the update — the download may have been truncated
  2. Check disk space and network stability
  3. Download the release manually if the archive is persistently corrupt
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/cc-connect/update.go:360 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/398b90fccb5b12b0. Report an issue: GitHub.