{"record":{"id":"137a749dcd91cca3","repo":"hasura/graphql-engine","slug":"got-error-while-getting-the-sources-list-w-137a74","errorCode":null,"errorMessage":"got error while getting the sources list : %w","messagePattern":"got error while getting the sources list : %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_status.go","lineNumber":71,"sourceCode":"\t\t\treturn nil\n\t\t},\n\t}\n\n\treturn migrateStatusCmd\n}\n\nfunc (o *MigrateStatusOptions) Run() error {\n\tvar op errors.Op = \"commands.MigrateStatusOptions.Run\"\n\n\to.EC.Spin(\"Fetching migration status...\")\n\tdefer o.EC.Spinner.Stop()\n\n\tif ec.AllDatabases {\n\t\tsourcesAndKind, err := metadatautil.GetSourcesAndKind(\n\t\t\to.EC.APIClient.V1Metadata.ExportMetadata,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"got error while getting the sources list : %w\", err))\n\t\t}\n\n\t\tfor _, source := range sourcesAndKind {\n\t\t\to.Source = cli.Source(source)\n\n\t\t\tstatus, err := o.RunOnSource()\n\t\t\tif err != nil {\n\t\t\t\treturn errors.E(\n\t\t\t\t\top,\n\t\t\t\t\tfmt.Errorf(\"error getting status for database '%s': %w\", o.Source.Name, err),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\to.StatusOpts[o.Source] = status\n\t\t}\n\n\t\treturn nil\n\t}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_status.go#L53-L89","documentation":"Thrown by migrate status Run when --all-databases is set and metadatautil.GetSourcesAndKind fails while exporting metadata from the Hasura server to enumerate sources. It means the CLI could not read server metadata, so per-source status cannot be computed.","triggerScenarios":"Running 'hasura migrate status --all-databases' when ExportMetadata request fails: server unreachable, invalid admin secret, incompatible server version, or malformed metadata response.","commonSituations":"Wrong --endpoint or --admin-secret, Hasura server not running, network/VPN issues, or using a CLI version whose metadata export API differs from the server's.","solutions":["Verify the Hasura server is up and the --endpoint URL is correct","Verify --admin-secret (or HASURA_GRAPHQL_ADMIN_SECRET env) is valid","Check server logs for metadata export errors and fix any corrupted metadata","Match CLI version to server version (hasura version vs server version)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify server reachability + auth before running status\nreq, _ := http.NewRequest(\"GET\", endpoint+\"/v1/version\", nil)\nreq.Header.Set(\"X-Hasura-Admin-Secret\", adminSecret)\nif resp, err := http.DefaultClient.Do(req); err != nil || resp.StatusCode != 200 {\n    return fmt.Errorf(\"server unreachable or auth failed: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"Wrap the migrate status call; on this error, distinguish auth (401/403 in wrapped error) from connectivity (connection refused/timeout) and surface an actionable message instead of retrying blindly.","preventionTips":["Pin CLI and server versions together in CI","Validate endpoint/admin-secret in a preflight check","Fail fast in scripts when HASURA_GRAPHQL_ADMIN_SECRET is unset"],"tags":["hasura","metadata","network","auth"],"backgroundTag":"metadata-export-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}