{"record":{"id":"f20e9190b517bacf","repo":"hasura/graphql-engine","slug":"unable-to-delete-migrations-from-project-for-v","errorCode":null,"errorMessage":"unable to delete migrations from project for: %v : %w","messagePattern":"unable to delete migrations from project for: (.+?) : %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_delete.go","lineNumber":227,"sourceCode":"\to.EC.Logger.Infof(\"Deleted migrations\")\n\n\treturn nil\n}\n\nfunc DeleteVersions(ec *cli.ExecutionContext, versions []uint64, source cli.Source) error {\n\tvar op errors.Op = \"commands.DeleteVersions\"\n\n\tfor _, v := range versions {\n\t\tdelOptions := mig.CreateOptions{\n\t\t\tVersion:   strconv.FormatUint(v, 10),\n\t\t\tDirectory: filepath.Join(ec.MigrationDir, source.Name),\n\t\t}\n\n\t\terr := delOptions.Delete()\n\t\tif err != nil {\n\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tfmt.Errorf(\"unable to delete migrations from project for: %v : %w\", v, err),\n\t\t\t)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":209,"sourceCodeEnd":234,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_delete.go#L209-L234","documentation":"Per-version error in DeleteVersions when delOptions.Delete() fails to delete an individual migration file from the project for a given version v. Wraps the underlying filesystem error.","triggerScenarios":"Deleting migration files one by one and one file is missing, read-only, or otherwise unremovable (os.Remove error).","commonSituations":"Files manually moved/renamed, NFS/locked filesystems, running without write permission on the migrations directory.","solutions":["Check the wrapped filesystem error and the file for version v","Fix permissions or unlock the file","Remove the file manually and re-run"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure each version file exists before delete\nfor _, v := range versions {\n  if _, err := os.Stat(fmt.Sprintf(\"%d_*\", v)); err != nil { /* skip or fix */ }\n}","typeGuard":null,"tryCatchPattern":"for _, v := range versions {\n  if err := delOptions.Delete(); err != nil { log.Printf(\"skip %d: %v\", v, err); continue }\n}","preventionTips":["Don't rename migration files manually","Commit all migration files to version control"],"tags":["filesystem","per-file","migrations","hasura"],"backgroundTag":"migration-file-delete-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}