{"record":{"id":"94bf28f9fa825b0b","repo":"multica-ai/multica","slug":"brew-upgrade-failed-w-you-can-try-manually-brew","errorCode":null,"errorMessage":"brew upgrade failed: %w\nYou can try manually: brew upgrade multica-ai/tap/multica","messagePattern":"brew upgrade failed: %w\nYou can try manually: brew upgrade multica-ai/tap/multica","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_update.go","lineNumber":53,"sourceCode":"\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"Warning: could not check latest version: %v\\n\", err)\n\t} else {\n\t\tlatestVer := strings.TrimPrefix(latest.TagName, \"v\")\n\t\tcurrentVer := strings.TrimPrefix(version, \"v\")\n\t\tif currentVer == latestVer {\n\t\t\tfmt.Fprintln(os.Stderr, \"Already up to date.\")\n\t\t\treturn nil\n\t\t}\n\t\tfmt.Fprintf(os.Stderr, \"Latest version:  %s\\n\\n\", latest.TagName)\n\t}\n\n\t// Detect installation method and update accordingly.\n\tif cli.IsBrewInstall() {\n\t\tfmt.Fprintln(os.Stderr, \"Updating via Homebrew...\")\n\t\toutput, err := cli.UpdateViaBrew()\n\t\tif err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"%s\\n\", output)\n\t\t\treturn fmt.Errorf(\"brew upgrade failed: %w\\nYou can try manually: brew upgrade multica-ai/tap/multica\", err)\n\t\t}\n\t\tfmt.Fprintln(os.Stderr, \"Update complete.\")\n\t\treturn nil\n\t}\n\n\t// Not installed via brew — download binary directly from GitHub Releases.\n\tif latest == nil {\n\t\treturn fmt.Errorf(\"could not determine latest version; check https://github.com/multica-ai/multica/releases/latest\")\n\t}\n\ttargetVersion := latest.TagName\n\tfmt.Fprintf(os.Stderr, \"Downloading %s from GitHub Releases...\\n\", targetVersion)\n\toutput, err := cli.UpdateViaDownloadWithTimeout(targetVersion, updateDownloadTimeout)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"update failed: %w\", err)\n\t}\n\tfmt.Fprintf(os.Stderr, \"%s\\nUpdate complete.\\n\", output)\n\treturn nil\n}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_update.go#L35-L71","documentation":"`multica update` detected a Homebrew installation (cli.IsBrewInstall) and delegated the upgrade to `brew upgrade`, but the brew subprocess exited non-zero. The error wraps brew's own failure and the raw brew output has already been printed to stderr, so the underlying cause (network, tap changes, permissions) is visible just above this message.","triggerScenarios":"Running `multica update` on a machine where the binary lives under /opt/homebrew or /usr/local/Cellar while `brew upgrade multica-ai/tap/multica` fails — e.g. brew not on PATH for the current shell, no network to fetch bottles, the tap having been renamed/removed, or macOS permissions issues on the Cellar.","commonSituations":"CI runners with flaky network, brew installed under a non-standard prefix not in PATH, running inside sudo where brew refuses, or the formula missing from the tap after a tap migration.","solutions":["Run the suggested manual command: `brew upgrade multica-ai/tap/multica` and read brew's error output.","Confirm `which brew` resolves inside the same shell/session that runs `multica update`.","If the tap/formula moved, re-tap: `brew untap multica-ai/tap && brew tap multica-ai/tap` then upgrade.","If brew keeps failing, fall back to the direct-download path by installing the binary outside Homebrew."],"exampleFix":"# before\nmultica update   # brew upgrade subprocess fails\n\n# after\nbrew upgrade multica-ai/tap/multica   # run manually to see the real error","handlingStrategy":"fallback","validationCode":"command -v brew >/dev/null 2>&1 || { echo 'brew not on PATH'; exit 1; }\nbrew tap-info multica-ai/tap >/dev/null 2>&1 || echo 'tap may be missing; expect update failure'","typeGuard":null,"tryCatchPattern":"if ! multica update; then echo 'falling back to manual brew upgrade'; brew upgrade multica-ai/tap/multica; fi","preventionTips":["Keep brew on PATH in the same shell that runs multica update.","Periodically run `brew update` so tap metadata stays current.","Treat the printed brew output above the error as the real diagnosis."],"tags":["cli","homebrew","update","network"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}