{"record":{"id":"607de01fd7e3fe31","repo":"hasura/graphql-engine","slug":"failed-to-read-metadata-status-w-607de0","errorCode":null,"errorMessage":"failed to read metadata status: %w","messagePattern":"failed to read metadata status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/commands/metadata_reload.go","lineNumber":69,"sourceCode":"func (o *MetadataReloadOptions) runWithInfo() error {\n\tvar op errors.Op = \"commands.MetadataReloadOptions.runWithInfo\"\n\n\to.EC.Spin(\"Reloading metadata...\")\n\terr := o.run()\n\to.EC.Spinner.Stop()\n\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"failed to reload metadata: %w\", err))\n\t}\n\n\to.EC.Logger.Info(\"Metadata reloaded\")\n\ticListOpts := &metadataInconsistencyListOptions{\n\t\tEC: o.EC,\n\t}\n\n\terr = icListOpts.read(projectmetadata.NewHandlerFromEC(icListOpts.EC))\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"failed to read metadata status: %w\", err))\n\t}\n\n\tif icListOpts.isConsistent {\n\t\ticListOpts.EC.Logger.Infoln(\"Metadata is consistent\")\n\t} else {\n\t\ticListOpts.EC.Logger.Warnln(\n\t\t\t\"Metadata is inconsistent, use 'hasura metadata ic list' command to see the inconsistent objects\",\n\t\t)\n\t}\n\n\treturn nil\n}\n\nfunc (o *MetadataReloadOptions) run() error {\n\tvar (\n\t\top  errors.Op = \"commands.MetadataReloadOptions.run\"\n\t\terr error\n\t)","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/metadata_reload.go#L51-L87","documentation":"After a successful `metadata reload`, the command automatically checks consistency by reading metadata status via projectmetadata handler. This error means that post-reload consistency read failed — reload worked, but the subsequent status query errored.","triggerScenarios":"`metadata reload` where the reload succeeds but the follow-up read of consistency status fails: transient network failure between the two calls, auth expiry mid-command, or the handler failing to parse the freshly reloaded metadata.","commonSituations":"Intermittent network issues between the two sequential server calls; server briefly unavailable immediately after reload (restart in progress); large metadata taking time to settle after reload causing read timeouts.","solutions":["Simply re-run `metadata inconsistency status` — the reload already succeeded, only the verification failed","Retry `metadata reload` after a short delay if the server was momentarily busy settling","Check the wrapped error for auth/network specifics","If persistent, run `metadata inconsistency list` to verify the server state directly"],"exampleFix":"# before\nhasura metadata reload  # reload OK, then: failed to read metadata status\n# after\nhasura metadata inconsistency status  # verify manually; reload itself succeeded","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := reloadCmd.Execute(); err != nil {\n  if strings.Contains(err.Error(), \"failed to read metadata status\") {\n    // reload itself succeeded; verify with `metadata inconsistency status`\n  }\n}","preventionTips":["Treat post-reload status failures as non-fatal — verify separately","Add short delays between reload and consistency checks in automation","Poll status with retries rather than trusting a single read"],"tags":["metadata","reload","consistency","status","cli","go"],"backgroundTag":"api-request-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}