{"record":{"id":"555c2a2d7b344ed7","repo":"hasura/graphql-engine","slug":"failed-to-list-inconsistent-metadata-w","errorCode":null,"errorMessage":"failed to list inconsistent metadata: %w","messagePattern":"failed to list inconsistent metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/metadata_inconsistency_list.go","lineNumber":31,"sourceCode":"\nfunc newMetadataInconsistencyListCmd(ec *cli.ExecutionContext) *cobra.Command {\n\topts := &metadataInconsistencyListOptions{\n\t\tEC: ec,\n\t}\n\n\tmetadataInconsistencyListCmd := &cobra.Command{\n\t\tUse:          \"list\",\n\t\tAliases:      []string{\"ls\"},\n\t\tShort:        \"List all inconsistent objects from the Hasura Metadata\",\n\t\tLong:         \"At times, when developing, the Hasura Metadata can become inconsistent. This command can be used to list all inconsistent objects from the Hasura Metadata and allow you to understand why your project's Metadata is in an inconsistent state.\",\n\t\tSilenceUsage: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\top := genOpName(cmd, \"RunE\")\n\t\t\terr := opts.run()\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 list inconsistent metadata: %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}\n\n\t\t\treturn nil\n\t\t},\n\t}\n\tf := metadataInconsistencyListCmd.Flags()\n\tf.StringVarP(\n\t\t&opts.outputFormat,\n\t\t\"output\",\n\t\t\"o\",\n\t\t\"\",\n\t\t\"select output format for inconsistent metadata objects(Allowed values: json)\",\n\t)\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/metadata_inconsistency_list.go#L13-L49","documentation":"The `metadata inconsistency list` command runs opts.run() to query the server for inconsistent metadata objects. This error wraps any failure of that listing operation — the server call failed, credentials were rejected, or the response could not be processed.","triggerScenarios":"Running `metadata inconsistency list` when the underlying server query fails: unreachable endpoint, 401/403 from invalid admin secret, server 5xx, or malformed response from a version-skewed server.","commonSituations":"Diagnosing a broken metadata state but the CLI itself cannot reach/authenticate to the server; environment variables for endpoint/secret not set in CI; server restarting or crashed while being inspected.","solutions":["Verify endpoint and admin secret configuration (config file and env overrides)","Confirm basic API access with `metadata export` — identical failure indicates connectivity/auth, not inconsistency logic","Check server health and logs","Match CLI version to server version for the inconsistency APIs"],"exampleFix":"# before\nhasura metadata inconsistency list  # failed to list inconsistent metadata\n# after\nexport HASURA_GRAPHQL_ADMIN_SECRET=$SECRET\nhasura metadata inconsistency list","handlingStrategy":"retry","validationCode":"if _, err := cli.GetCommonMetadataOps(ec).ExportMetadata(); err != nil {\n  return fmt.Errorf(\"cannot reach server for inconsistency list: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := listCmd.Execute(); err != nil {\n  if strings.Contains(err.Error(), \"failed to list inconsistent metadata\") {\n    // fix credentials/connectivity, retry\n  }\n}","preventionTips":["Ensure admin secret env vars are set in automation","Add retries around monitoring-style inconsistency checks","Keep CLI/server versions compatible"],"tags":["metadata","inconsistency","list","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"}