{"record":{"id":"405a9f32431228dc","repo":"multica-ai/multica","slug":"get-squad-w","errorCode":null,"errorMessage":"get squad: %w","messagePattern":"get squad: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_squad.go","lineNumber":93,"sourceCode":"\nvar squadGetCmd = &cobra.Command{\n\tUse:   \"get <squad-id>\",\n\tShort: \"Get squad details\",\n\tArgs:  exactArgs(1),\n\tRunE:  runSquadGet,\n}\n\nfunc runSquadGet(cmd *cobra.Command, args []string) error {\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar squad map[string]any\n\tif err := client.GetJSON(ctx, \"/api/squads/\"+args[0], &squad); err != nil {\n\t\treturn fmt.Errorf(\"get squad: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, squad)\n\t}\n\n\tfmt.Printf(\"ID:           %s\\n\", strVal(squad, \"id\"))\n\tfmt.Printf(\"Name:         %s\\n\", strVal(squad, \"name\"))\n\tfmt.Printf(\"Description:  %s\\n\", strVal(squad, \"description\"))\n\tfmt.Printf(\"Leader ID:    %s\\n\", strVal(squad, \"leader_id\"))\n\tfmt.Printf(\"Created:      %s\\n\", strVal(squad, \"created_at\"))\n\tif inst := strVal(squad, \"instructions\"); inst != \"\" {\n\t\tfmt.Printf(\"Instructions: %s\\n\", inst)\n\t}\n\treturn nil\n}\n","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_squad.go#L75-L111","documentation":"Returned by `multica squads get <id>` when GET `/api/squads/{id}` fails. The squad ID is interpolated raw into the URL, so a mistyped, stale, or malformed ID producing a 404 is the dominant cause, alongside the usual transport/auth/timeout failures.","triggerScenarios":"Squad ID that never existed or was deleted; using the squad NAME instead of its ID; ID with stray whitespace/newline from copy-paste; wrong environment (dev vs prod); auth failure.","commonSituations":"Grabbing IDs from old terminal output after the server database was reset; name-vs-ID confusion because the list table shows names prominently; scripting against `squads list` JSON with an incorrect jq field.","solutions":["Resolve the real ID first: `multica squads list --output json` and select by name.","Quote the ID and strip whitespace in scripts.","Confirm the target environment matches where the squad was created."],"exampleFix":"# before\nmultica squads get alpha-team   # name used as ID\n\n# after\nSID=$(multica squads list --output json | jq -r '.[] | select(.name==\"alpha-team\") | .id')\nmultica squads get \"$SID\"","handlingStrategy":"validation","validationCode":"SID=\"$(multica squads list --output json | jq -r --arg n \"$SQUAD_NAME\" '.[] | select(.name==$n) | .id')\"\n[ -n \"$SID\" ] || { echo \"no squad named $SQUAD_NAME\"; exit 1; }\nmultica squads get \"$SID\"","typeGuard":null,"tryCatchPattern":"On failure, branch on the wrapped cause: 404 → re-resolve the ID via squads list; auth/transport → fix environment; other → capture message and check server logs. Do not blind-retry with the same ID after a 404.","preventionTips":["Resolve squad IDs from `squads list --output json` by name instead of hardcoding.","Use IDs, not names, as the positional argument.","Trim whitespace/newlines when extracting IDs from JSON output."],"tags":["cli","http","squad","not-found"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}