{"record":{"id":"72a3be5b5df2615c","repo":"multica-ai/multica","slug":"delete-skill-w","errorCode":null,"errorMessage":"delete skill: %w","messagePattern":"delete skill: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":418,"sourceCode":"\t\treader := bufio.NewReader(os.Stdin)\n\t\tanswer, _ := reader.ReadString('\\n')\n\t\tanswer = strings.TrimSpace(strings.ToLower(answer))\n\t\tif answer != \"y\" && answer != \"yes\" {\n\t\t\tfmt.Println(\"Aborted.\")\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tif err := client.DeleteJSON(ctx, \"/api/skills/\"+args[0]); err != nil {\n\t\treturn fmt.Errorf(\"delete skill: %w\", err)\n\t}\n\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","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L400-L436","documentation":"Returned by the `multica skill delete` CLI subcommand when the DELETE request to `/api/skills/{id}` fails. Because the client error is wrapped with %w, the message carries the true cause: connection failure, timeout, or a non-2xx status — a 404 (no skill with that ID) is by far the most common. No request body is sent, so payload validation is never the issue.","triggerScenarios":"`multica skill delete <id>` with an ID that was already deleted or never existed (404); server down/unreachable; auth credentials invalid so the API returns 401/403; server-side cascading cleanup fails and returns 500.","commonSituations":"Running the same delete twice (e.g. a script retried after a partial failure); ID copied from stale output; deleting a skill that another process removed concurrently; pointing at a fresh dev database.","solutions":["Confirm whether the skill still exists: `multica skill list` — if it is gone, the delete already succeeded and the error can be ignored.","Re-check the exact ID/argument; IDs are positional args and easy to truncate when copying.","Verify connectivity/auth: `multica skill list` against the same --api-url; if that also fails, fix the environment before retrying the delete.","If the server returns 500, inspect server logs — the repository enforces application-layer cleanup for dependent rows (no DB cascades), so a cleanup bug surfaces here."],"exampleFix":"// before\nmultica skill delete old-skill-id   # fails if already deleted\n\n// after\nmultica skill list --output json | jq '.[].id'  # confirm current IDs\nmultica skill delete <confirmed-id>","handlingStrategy":"try-catch","validationCode":"# make deletes idempotent: check existence first\nif multica skill get \"$SKILL_ID\" --output json > /dev/null 2>&1; then\n  multica skill delete \"$SKILL_ID\"\nelse\n  echo \"skill already absent\"\nfi","typeGuard":null,"tryCatchPattern":"Treat 404-in-message as already-deleted and exit 0 in automation; retry only on 5xx/connection errors; never retry a 400 blindly. Log the raw wrapped error for audit since deletes are destructive.","preventionTips":["Make delete scripts idempotent by tolerating 'not found' outcomes.","Confirm the exact ID with `skill list` immediately before deleting.","Avoid re-running a failed delete batch unchanged — IDs may already be gone."],"tags":["cli","http","skill","delete"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}