hasura/graphql-engine · warning
skipping applying migrations on database '%s', encountered:
Error message
skipping applying migrations on database '%s', encountered: %s
What it means
While reading the migrations directory for a source, the error matched a directory-not-found error (errors.As errNotFound), meaning migrations/<source_name>/ does not exist. The CLI skips that database, returning the wrapped message rather than aborting the multi-database run.
Source
Thrown at cli/commands/migrate_apply.go:315
errPath *os.PathError
errNotFound *errDatabaseMigrationDirectoryNotFound
)
switch {
case errors.Is(err, migrate.ErrNoChange):
return "nothing to apply on database: " + o.Source.Name, nil
case errors.As(err, &errPath):
// If Op is first, then log No migrations to apply
if errPath.Op == "first" {
return "nothing to apply on database: " + o.Source.Name, nil
}
case errors.As(err, &errNotFound):
// check if the returned error is a directory not found error
// ie might be because a migrations/<source_name> directory is not found
// if so skip this
return "", herrors.E(
op,
fmt.Errorf(
"skipping applying migrations on database '%s', encountered: \n%s",
o.Source.Name,
errNotFound.Error(),
),
)
}
return "", herrors.E(
op,
fmt.Errorf(
"skipping applying migrations on database '%s', encountered: \n%w",
o.Source.Name,
err,
),
)
}
if len(o.Source.Name) == 0 && !o.EC.AllDatabases {View on GitHub (pinned to 724551b9ae)
Solutions
- This is informational — the database is skipped; create migrations to include it: `hasura migrate create X --database-name <name>`
- Or remove the extra directory check by creating migrations/<source_name>/.gitkeep style structure via init
- If the database should not be tracked, untrack it from metadata
Defensive patterns
Strategy: fallback
Validate before calling
test -d "migrations/$DB" || echo "no migrations dir for $DB (will be skipped)"
Try / catch
if strings.Contains(err.Error(), "skipping applying migrations") { /* treat as non-fatal, continue */ } Prevention
- Create a migrations/<source>/ directory when adding new tracked databases
- Filter --database-name lists to databases with local migrations
When it happens
Trigger: `hasura migrate apply` (often with --all-databases) where one tracked source has no local migrations directory, e.g. a database added on the server but never initialized locally.
Common situations: Adding a second database via console then running migrate apply before `hasura init`/migrate create for it; cloning a repo missing a migrations folder.
Related errors
- skipping applying migrations on database '%s', encountered:
- determining database kind of '%s': %w
- error determining database kind for '%s', check if database
- applying migrations failed on database(s): %s
- error validating flags: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/15f30a89833d24c6.
Report an issue: GitHub.