matryer/xbar · error

file not supported: %s

Error message

file not supported: %s

What it means

downloadAndReplaceApp only accepts release assets whose filename ends in .zip; any other asset filename causes this error before any download is attempted. It is a guard because the unarchive step uses the archiver package configured for zip files.

Source

Thrown at pkg/update/update.go:186

		if currentV.GreaterThan(latestV) {
			return false // local version is higher
		}
	} else {
		// semver failed - just check tags
		if latest == current {
			return false
		}
	}
	return true
}

func (u *Updater) downloadAndReplaceApp(asset Asset) error {
	filename := path.Base(asset.BrowserDownloadURL)
	switch {
	case strings.HasSuffix(filename, ".zip"):
		// fine
	default:
		return errors.Errorf("file not supported: %s", filename)
	}
	resp, err := u.Client.Get(asset.BrowserDownloadURL)
	if err != nil {
		return errors.Wrap(err, "download asset")
	}
	defer resp.Body.Close()
	const defaultTempDir = ""
	f, err := os.CreateTemp(defaultTempDir, "*-"+filename)
	if err != nil {
		return errors.Wrap(err, "create temp file")
	}
	_, err = io.Copy(f, io.LimitReader(resp.Body, u.DownloadBytesLimit))
	if err != nil {
		f.Close()
		return errors.Wrap(err, "download asset")
	}
	f.Close()
	executable, err := u.GetExecutable()

View on GitHub (pinned to d624239058)

Solutions

  1. Publish the update artifact as a .zip archive so the updater accepts it.
  2. Check the release's attached assets and ensure the expected asset URL ends in .zip.
  3. If you need other formats, extend the switch in downloadAndReplaceApp to handle .tar.gz/.tar.xz via archiver.
  4. Verify the asset URL wasn't rewritten/redirected in a way that changes the basename extension.

Example fix

// before
case strings.HasSuffix(filename, ".zip"):
	// fine
default:
	return errors.Errorf("file not supported: %s", filename)
// after
case strings.HasSuffix(filename, ".zip"), strings.HasSuffix(filename, ".tar.gz"):
	// fine
default:
	return errors.Errorf("file not supported: %s", filename)
Defensive patterns

Strategy: validation

Validate before calling

if !strings.HasSuffix(path.Base(asset.BrowserDownloadURL), ".zip") {
	return fmt.Errorf("asset is not a zip: %s", asset.BrowserDownloadURL)
}

Try / catch

if _, _, err := u.HasUpdate(); err != nil {
	if strings.Contains(err.Error(), "file not supported") {
		log.Printf("release has no zip asset: %v", err)
		return nil
	}
	return err
}

Prevention

When it happens

Trigger: Calling Update() when the release's asset BrowserDownloadURL points to a file that is not .zip (e.g. .tar.gz, .exe, .dmg, .deb, or a bare binary).

Common situations: A GitHub release that ships binaries in tar.gz for Linux or dmg for macOS; the release page attaches multiple assets and the updater selected a non-zip one; a fork publishes .7z archives.

Related errors


AI-assisted analysis of matryer/xbar@d624239058 (2026-09-02). Data as JSON: /api/errors/8b233122b28abd26. Report an issue: GitHub.