hasura/graphql-engine · error

reading response from schema dump api: %w

Error message

reading response from schema dump api: %w

What it means

ExportSchemaDump failed while reading the HTTP response body from the Hasura schema dump API (dump_metadata / run_sql dump endpoint). The read error is wrapped and tagged KindHasuraAPI.

Source

Thrown at cli/migrate/database/hasuradb/schema_dump.go:49

		query := hasura.PGDumpRequest{
			Opts:        opts,
			CleanOutput: true,
			SourceName:  sourceName,
		}

		resp, err := h.pgDumpClient.Send(query)
		if err != nil {
			h.logger.Debug(err)

			return nil, errors.E(op, err)
		}

		bs, err := io.ReadAll(resp)
		if err != nil {
			return nil, errors.E(
				op,
				errors.KindHasuraAPI,
				fmt.Errorf("reading response from schema dump api: %w", err),
			)
		}

		return bs, nil
	}

	return nil, errors.E(
		op,
		fmt.Errorf("schema dump for source %s of kind %v is not supported", sourceName, sourceKind),
	)
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Retry the export; transient network failures are the most common cause
  2. Increase proxy/read timeouts for large schema dumps
  3. Verify network connectivity and Hasura server health
  4. For very large schemas, dump directly from the database instead of via the API
Defensive patterns

Strategy: retry

Validate before calling

// health check before dumping
resp, err := http.Get(endpoint + "/healthz")
if err != nil || resp.StatusCode != 200 { return fmt.Errorf("server unhealthy") }

Try / catch

var buf []byte
for attempt := 0; attempt < 3; attempt++ {
    buf, err = hdb.ExportSchemaDump(...)
    if err == nil { break }
    time.Sleep(time.Duration(attempt+1) * time.Second)
}

Prevention

When it happens

Trigger: Calling ExportSchemaDump when the HTTP response body read is interrupted: connection reset, server closing the stream early, proxy timeouts, or truncated chunked responses.

Common situations: Large schemas timing out behind a reverse proxy or load balancer, flaky network between CLI and Hasura, server restarting mid-response.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/0d3296323bcb4303. Report an issue: GitHub.