{"record":{"id":"132f91f399b42c63","repo":"hasura/graphql-engine","slug":"got-error-while-getting-the-sources-list-w","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_delete.go","lineNumber":124,"sourceCode":"\tAll        bool\n\tForce      bool\n\tOnlyServer bool\n\n\tSource cli.Source\n}\n\nfunc (o *MigrateDeleteOptions) Run() error {\n\tvar op errors.Op = \"commands.MigrateDeleteOptions.Run\"\n\n\to.EC.Spin(\"Removing migrations\")\n\tdefer o.EC.Spinner.Stop()\n\n\tif o.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\terr := 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(\n\t\t\t\t\t\t\"error while deleting status for database '%s': %w\",\n\t\t\t\t\t\to.Source.Name,\n\t\t\t\t\t\terr,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_delete.go#L106-L142","documentation":"Raised when `hasura migrate delete --all-databases` cannot export server metadata to enumerate database sources. GetSourcesAndKind calls the v1metadata ExportMetadata API; network, auth, or server errors surface here.","triggerScenarios":"Running migrate delete with --all-databases while the Hasura server is unreachable, the admin secret is wrong, or the metadata export API returns an error.","commonSituations":"Wrong HASURA_GRAPHQL_ENDPOINT or HASURA_GRAPHQL_ADMIN_SECRET, server behind a proxy returning 5xx, Hasura version without the expected metadata structure.","solutions":["Verify the endpoint and admin secret env vars","Test with `hasura metadata export` to confirm metadata API access","Check server logs for the failing API call","Ensure the CLI version matches the server version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify metadata API works before --all-databases\nhasura metadata export --output /dev/null || exit 1","typeGuard":null,"tryCatchPattern":"if err := metadatautil.GetSourcesAndKind(...); err != nil {\n  // distinguish auth vs network via errors.As / string match on 401/5xx\n}","preventionTips":["Pre-check endpoint/admin secret env vars","Run metadata export first to smoke-test auth"],"tags":["metadata","api","network","auth","hasura"],"backgroundTag":"metadata-export-api-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}