hasura/graphql-engine · error
operation failed: %w
Error message
operation failed: %w
What it means
Generic wrapper returned when the underlying MigrateDeleteOptions.Run() operation fails during `hasura migrate delete`. The real cause is in the wrapped error; this message only marks the failure boundary of the command body.
Source
Thrown at cli/commands/migrate_delete.go:87
}
}
if ec.AllDatabases && !opts.Force {
confirmation, err := util.GetYesNoPrompt(
"clear all mentioned migrations of all databases and it's history on the server?",
)
if err != nil {
return errors.E(op, fmt.Errorf("error getting user input: %w", err))
}
if !confirmation {
return nil
}
}
err := opts.Run()
if err != nil {
return errors.E(op, fmt.Errorf("operation failed: %w", err))
}
return nil
},
}
f := migrateDeleteCmd.Flags()
f.Uint64Var(&opts.Version, "version", 0, "deletes the specified version in migrations")
f.BoolVar(&opts.All, "all", false, "clears all migrations for selected database")
f.BoolVar(&opts.Force, "force", false, "when set executes operation without any confirmation")
f.BoolVar(&opts.OnlyServer, "server", false, "to reset migrations only on server")
return migrateDeleteCmd
}
type MigrateDeleteOptions struct {
EC *cli.ExecutionContext
Version uint64View on GitHub (pinned to 724551b9ae)
Solutions
- Inspect the wrapped error message for the root cause
- Check server URL/admin secret connectivity (hasura metadata export)
- Verify the migrations directory exists and is writable
- Re-run `hasura migrate status` to confirm versions exist
Defensive patterns
Strategy: try-catch
Try / catch
// err is errors.E wrapped; inspect errors.Unwrap chain
if err := opts.Run(); err != nil {
fmt.Fprintln(os.Stderr, err) // prints op + wrapped cause
os.Exit(1)
} Prevention
- Read the wrapped cause, not just the outer message
- Validate server connectivity before running destructive commands
When it happens
Trigger: Any failure inside Run(), e.g. metadata export failure when --all-databases is used, or per-source deletion errors propagated from RunOnSource.
Common situations: Server unreachable, invalid admin secret, missing migrations on disk, or permission errors while deleting migration files.
Related errors
- operation failed: %w
- cannot write migration directory: %w
- applying migrations on source: %s: %w
- error while deleting status for database '%s': %w
- error serving console: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/05a67ba00556aa4e.
Report an issue: GitHub.