hasura/graphql-engine · error
moving seeds to target database directory: %w
Error message
moving seeds to target database directory: %w
What it means
UpdateProjectV3 could not copy seed files into the new per-database seeds directory via copyFiles/util.CopyFileAfero. The wrapped error carries the underlying copy failure.
Source
Thrown at cli/internal/scripts/update-project-v3.go:198
}
// move migration directories to target database directory
if err := copyMigrations(
opts.Fs,
migrationDirectoriesToMove,
opts.MigrationsAbsDirectoryPath,
targetMigrationsDirectoryName,
); err != nil {
return errors.E(op, fmt.Errorf("moving migrations to target database directory: %w", err))
}
// move seed directories to target database directory
if err := copyFiles(
opts.Fs,
seedFilesToMove,
opts.SeedsAbsDirectoryPath,
targetSeedsDirectoryName,
); err != nil {
return errors.E(op, fmt.Errorf("moving seeds to target database directory: %w", err))
}
opts.EC.Logger.Debug("completed: copy old migrations to new directory structure")
opts.EC.Logger.Debug("start: generate new config file")
opts.EC.Spin("Generating new config file ")
// write new config file
newConfig := *opts.EC.Config
newConfig.Version = cli.V3
if err := opts.EC.WriteConfig(&newConfig); err != nil {
return errors.E(op, err)
}
opts.EC.Config = &newConfig
opts.EC.Logger.Debug("completed: generate new config file")
opts.EC.Logger.Debug("start: delete old migrations and seeds")View on GitHub (pinned to 724551b9ae)
Solutions
- Check the wrapped error for the failing file; restore it if missing
- Fix read/write permissions on the seeds directory
- Restore seeds/ from version control and re-run the script
- Re-run `hasura scripts update-project-v3`
Defensive patterns
Strategy: try-catch
Validate before calling
for _, f := range seedFiles {
if _, err := os.Stat(filepath.Join(seedsDir, f)); err != nil {
return fmt.Errorf("missing seed file %s", f)
}
} Try / catch
if err := scripts.UpdateProjectV3(opts); err != nil {
if strings.Contains(err.Error(), "moving seeds to target database directory") { /* verify files, restore from VCS, retry */ }
} Prevention
- Commit seeds to version control
- Avoid editing seeds during the upgrade
- Check disk space before large copies
When it happens
Trigger: `hasura scripts update-project-v3` when a seed file cannot be read from the seeds root or written into seeds/<targetDatabase> (permissions, deleted mid-run, disk full).
Common situations: Seeds edited or removed by a teammate/tool during the upgrade, unwritable seeds directory, or a partial previous run leaving inconsistent state.
Related errors
- error in copying starter kit: %w
- getting list of seed files to move: %w
- creating target seeds directory: %w
- moving migrations to target database directory: %w
- moving %s to %s : %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/5efcedf3806b9e1a.
Report an issue: GitHub.