{"record":{"id":"e92561aa65a4a91e","repo":"multica-ai/multica","slug":"list-issues-w","errorCode":null,"errorMessage":"list issues: %w","messagePattern":"list issues: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":675,"sourceCode":"\t\t}\n\t\t// position (the manual board order) is always ascending, so the server\n\t\t// ignores --direction for it. Reject the combination up front rather\n\t\t// than silently dropping the flag — a passed-but-ignored flag is a\n\t\t// footgun, especially in scripts.\n\t\tif sortVal == \"\" || sortVal == \"position\" {\n\t\t\treturn fmt.Errorf(\"--direction requires --sort to be one of %s; position (the default manual board order) is always ascending\", strings.Join(directionalIssueSortColumns, \", \"))\n\t\t}\n\t\tparams.Set(\"direction\", d)\n\t}\n\n\tpath := \"/api/issues\"\n\tif len(params) > 0 {\n\t\tpath += \"?\" + params.Encode()\n\t}\n\n\tvar result map[string]any\n\tif err := client.GetJSON(ctx, path, &result); err != nil {\n\t\treturn fmt.Errorf(\"list issues: %w\", err)\n\t}\n\n\tissuesRaw, _ := result[\"issues\"].([]any)\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\ttotal, _ := result[\"total\"].(float64)\n\t\tlimit, _ := cmd.Flags().GetInt(\"limit\")\n\t\toffset, _ := cmd.Flags().GetInt(\"offset\")\n\t\thasMore := offset+len(issuesRaw) < int(total)\n\t\twrapped := map[string]any{\n\t\t\t\"issues\":   issuesRaw,\n\t\t\t\"total\":    int(total),\n\t\t\t\"limit\":    limit,\n\t\t\t\"offset\":   offset,\n\t\t\t\"has_more\": hasMore,\n\t\t}\n\t\treturn cli.PrintJSON(os.Stdout, wrapped)","sourceCodeStart":657,"sourceCodeEnd":693,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L657-L693","documentation":"The GET request to /api/issues (with the assembled query string) failed. The %w wraps the API client error, which can be transport-level (server unreachable, timeout), authentication (bad/expired token), or an HTTP error status returned by the server for the combination of query parameters. All flag validation has already passed by this point, so the failure is in the client→server leg.","triggerScenarios":"Running `multica issue list` when the Multica server is down or unreachable from the host; an expired or missing API token (newAPIClient succeeded but the request got 401); a 4xx/5xx from the server such as an invalid combination of server-side filters; DNS/TLS failures.","commonSituations":"CLI pointing at the wrong server URL (staged config); local dev server not running; token rotated since the CLI was configured; network policy blocking the host; server-side validation rejecting a filter value the CLI forwards verbatim (e.g. metadata filter).","solutions":["Read the wrapped error — it distinguishes connection refused / timeout / HTTP status with body.","Check the server is up and the CLI's configured base URL is correct (re-run any auth/setup command the CLI provides).","If the status is 401/403, refresh the token or re-authenticate.","If the status is 400, echo the query you built (the CLI encodes flags verbatim) and simplify filters to isolate the offending parameter.","For transient network errors, retry after connectivity is restored."],"exampleFix":"# before\nMULTICA_URL=https://wrong-host.example multica issue list\n# after\nMULTICA_URL=http://127.0.0.1:8080 multica issue list","handlingStrategy":"retry","validationCode":"# cheap preflight before the real call\ncurl -sf -o /dev/null \"$MULTICA_URL/api/issues?limit=1\" \\\n  || { echo \"server unreachable or unauthorized\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"# shell: retry only on transient-looking failures, never on 4xx input errors\n for i in 1 2 3; do\n   out=$(multica issue list 2>&1) && break\n   case \"$out\" in *\"unauthorized\"*|*\"400\"*) echo \"$out\" >&2; exit 1;; esac\n   sleep $((i*2))\n done\n echo \"$out\"","preventionTips":["Pre-flight the server URL and token before batch runs.","Distinguish 4xx (fix input/auth, don't retry) from 5xx/connection (retry with backoff).","Log the wrapped error verbatim — it contains the HTTP status and body."],"tags":["cli","network","http","issue-list"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}