hasura/graphql-engine · error
error removing migration from server: %w
Error message
error removing migration from server: %w
What it means
Returned when RemoveVersions fails to remove the selected migration versions from the Hasura server (deleting rows from hdb_migrations and reverting tracked metadata).
Source
Thrown at cli/commands/migrate_delete.go:197
sourceVersions = []uint64{o.Version}
serverVersions = []uint64{o.Version}
} else if o.All {
for k, v := range status.Migrations {
if v.IsApplied {
serverVersions = append(serverVersions, k)
}
if v.IsPresent {
sourceVersions = append(sourceVersions, k)
}
}
}
// resets the migrations on server
err = migrateDrv.RemoveVersions(serverVersions)
if err != nil {
return errors.E(op, fmt.Errorf("error removing migration from server: %w", err))
}
// removes the migrations on source
if !o.OnlyServer {
err = DeleteVersions(o.EC, sourceVersions, o.Source)
if err != nil {
return errors.E(op, fmt.Errorf("error removing migrations from project: %w", err))
}
}
o.EC.Spinner.Stop()
o.EC.Logger.Infof("Deleted migrations")
return nil
}
func DeleteVersions(ec *cli.ExecutionContext, versions []uint64, source cli.Source) error {
var op errors.Op = "commands.DeleteVersions"View on GitHub (pinned to 724551b9ae)
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
Defensive patterns
Strategy: retry
Try / catch
if err := migrateDrv.RemoveVersions(vs); err != nil {
// check wrapped error for 5xx -> retry; 4xx -> fix auth and re-run
} Prevention
- Confirm DB connectivity from the Hasura server
- Avoid concurrent migrate operations against one source
When it happens
Trigger: Server API error while deleting migration records, database connectivity issues from the server, or concurrent modification of migration state.
Common situations: Target database unreachable from the Hasura server, admin secret expired mid-operation, server/CLI version mismatch on the migrate API.
Related errors
- operation failed: %w
- cannot write migration directory: %w
- applying migrations on source: %s: %w
- operation failed: %w
- error while deleting status for database '%s': %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/4554a900d0511cbd.
Report an issue: GitHub.