{"record":{"id":"5efcedf3806b9e1a","repo":"hasura/graphql-engine","slug":"moving-seeds-to-target-database-directory-w","errorCode":null,"errorMessage":"moving seeds to target database directory: %w","messagePattern":"moving seeds to target database directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/scripts/update-project-v3.go","lineNumber":198,"sourceCode":"\t}\n\n\t// move migration directories to target database directory\n\tif err := copyMigrations(\n\t\topts.Fs,\n\t\tmigrationDirectoriesToMove,\n\t\topts.MigrationsAbsDirectoryPath,\n\t\ttargetMigrationsDirectoryName,\n\t); err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"moving migrations to target database directory: %w\", err))\n\t}\n\t// move seed directories to target database directory\n\tif err := copyFiles(\n\t\topts.Fs,\n\t\tseedFilesToMove,\n\t\topts.SeedsAbsDirectoryPath,\n\t\ttargetSeedsDirectoryName,\n\t); err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"moving seeds to target database directory: %w\", err))\n\t}\n\n\topts.EC.Logger.Debug(\"completed: copy old migrations to new directory structure\")\n\n\topts.EC.Logger.Debug(\"start: generate new config file\")\n\topts.EC.Spin(\"Generating new config file \")\n\t// write new config file\n\tnewConfig := *opts.EC.Config\n\n\tnewConfig.Version = cli.V3\n\tif err := opts.EC.WriteConfig(&newConfig); err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\topts.EC.Config = &newConfig\n\topts.EC.Logger.Debug(\"completed: generate new config file\")\n\n\topts.EC.Logger.Debug(\"start: delete old migrations and seeds\")","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/scripts/update-project-v3.go#L180-L216","documentation":"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.","triggerScenarios":"`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).","commonSituations":"Seeds edited or removed by a teammate/tool during the upgrade, unwritable seeds directory, or a partial previous run leaving inconsistent state.","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`"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for _, f := range seedFiles {\n    if _, err := os.Stat(filepath.Join(seedsDir, f)); err != nil {\n        return fmt.Errorf(\"missing seed file %s\", f)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := scripts.UpdateProjectV3(opts); err != nil {\n    if strings.Contains(err.Error(), \"moving seeds to target database directory\") { /* verify files, restore from VCS, retry */ }\n}","preventionTips":["Commit seeds to version control","Avoid editing seeds during the upgrade","Check disk space before large copies"],"tags":["filesystem","copy","seeds","hasura-cli"],"backgroundTag":"file-copy-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}