{"record":{"id":"8c4a9cd1f0ee8126","repo":"multica-ai/multica","slug":"list-runtimes-w","errorCode":null,"errorMessage":"list runtimes: %w","messagePattern":"list runtimes: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_runtime.go","lineNumber":118,"sourceCode":"\truntimeDeleteCmd.Flags().String(\"output\", \"table\", \"Output format: table or json\")\n}\n\n// ---------------------------------------------------------------------------\n// Runtime commands\n// ---------------------------------------------------------------------------\n\nfunc runRuntimeList(cmd *cobra.Command, _ []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\tvar runtimes []map[string]any\n\tif err := client.GetJSON(ctx, \"/api/runtimes\", &runtimes); err != nil {\n\t\treturn fmt.Errorf(\"list runtimes: %w\", err)\n\t}\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, runtimes)\n\t}\n\n\theaders := []string{\"ID\", \"NAME\", \"MODE\", \"PROVIDER\", \"STATUS\", \"LAST_SEEN\"}\n\trows := make([][]string, 0, len(runtimes))\n\tfor _, rt := range runtimes {\n\t\trows = append(rows, []string{\n\t\t\tstrVal(rt, \"id\"),\n\t\t\tstrVal(rt, \"name\"),\n\t\t\tstrVal(rt, \"runtime_mode\"),\n\t\t\tstrVal(rt, \"provider\"),\n\t\t\tstrVal(rt, \"status\"),\n\t\t\tstrVal(rt, \"last_seen_at\"),\n\t\t})","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_runtime.go#L100-L136","documentation":"runRuntimeList wraps a failure of client.GetJSON against GET /api/runtimes. As with error 640, the wrapped cause is one of: transport failure, non-2xx status (auth, permission), or a decode failure on the []map[string]any payload. Because the target type is a generic map slice, decode failures are unlikely — most real causes are connectivity or auth.","triggerScenarios":"Running `multica runtime list` when the server is unreachable, the token is expired/missing (401), the user lacks permission to list runtimes (403), or the endpoint does not exist yet on an older server (404).","commonSituations":"CLI pointed at a stale base URL; server not yet upgraded to a version exposing /api/runtimes; session credentials expired; running the command in an environment without the CLI config file.","solutions":["Verify server reachability and auth (same checks as error 640: base URL, re-login).","Confirm the deployed server version exposes /api/runtimes (curl it directly); upgrade server or CLI to match.","If a proxy sits in front, ensure it does not strip auth headers or rewrite the path."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := client.GetJSON(ctx, \"/api/runtimes\", &runtimes); err != nil {\n\treturn fmt.Errorf(\"list runtimes: %w\", err) // inspect wrapped status: 401 -> re-login, 404 -> server too old\n}","preventionTips":["Health-check API auth once at script start (e.g. GET /api/workspaces).","Pin CLI and server versions together in deployment scripts.","Cache `runtime list` output instead of hammering it in loops."],"tags":["go","cli","http","runtimes","api-client"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}