hasura/graphql-engine · error
cannot create migrations directory: %w
Error message
cannot create migrations directory: %w
What it means
A generic error signalling that some feature used in the metadata is not supported (yet) by this resolver/version. The message string carries the specifics of which feature was rejected.
Source
Thrown at cli/cli.go:750
ec.Config.HTTPClient.SetHeaders(ec.requestHeaders)
// this populates the ec.Config.ServerConfig.HasuraServerInternalConfig
err = ec.Config.GetHasuraInternalServerConfig(httpClient)
if err != nil {
// If config API is not enabled log it and don't fail
ec.Logger.Debugf(
"cannot get config information from server, this might be because config API is not enabled: %v",
err,
)
}
// set name of migration directory
ec.MigrationDir = filepath.Join(ec.ExecutionDirectory, ec.Config.MigrationsDirectory)
if _, err := os.Stat(ec.MigrationDir); stderrors.Is(err, fs.ErrNotExist) {
err = os.MkdirAll(ec.MigrationDir, os.ModePerm)
if err != nil {
return errors.E(op, fmt.Errorf("cannot create migrations directory: %w", err))
}
}
ec.SeedsDirectory = filepath.Join(ec.ExecutionDirectory, ec.Config.SeedsDirectory)
if _, err := os.Stat(ec.SeedsDirectory); stderrors.Is(err, fs.ErrNotExist) {
err = os.MkdirAll(ec.SeedsDirectory, os.ModePerm)
if err != nil {
return errors.E(op, fmt.Errorf("cannot create seeds directory: %w", err))
}
}
if ec.Config.Version >= V2 && ec.Config.MetadataDirectory != "" {
if len(ec.Config.MetadataFile) > 0 {
ec.MetadataFile = filepath.Join(ec.ExecutionDirectory, ec.Config.MetadataFile)
if _, err := os.Stat(ec.MetadataFile); stderrors.Is(err, fs.ErrNotExist) {
err := os.WriteFile(ec.MetadataFile, []byte(""), os.ModePerm)
if err != nil {
return errors.E(op, err)View on GitHub (pinned to 724551b9ae)
Solutions
- Read the message text to identify the unsupported feature and remove or replace it
- Upgrade the engine/resolver to a version that supports the feature
- Check feature flags that gate the feature
Defensive patterns
Strategy: fallback
Try / catch
// treat as a capability probe: catch and degrade
match resolve_metadata(&md) {
Err(e) if matches!(e, ResolveError::UnsupportedFeature { .. }) => fallback_metadata_without_feature(&md),
r => r,
} Prevention
- Pin the metadata format version to what your engine build supports
- Gate experimental features behind flags and test them in a staging environment first
When it happens
Trigger: Using metadata constructs that are parsed but not implemented by the current resolver version (e.g. experimental syntax, newer metadata features on an older build), which the resolver detects and reports via UnsupportedFeature.
Common situations: Upgrading metadata to a newer format while the engine/resolver is older; enabling beta features without the corresponding feature flag; using constructs documented for a different edition.
Related errors
- error while creating http client with TLS configuration %w
- cannot create metadata directory: %w
- Relationship mappings from value expressions are not support
- Relationships with nested field paths are not supported yet.
- the boolean expression '{type_name}' has enabled logical ope
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/e9c6299a782033c8.
Report an issue: GitHub.