hasura/graphql-engine · error
finding status: %w
Error message
finding status: %w
What it means
Thrown by `hasura migrate squash` when GetStatus fails, i.e. the driver cannot read applied migrations from the server or present migrations from the project directory.
Source
Thrown at cli/commands/migrate_squash.go:119
func (o *migrateSquashOptions) run() error {
var op errors.Op = "commands.migrateSquashOptions.run"
o.EC.Logger.Warnln(
"This command is currently experimental and hence in preview, correctness of squashed migration is not guaranteed!",
)
o.EC.Spin(fmt.Sprintf("Squashing migrations from %d to latest...", o.from))
defer o.EC.Spinner.Stop()
migrateDrv, err := migrate.NewMigrate(o.EC, true, o.Source.Name, o.Source.Kind)
if err != nil {
return errors.E(op, fmt.Errorf("unable to initialize migrations driver: %w", err))
}
status, err := migrateDrv.GetStatus()
if err != nil {
return errors.E(op, fmt.Errorf("finding status: %w", err))
}
var toMigration, fromMigration *migrate.MigrationStatus
fromMigration, ok := status.Read(o.from)
if !ok {
return errors.E(
op,
fmt.Errorf(
"validating 'from' migration failed. Make sure migration with version %v exists",
o.from,
),
)
}
if o.to == -1 {
toMigration = status.Migrations[status.Index[status.Index.Len()-1]]
} else {View on GitHub (pinned to 724551b9ae)
Solutions
- Retry after confirming connectivity with `hasura migrate status`
- Verify admin secret and endpoint
- Ensure the migrations directory exists and is readable
- Inspect server logs for the failing query
Defensive patterns
Strategy: retry
Validate before calling
hasura migrate status --database-name <db>
Try / catch
if err := migrateDrv.GetStatus(); err != nil { /* retry after backoff on network errors */ } Prevention
- Keep migration files parseable and committed
- Check connectivity before squash operations
When it happens
Trigger: Server API failure listing applied migrations, unreachable database from the server, or unreadable/corrupt local migrations directory.
Common situations: Network blips, expired credentials, manually edited migration files, migrations directory deleted mid-operation.
Related errors
- error while retrieving migration status %w
- got error while getting the sources list : %w
- unable to initialize migrations driver: %w
- unable to move migrations from project for: %v : %w
- cannot create migration: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/22d476460868078f.
Report an issue: GitHub.