{"record":{"id":"a9421ea6fe4bd1dd","repo":"multica-ai/multica","slug":"get-update-status-w","errorCode":null,"errorMessage":"get update status: %w","messagePattern":"get update status: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_runtime.go","lineNumber":334,"sourceCode":"\t\toutput, _ := cmd.Flags().GetString(\"output\")\n\t\tif output == \"json\" {\n\t\t\treturn cli.PrintJSON(os.Stdout, update)\n\t\t}\n\t\tfmt.Printf(\"Update initiated: %s (status: %s)\\n\", strVal(update, \"id\"), strVal(update, \"status\"))\n\t\treturn nil\n\t}\n\n\t// Poll until completed/failed/timeout.\n\tupdateID := strVal(update, \"id\")\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn fmt.Errorf(\"timed out waiting for update (last status: %s)\", strVal(update, \"status\"))\n\t\tcase <-time.After(2 * time.Second):\n\t\t}\n\n\t\tif err := client.GetJSON(ctx, \"/api/runtimes/\"+args[0]+\"/update/\"+updateID, &update); err != nil {\n\t\t\treturn fmt.Errorf(\"get update status: %w\", err)\n\t\t}\n\n\t\tstatus := strVal(update, \"status\")\n\t\tif status == \"completed\" || status == \"failed\" || status == \"timeout\" {\n\t\t\toutput, _ := cmd.Flags().GetString(\"output\")\n\t\t\tif output == \"json\" {\n\t\t\t\treturn cli.PrintJSON(os.Stdout, update)\n\t\t\t}\n\t\t\tif status == \"completed\" {\n\t\t\t\tfmt.Printf(\"Update completed: %s\\n\", strVal(update, \"output\"))\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"Update %s: %s\\n\", status, strVal(update, \"error\"))\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t}\n}\n","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_runtime.go#L316-L352","documentation":"Wraps a failed GET /api/runtimes/{id}/update/{updateID} status poll inside runRuntimeUpdate's --wait loop. The poll runs every 2 seconds; a transient failure here aborts the wait even though the update itself may be fine.","triggerScenarios":"Thrown at server/cmd/multica/cmd_runtime.go:334 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check connectivity to the runtime and retry fetching the update status."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}