{"record":{"id":"07683cb3d7a39501","repo":"hasura/graphql-engine","slug":"error-while-retrieving-migration-status-w","errorCode":null,"errorMessage":"error while retrieving migration status %w","messagePattern":"error while retrieving migration status %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_delete.go","lineNumber":168,"sourceCode":"\t\treturn errors.E(op, err)\n\t}\n\n\treturn nil\n}\n\nfunc (o *MigrateDeleteOptions) RunOnSource() error {\n\tvar op errors.Op = \"commands.MigrateDeleteOptions.RunOnSource\"\n\n\to.EC.Spin(\"Deleting migration...\")\n\n\tmigrateDrv, err := migrate.NewMigrate(o.EC, true, o.Source.Name, o.Source.Kind)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error in creation of new migrate instance %w\", err))\n\t}\n\n\tstatus, err := migrateDrv.GetStatus()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error while retrieving migration status %w\", err))\n\t}\n\n\t// sourceVersions migration versions in source to be deleted similarly with serverVersions\n\tvar sourceVersions, serverVersions []uint64\n\n\tif !o.All {\n\t\t// if o.version isn't present on source and on server return error version isn't present.\n\t\tif _, ok := status.Migrations[o.Version]; !ok {\n\t\t\treturn errors.E(op, fmt.Errorf(\"version %v not found\", o.Version))\n\t\t}\n\n\t\tsourceVersions = []uint64{o.Version}\n\t\tserverVersions = []uint64{o.Version}\n\t} else if o.All {\n\t\tfor k, v := range status.Migrations {\n\t\t\tif v.IsApplied {\n\t\t\t\tserverVersions = append(serverVersions, k)\n\t\t\t}","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_delete.go#L150-L186","documentation":"Thrown when the migrations driver cannot fetch current migration status from the server and disk while processing `hasura migrate delete`. GetStatus aggregates applied migrations from the server and present migrations from the project directory.","triggerScenarios":"Server API error when listing applied migrations, inconsistent/corrupt hdb_catalog.hdb_migrations table, or unreadable migrations directory.","commonSituations":"Server restarted mid-operation, lost connection, manually tampered migrations table, permissions on the migrations directory.","solutions":["Re-run `hasura migrate status` to see the raw inconsistency","Check network/admin secret (retry after connectivity issues)","Verify the migrations directory is readable","Inspect hdb_migrations on the database for corruption"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"hasura migrate status --database-name <db>","typeGuard":null,"tryCatchPattern":"// transient network errors: retry once after backoff\nif err := migrateDrv.GetStatus(); err != nil { time.Sleep(2*time.Second); err = migrateDrv.GetStatus() }","preventionTips":["Smoke-test status before destructive ops","Avoid editing hdb_migrations manually"],"tags":["status","api","migrations","hasura"],"backgroundTag":"migration-status-fetch-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}