hasura/graphql-engine · error
determining database kind of '%s': %w
Error message
determining database kind of '%s': %w
What it means
While validating source info, the CLI calls migrate.GetSourceKind (via ec.APIClient.V1Metadata.ExportMetadata) to determine the database kind from server metadata. This error wraps whatever went wrong during that metadata export — HTTP failure, auth error, or malformed response.
Source
Thrown at cli/commands/migrate.go:276
!cmd.Flags().Changed("database-name") {
return errors.E(op, errDatabaseNameNotSet)
}
return nil
}
func validateSourceInfo(ec *cli.ExecutionContext) error {
var op errors.Op = "commands.validateSourceInfo"
// find out the database kind by making a API call to server
// and update ec to include the database name and kind
sourceKind, err := metadatautil.GetSourceKind(
ec.APIClient.V1Metadata.ExportMetadata,
ec.Source.Name,
)
if err != nil {
return errors.E(
op,
fmt.Errorf("determining database kind of '%s': %w", ec.Source.Name, err),
)
}
if sourceKind == nil {
return errors.E(
op,
fmt.Errorf(
"%w: error determining database kind for '%s', check if database exists on hasura",
errDatabaseNotFound,
ec.Source.Name,
),
)
}
ec.Source.Kind = *sourceKind
return nil
}View on GitHub (pinned to 724551b9ae)
Solutions
- Verify connectivity: curl $ENDPOINT/v1metadata with x-hasura-admin-secret
- Ensure --admin-secret / HASURA_GRAPHQL_ADMIN_SECRET matches the server
- Retry after the server is healthy; check server logs for 5xx during export_metadata
Defensive patterns
Strategy: retry
Validate before calling
curl -sf -H "x-hasura-admin-secret: $SECRET" -d '{"type":"export_metadata"}' "$ENDPOINT/v1metadata" >/dev/null Try / catch
if err != nil { var netErr net.Error; if errors.As(err, &netErr) { /* backoff and retry */ } } Prevention
- Wrap migrate calls in retry with backoff for transient network failures
- Verify admin secret before running migrate in CI
When it happens
Trigger: Any `hasura migrate` command (config v3) where exporting metadata from the server fails: bad endpoint, admin secret, 5xx from server, or JSON unmarshal issues.
Common situations: Server not running, wrong HASURA_GRAPHQL_ADMIN_SECRET env, network/VPN issues, or proxy stripping the request.
Related errors
- pulling latest actions codegen files from internet failed: %
- unable to fetch introspection schema: %w
- error in fetching introspection schema: %w
- setting up codegen-assets repo failed (this is required for
- pulling latest actions codegen files from internet failed: %
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/6fe55afe41759634.
Report an issue: GitHub.