hasura/graphql-engine · warning

no SQL files found in %s

Error message

no SQL files found in %s

What it means

ApplySeedsToDatabase collected no .sql seed files from the seeds directory and refuses to send an empty bulk request. It is thrown after the database kind check passes but before SendBulk, so a supported database with an empty (or non-matching) seeds folder triggers it. The path in the message is the resolved seedsDirectory passed in the options.

Source

Thrown at cli/seed/apply.go:142

		for _, sql := range sqlAsBytes {
			request := hasura.RequestBody{
				Type: "citus_run_sql",
				Args: hasura.CitusRunSQLInput{
					SQL:    string(sql),
					Source: source.Name,
				},
			}
			args = append(args, request)
		}
	default:
		return errors.E(
			op,
			fmt.Errorf("database %s of kind %s is not supported", source.Name, source.Kind),
		)
	}

	if len(args) == 0 {
		return errors.E(op, fmt.Errorf("no SQL files found in %s", seedsDirectory))
	}

	_, err := d.SendBulk(args)
	if err != nil {
		return errors.E(op, err)
	}

	return nil
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Verify the seeds directory path passed in the seed options actually exists and contains .sql files
  2. Check file extensions are lowercase .sql and files are readable
  3. Generate at least one seed first (e.g. via seed.CreateSeedFile) before applying
  4. If no seeds are expected, skip the apply step instead of calling ApplySeedsToDatabase

Example fix

// before
seedOpts := seed.CreateSeedOpts{ SourceDirectory: "seeds" }
err := seed.ApplyOnSource(client, source, seedOpts, "apply")

// after
if entries, _ := os.ReadDir("seeds"); !hasSQLFiles(entries) {
    log.Println("no seeds to apply, skipping")
    return nil
}
err := seed.ApplyOnSource(client, source, seedOpts, "apply")
Defensive patterns

Strategy: validation

Validate before calling

entries, err := os.ReadDir(seedsDir)
if err != nil { return err }
hasSQL := false
for _, e := range entries {
    if !e.IsDir() && strings.HasSuffix(e.Name(), ".sql") { hasSQL = true; break }
}
if !hasSQL {
    // skip apply instead of erroring
}

Prevention

When it happens

Trigger: Calling ApplySeedsToDatabase (usually via ApplyOnSource) with a seedOpts.SourceDirectory that contains no *.sql files, e.g. a missing, empty, or misnamed directory (files with wrong extension like .txt or .bak).

Common situations: Wrong --seeds path in CI, seeds directory never committed, seed files generated into a different folder, or a typo in the source directory name in the Hasura CLI config.

Related errors


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