{"record":{"id":"e4bc2ab40700b7ab","repo":"hasura/graphql-engine","slug":"failed-to-read-metadata-status-w","errorCode":null,"errorMessage":"failed to read metadata status: %w","messagePattern":"failed to read metadata status: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/metadata_inconsistency_status.go","lineNumber":30,"sourceCode":"func newMetadataInconsistencyStatusCmd(ec *cli.ExecutionContext) *cobra.Command {\n\topts := &metadataInconsistencyListOptions{\n\t\tEC: ec,\n\t}\n\n\tmetadataInconsistencyStatusCmd := &cobra.Command{\n\t\tUse:          \"status\",\n\t\tShort:        \"Check if the Hasura Metadata is inconsistent or not\",\n\t\tLong:         \"At times, when developing, the Hasura Metadata can become inconsistent. This command can be used to check if the Metadata is inconsistent or not.\",\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\top := genOpName(cmd, \"RunE\")\n\n\t\t\topts.EC.Spin(\"reading metadata status...\")\n\t\t\terr := opts.read(projectmetadata.NewHandlerFromEC(ec))\n\t\t\topts.EC.Spinner.Stop()\n\n\t\t\tif err != nil {\n\t\t\t\treturn errors.E(op, fmt.Errorf(\"failed to read metadata status: %w\", err))\n\t\t\t}\n\n\t\t\tif opts.isConsistent {\n\t\t\t\topts.EC.Logger.Println(\"metadata is consistent\")\n\t\t\t} else {\n\t\t\t\treturn errors.E(\n\t\t\t\t\top,\n\t\t\t\t\t\"metadata is inconsistent, use 'hasura metadata ic list' command to see the inconsistent objects\",\n\t\t\t\t)\n\t\t\t}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn metadataInconsistencyStatusCmd\n}\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/metadata_inconsistency_status.go#L12-L48","documentation":"The `metadata inconsistency status` command reads the server's consistency state via projectmetadata handler (opts.read). This error means reading that status failed — the handler's server query or metadata processing errored before a consistent/inconsistent verdict could be determined.","triggerScenarios":"Running `metadata inconsistency status` where read() fails: ExportMetadata or consistency-check API errors (network, auth, server 5xx), or the returned metadata cannot be parsed by the handler.","commonSituations":"Monitoring scripts polling consistency status against a server that intermittently fails; missing credentials in automated environments; server upgrade mid-poll causing API shape changes; corrupted server metadata breaking the handler's parsing.","solutions":["Verify server connectivity and admin secret (test with `metadata export`)","Check server logs for the failing consistency/metadata request","Retry — transient failures are common in polling scenarios","If parsing is the issue, upgrade the CLI to match the server's metadata API version"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if _, err := cli.GetCommonMetadataOps(ec).ExportMetadata(); err != nil {\n  return fmt.Errorf(\"server not ready for status read: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := statusCmd.Execute(); err != nil {\n  if strings.Contains(err.Error(), \"failed to read metadata status\") {\n    // transient in polling setups: backoff and re-check\n  }\n}","preventionTips":["Add backoff/jitter to polling loops hitting status commands","Verify credentials have not expired in long-running automation","Retry once before alerting on status read failures"],"tags":["metadata","inconsistency","status","server-api","cli","go"],"backgroundTag":"api-request-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}