{"record":{"id":"b923c46bb10c65a9","repo":"hasura/graphql-engine","slug":"creating-target-seeds-directory-w","errorCode":null,"errorMessage":"creating target seeds directory: %w","messagePattern":"creating target seeds directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/internal/scripts/update-project-v3.go","lineNumber":179,"sourceCode":"\t\treturn errors.E(op, fmt.Errorf(\"getting list of migrations to move: %w\", err))\n\t}\n\t// move seed child directories\n\t// get directory names to move\n\tseedFilesToMove, err := getSeedFiles(opts.Fs, opts.SeedsAbsDirectoryPath)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"getting list of seed files to move: %w\", err))\n\t}\n\n\t// create a new directory for TargetDatabase\n\ttargetMigrationsDirectoryName := filepath.Join(opts.MigrationsAbsDirectoryPath, targetDatabase)\n\tif err = opts.Fs.Mkdir(targetMigrationsDirectoryName, 0o755); err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"creating target migrations directory: %w\", err))\n\t}\n\n\t// create a new directory for TargetDatabase\n\ttargetSeedsDirectoryName := filepath.Join(opts.SeedsAbsDirectoryPath, targetDatabase)\n\tif err = opts.Fs.Mkdir(targetSeedsDirectoryName, 0o755); err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"creating target seeds directory: %w\", err))\n\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 {","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/internal/scripts/update-project-v3.go#L161-L197","documentation":"UpdateProjectV3 fails to create the seeds subdirectory for the target database (<seeds>/<targetDatabase>) while converting the project to config v3's per-database layout. It wraps the afero Mkdir error.","triggerScenarios":"`hasura scripts update-project-v3` with an unwritable, read-only, or already-occupied seeds directory path (permissions denied, directory exists from a partial run, same-named file present).","commonSituations":"Seeds directory owned by another user, CI running as non-root against a protected volume, or re-running the migration script after it failed halfway.","solutions":["Inspect the wrapped error (EACCES/EEXIST/EROFS) and grant write access to the seeds directory","Delete partially created seeds/<database> directory before re-running","Verify the seeds path in config exists and is a writable directory","Re-run the update-project-v3 script"],"exampleFix":"# before\nhasura scripts update-project-v3\n# mkdir /path/to/seeds/postgres: permission denied\n\n# after\nsudo chown -R $USER seeds/\nhasura scripts update-project-v3","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(filepath.Join(seedsDir, targetDB)); err == nil {\n    return fmt.Errorf(\"target seeds dir already exists; remove it first\")\n}","typeGuard":null,"tryCatchPattern":"if err := scripts.UpdateProjectV3(opts); err != nil {\n    if strings.Contains(err.Error(), \"creating target seeds directory\") { /* fix perms or remove existing dir */ }\n}","preventionTips":["Ensure seeds/ is writable","Clean partial runs before retrying","Keep the project on a filesystem the CLI user can write"],"tags":["filesystem","mkdir","permissions","seeds","hasura-cli"],"backgroundTag":"filesystem-permission-denied","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}