{"record":{"id":"8b233122b28abd26","repo":"matryer/xbar","slug":"file-not-supported-s","errorCode":null,"errorMessage":"file not supported: %s","messagePattern":"file not supported: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/update/update.go","lineNumber":186,"sourceCode":"\t\tif currentV.GreaterThan(latestV) {\n\t\t\treturn false // local version is higher\n\t\t}\n\t} else {\n\t\t// semver failed - just check tags\n\t\tif latest == current {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (u *Updater) downloadAndReplaceApp(asset Asset) error {\n\tfilename := path.Base(asset.BrowserDownloadURL)\n\tswitch {\n\tcase strings.HasSuffix(filename, \".zip\"):\n\t\t// fine\n\tdefault:\n\t\treturn errors.Errorf(\"file not supported: %s\", filename)\n\t}\n\tresp, err := u.Client.Get(asset.BrowserDownloadURL)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"download asset\")\n\t}\n\tdefer resp.Body.Close()\n\tconst defaultTempDir = \"\"\n\tf, err := os.CreateTemp(defaultTempDir, \"*-\"+filename)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"create temp file\")\n\t}\n\t_, err = io.Copy(f, io.LimitReader(resp.Body, u.DownloadBytesLimit))\n\tif err != nil {\n\t\tf.Close()\n\t\treturn errors.Wrap(err, \"download asset\")\n\t}\n\tf.Close()\n\texecutable, err := u.GetExecutable()","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/update/update.go#L168-L204","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Publish the update artifact as a .zip archive so the updater accepts it.","Check the release's attached assets and ensure the expected asset URL ends in .zip.","If you need other formats, extend the switch in downloadAndReplaceApp to handle .tar.gz/.tar.xz via archiver.","Verify the asset URL wasn't rewritten/redirected in a way that changes the basename extension."],"exampleFix":"// before\ncase strings.HasSuffix(filename, \".zip\"):\n\t// fine\ndefault:\n\treturn errors.Errorf(\"file not supported: %s\", filename)\n// after\ncase strings.HasSuffix(filename, \".zip\"), strings.HasSuffix(filename, \".tar.gz\"):\n\t// fine\ndefault:\n\treturn errors.Errorf(\"file not supported: %s\", filename)","handlingStrategy":"validation","validationCode":"if !strings.HasSuffix(path.Base(asset.BrowserDownloadURL), \".zip\") {\n\treturn fmt.Errorf(\"asset is not a zip: %s\", asset.BrowserDownloadURL)\n}","typeGuard":null,"tryCatchPattern":"if _, _, err := u.HasUpdate(); err != nil {\n\tif strings.Contains(err.Error(), \"file not supported\") {\n\t\tlog.Printf(\"release has no zip asset: %v\", err)\n\t\treturn nil\n\t}\n\treturn err\n}","preventionTips":["Always publish update artifacts as .zip archives","Inspect release assets on GitHub before tagging a release","Include the platform archive format in your release CI checklist"],"tags":["file-format","zip","update"],"backgroundTag":"unsupported-file-format","analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}