hasura/graphql-engine · error
error getting status for database '%s': %w
Error message
error getting status for database '%s': %w
What it means
Thrown by migrate status Run in --all-databases mode when RunOnSource returns an error for a specific source (database) listed in metadata. The underlying error typically comes from building the migrate driver or executing status against that source.
Source
Thrown at cli/commands/migrate_status.go:81
o.EC.Spin("Fetching migration status...")
defer o.EC.Spinner.Stop()
if ec.AllDatabases {
sourcesAndKind, err := metadatautil.GetSourcesAndKind(
o.EC.APIClient.V1Metadata.ExportMetadata,
)
if err != nil {
return errors.E(op, fmt.Errorf("got error while getting the sources list : %w", err))
}
for _, source := range sourcesAndKind {
o.Source = cli.Source(source)
status, err := o.RunOnSource()
if err != nil {
return errors.E(
op,
fmt.Errorf("error getting status for database '%s': %w", o.Source.Name, err),
)
}
o.StatusOpts[o.Source] = status
}
return nil
}
o.Source = ec.Source
status, err := o.RunOnSource()
if err != nil {
return errors.E(
op,
fmt.Errorf("error getting status for database '%s': %w", o.Source.Name, err),
)
}View on GitHub (pinned to 724551b9ae)
Solutions
- Check the specific source's database connectivity (psql/connect with its connection string)
- Fix or remove the broken source in Hasura metadata and re-run status
- Run 'hasura migrate status --database <name>' on the failing source for a detailed error
- Verify the database kind is supported by migrate (e.g. postgres)
Defensive patterns
Strategy: try-catch
Validate before calling
// preflight each source's DB connectivity before status
for _, s := range sources {
db, err := sql.Open("pgx", s.DatabaseURL)
if err == nil { err = db.Ping() }
if err != nil { log.Warnf("source %s unhealthy: %v", s.Name, err) }
db.Close()
} Try / catch
Per-source try/catch: log and continue with healthy sources, collect failing source names, and exit non-zero only if all fail — the loop context (%s = source name) tells you which to retry.
Prevention
- Monitor connectivity to every source in metadata
- Remove decommissioned sources from metadata
- Run per-database status in CI to isolate failures
When it happens
Trigger: Running 'hasura migrate status --all-databases' where one of the connected sources has a bad connection string, unreachable database, unsupported database kind, or mismatched migrations state.
Common situations: A source in metadata pointing to a database that is down or credentials rotated; a source added with a wrong DB URL; network egress blocked from server to database.
Related errors
- cannot fetch migrate status: %w
- error fetching config from server: %w
- error fetching server config: %v
- error serving console: %w
- operation failed: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/e44ecdba045c28a9.
Report an issue: GitHub.