multica-ai/multica · error

brew upgrade failed: %w You can try manually: brew upgrade m

Error message

brew upgrade failed: %w
You can try manually: brew upgrade multica-ai/tap/multica

What it means

`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.

Source

Thrown at server/cmd/multica/cmd_update.go:53

	if err != nil {
		fmt.Fprintf(os.Stderr, "Warning: could not check latest version: %v\n", err)
	} else {
		latestVer := strings.TrimPrefix(latest.TagName, "v")
		currentVer := strings.TrimPrefix(version, "v")
		if currentVer == latestVer {
			fmt.Fprintln(os.Stderr, "Already up to date.")
			return nil
		}
		fmt.Fprintf(os.Stderr, "Latest version:  %s\n\n", latest.TagName)
	}

	// Detect installation method and update accordingly.
	if cli.IsBrewInstall() {
		fmt.Fprintln(os.Stderr, "Updating via Homebrew...")
		output, err := cli.UpdateViaBrew()
		if err != nil {
			fmt.Fprintf(os.Stderr, "%s\n", output)
			return fmt.Errorf("brew upgrade failed: %w\nYou can try manually: brew upgrade multica-ai/tap/multica", err)
		}
		fmt.Fprintln(os.Stderr, "Update complete.")
		return nil
	}

	// Not installed via brew — download binary directly from GitHub Releases.
	if latest == nil {
		return fmt.Errorf("could not determine latest version; check https://github.com/multica-ai/multica/releases/latest")
	}
	targetVersion := latest.TagName
	fmt.Fprintf(os.Stderr, "Downloading %s from GitHub Releases...\n", targetVersion)
	output, err := cli.UpdateViaDownloadWithTimeout(targetVersion, updateDownloadTimeout)
	if err != nil {
		return fmt.Errorf("update failed: %w", err)
	}
	fmt.Fprintf(os.Stderr, "%s\nUpdate complete.\n", output)
	return nil
}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Run the suggested manual command: `brew upgrade multica-ai/tap/multica` and read brew's error output.
  2. Confirm `which brew` resolves inside the same shell/session that runs `multica update`.
  3. If the tap/formula moved, re-tap: `brew untap multica-ai/tap && brew tap multica-ai/tap` then upgrade.
  4. If brew keeps failing, fall back to the direct-download path by installing the binary outside Homebrew.

Example fix

# before
multica update   # brew upgrade subprocess fails

# after
brew upgrade multica-ai/tap/multica   # run manually to see the real error
Defensive patterns

Strategy: fallback

Validate before calling

command -v brew >/dev/null 2>&1 || { echo 'brew not on PATH'; exit 1; }
brew tap-info multica-ai/tap >/dev/null 2>&1 || echo 'tap may be missing; expect update failure'

Try / catch

if ! multica update; then echo 'falling back to manual brew upgrade'; brew upgrade multica-ai/tap/multica; fi

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/94bf28f9fa825b0b. Report an issue: GitHub.