{"record":{"id":"4554a900d0511cbd","repo":"hasura/graphql-engine","slug":"error-removing-migration-from-server-w","errorCode":null,"errorMessage":"error removing migration from server: %w","messagePattern":"error removing migration from server: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_delete.go","lineNumber":197,"sourceCode":"\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}\n\n\t\t\tif v.IsPresent {\n\t\t\t\tsourceVersions = append(sourceVersions, k)\n\t\t\t}\n\t\t}\n\t}\n\n\t// resets the migrations on server\n\terr = migrateDrv.RemoveVersions(serverVersions)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error removing migration from server: %w\", err))\n\t}\n\n\t// removes the migrations on source\n\tif !o.OnlyServer {\n\t\terr = DeleteVersions(o.EC, sourceVersions, o.Source)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error removing migrations from project: %w\", err))\n\t\t}\n\t}\n\n\to.EC.Spinner.Stop()\n\to.EC.Logger.Infof(\"Deleted migrations\")\n\n\treturn nil\n}\n\nfunc DeleteVersions(ec *cli.ExecutionContext, versions []uint64, source cli.Source) error {\n\tvar op errors.Op = \"commands.DeleteVersions\"","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_delete.go#L179-L215","documentation":"Returned when RemoveVersions fails to remove the selected migration versions from the Hasura server (deleting rows from hdb_migrations and reverting tracked metadata).","triggerScenarios":"Server API error while deleting migration records, database connectivity issues from the server, or concurrent modification of migration state.","commonSituations":"Target database unreachable from the Hasura server, admin secret expired mid-operation, server/CLI version mismatch on the migrate API.","solutions":["Check the wrapped error and server logs","Confirm the target database is reachable from the server","Retry after connectivity is restored","If only project files should go, use --only-server=false semantics carefully or delete files manually"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := migrateDrv.RemoveVersions(vs); err != nil {\n  // check wrapped error for 5xx -> retry; 4xx -> fix auth and re-run\n}","preventionTips":["Confirm DB connectivity from the Hasura server","Avoid concurrent migrate operations against one source"],"tags":["server","removal","migrations","hasura"],"backgroundTag":"server-migration-removal-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}