{"record":{"id":"93d3b60f6e4eb515","repo":"multica-ai/multica","slug":"delete-skill-file-w","errorCode":null,"errorMessage":"delete skill file: %w","messagePattern":"delete skill file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_skill.go","lineNumber":722,"sourceCode":"\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, result)\n\t}\n\n\tfmt.Printf(\"Skill file upserted: %s (%s)\\n\", strVal(result, \"path\"), strVal(result, \"id\"))\n\treturn nil\n}\n\nfunc runSkillFilesDelete(cmd *cobra.Command, args []string) error {\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]+\"/files/\"+args[1]); err != nil {\n\t\treturn fmt.Errorf(\"delete skill file: %w\", err)\n\t}\n\n\tfmt.Printf(\"Skill file deleted: %s\\n\", args[1])\n\treturn nil\n}\n","sourceCodeStart":704,"sourceCodeEnd":728,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_skill.go#L704-L728","documentation":"Returned by `multica skill files delete` when DELETE `/api/skills/{id}/files/{fileId}` fails. It takes two positional args (skill ID, file ID) with no client-side format checks; typical causes are 404 for either ID, plus transport/auth/timeout. Note args[1] must be the file's ID, not its path.","triggerScenarios":"Passing the file PATH (e.g. `SKILL.md`) where the FILE ID is expected; deleting an already-deleted file; mistyped skill ID; auth/connectivity failure.","commonSituations":"Copy `PATH` column from `skill files list` table output instead of the `ID` column; double-delete from a retried script; stale IDs after re-importing a skill (re-import recreates files with new IDs).","solutions":["Re-list files and use the ID column: `multica skill files list <skill-id>` → copy ID, not PATH.","If the file is already gone, verify with files list and treat the error as success.","Confirm connectivity/auth if files list itself fails."],"exampleFix":"# before\nmultica skill files delete sk-1 SKILL.md        # path, not ID\n\n# after\nFID=$(multica skill files list sk-1 --output json | jq -r '.[] | select(.path==\"SKILL.md\") | .id')\nmultica skill files delete sk-1 \"$FID\"","handlingStrategy":"validation","validationCode":"FID=\"$(multica skill files list \"$SKILL_ID\" --output json | jq -r --arg p \"$FILE_PATH\" '.[] | select(.path==$p) | .id')\"\n[ -n \"$FID\" ] || { echo \"no file at path $FILE_PATH\"; exit 1; }\nmultica skill files delete \"$SKILL_ID\" \"$FID\"","typeGuard":null,"tryCatchPattern":"Treat 404-flavored failures as already-deleted in idempotent scripts (exit 0 after verifying with files list); retry only transport/5xx causes. Log the skill ID and file ID pair for audit since deletes are destructive.","preventionTips":["Always pass the file ID from `skill files list`, never the path.","Re-list files after any re-import — file IDs change.","Make scripted deletes idempotent by tolerating not-found."],"tags":["cli","http","skill","files","delete"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}