ipfs/kubo · error

error extracting binary from archive: %w

Error message

error extracting binary from archive: %w

What it means

Fired by unpackZip when opening the matching zip entry (fis.Open) for the migration binary fails — e.g. entry corruption or unsupported compression. It wraps the error and aborts extraction of the migration binary.

Source

Thrown at repo/fsrepo/migrations/unpack.go:81

	}

	return writeToPath(bin, out)
}

func unpackZip(arcPath, root, name, out string) error {
	zipr, err := zip.OpenReader(arcPath)
	if err != nil {
		return fmt.Errorf("error opening zip reader: %w", err)
	}
	defer zipr.Close()

	lookFor := root + "/" + name
	var bin io.ReadCloser
	for _, fis := range zipr.File {
		if fis.Name == lookFor {
			rc, err := fis.Open()
			if err != nil {
				return fmt.Errorf("error extracting binary from archive: %w", err)
			}

			bin = rc
			break
		}
	}

	if bin == nil {
		return errors.New("no binary found in archive")
	}

	return writeToPath(bin, out)
}

func writeToPath(rc io.Reader, out string) error {
	binfi, err := os.Create(out)
	if err != nil {
		return fmt.Errorf("error creating output file '%s': %w", out, err)

View on GitHub (pinned to 329838acdf)

Solutions

  1. Retry with a fresh download; corrupt entries come from truncated transfers
  2. Verify disk space and file permissions
  3. Extract the binary manually from a re-downloaded archive
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at repo/fsrepo/migrations/unpack.go:81 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/77379a7f1811756e. Report an issue: GitHub.