{"record":{"id":"ff40d7613432f0c2","repo":"multica-ai/multica","slug":"refresh-skill-w","errorCode":null,"errorMessage":"refresh skill: %w","messagePattern":"refresh skill: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":438,"sourceCode":"\n\tfmt.Printf(\"Skill deleted: %s\\n\", args[0])\n\treturn nil\n}\n\nfunc runSkillRefresh(cmd *cobra.Command, args []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// The server re-fetches the bundle from the upstream source before\n\t// answering; give it the same budget as an import (server-side cap: 45s).\n\tctx, cancel := context.WithTimeout(context.Background(), cli.AtLeastAPITimeout(60*time.Second))\n\tdefer cancel()\n\n\tvar result map[string]any\n\tif err := client.PostJSON(ctx, \"/api/skills/\"+args[0]+\"/refresh\", map[string]any{}, &result); err != nil {\n\t\treturn fmt.Errorf(\"refresh skill: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, result)\n\t}\n\n\tfmt.Printf(\"Skill updated from source: %s (%s)\\n\", strVal(result, \"name\"), strVal(result, \"id\"))\n\treturn nil\n}\n\nfunc runSkillImport(cmd *cobra.Command, _ []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\timportURL, _ := cmd.Flags().GetString(\"url\")","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L420-L456","documentation":"Returned by the `multica skill refresh` CLI subcommand when POSTing to `/api/skills/{id}/refresh` fails. Refresh makes the server re-fetch the skill bundle from its upstream source before answering, so unlike other skill calls this one can fail because of *upstream* fetch problems (unreachable source URL, changed bundle layout), in addition to the usual transport/auth/404 causes. The CLI deliberately grants a 60s budget (server caps at 45s) to accommodate the upstream round-trip.","triggerScenarios":"Refreshing a skill whose recorded upstream URL is dead or moved (server-side fetch error → 5xx); refreshing a non-existent skill ID (404); slow upstream exceeding even the 60s client budget (context deadline exceeded); server or network down.","commonSituations":"A skill imported from a GitHub repo whose archive URL changed or repo went private; upstream host rate-limiting the server; refreshing skills imported from --file (no upstream source) rather than --url; stale ID after database reset.","solutions":["Check the skill's source URL is still valid: `multica skill get <id> --output json` and open the recorded source URL yourself.","If the upstream moved, re-import the skill from the new URL with `multica skill import --url ... --on-conflict overwrite` instead of refreshing.","If the failure is a timeout, retry once — upstream latency is often transient.","Confirm the skill ID exists and the server is reachable (`multica skill get <id>`)."],"exampleFix":"// before\nmultica skill refresh my-skill   # upstream repo moved\n\n// after\nmultica skill get my-skill --output json | jq .source_url  # verify source\nmultica skill import --url https://new-host/skill.zip --on-conflict overwrite  # re-point","handlingStrategy":"retry","validationCode":"# verify the skill and its upstream source before refreshing\nmultica skill get \"$SKILL_ID\" --output json | jq -e '.source_url' > /dev/null || exit 1\ncurl -fsSI \"$(multica skill get \"$SKILL_ID\" --output json | jq -r .source_url)\" > /dev/null || { echo 'upstream unreachable'; exit 1; }","typeGuard":null,"tryCatchPattern":"Retry once on timeout-flavored errors (upstream latency is often transient); on persistent failure fall back to re-import with `skill import --url <new-url> --on-conflict overwrite`; distinguish 404 (bad ID — do not retry) from 5xx (upstream problem — re-import instead of retry).","preventionTips":["Keep the skill's source URL current; re-import with overwrite when the upstream moves rather than refreshing a dead link.","Remember skills imported from --file have no upstream and cannot be refreshed.","Budget for the 45s server-side fetch when scripting refreshes."],"tags":["cli","http","skill","upstream","refresh"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}