{"record":{"id":"0c5226b3e9264fb7","repo":"multica-ai/multica","slug":"update-failed-w","errorCode":null,"errorMessage":"update failed: %w","messagePattern":"update failed: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_update.go","lineNumber":67,"sourceCode":"\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}\n","sourceCodeStart":49,"sourceCodeEnd":72,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_update.go#L49-L72","documentation":"The direct-download update path (cli.UpdateViaDownloadWithTimeout) failed while fetching or applying the release archive for the resolved target version. The wrapped error carries the concrete cause: context deadline exceeded when --download-timeout is too small, 404 when the expected asset is missing for the platform, or write/replace failures on the binary.","triggerScenarios":"Running `multica update` (non-brew) with a slow link and a tight --download-timeout (deadline exceeded), on an OS/arch for which the release has no asset (404), or when the running binary's directory is not writable so the self-replace fails.","commonSituations":"Slow CI networks, exotic platforms without published release assets, installing to system paths without write permission, or hitting a half-published release where the tag exists but assets are still uploading.","solutions":["Read the wrapped error: 'context deadline exceeded' → rerun with a larger timeout, e.g. `--download-timeout 10m`.","404 / asset error → verify the release at github.com/multica-ai/multica/releases has an asset matching your OS/arch.","Permission error → ensure the directory containing the multica binary is writable by the current user.","Persistent failures → reinstall via Homebrew or download the archive manually."],"exampleFix":"# before\nmultica update --download-timeout 30s   # update failed: context deadline exceeded\n\n# after\nmultica update --download-timeout 10m","handlingStrategy":"retry","validationCode":"DFL=$(command -v multica); [ -w \"$(dirname \"$DFL\")\" ] && echo 'binary dir writable' || echo 'update will fail: no write access'","typeGuard":null,"tryCatchPattern":"if ! multica update --download-timeout 10m; then echo 'download update failed; trying manual release download'; # fetch archive from releases page as fallback\nfi","preventionTips":["Size --download-timeout generously on slow links (minutes, not seconds).","Verify a release asset exists for your OS/arch before updating exotic platforms.","Ensure the install directory is writable by the invoking user."],"tags":["cli","network","download","update","timeout"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}