{"record":{"id":"0dc3268f35874748","repo":"hasura/graphql-engine","slug":"version-v-not-found","errorCode":null,"errorMessage":"version %v not found","messagePattern":"version (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_delete.go","lineNumber":177,"sourceCode":"\to.EC.Spin(\"Deleting migration...\")\n\n\tmigrateDrv, err := migrate.NewMigrate(o.EC, true, o.Source.Name, o.Source.Kind)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error in creation of new migrate instance %w\", err))\n\t}\n\n\tstatus, err := migrateDrv.GetStatus()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error while retrieving migration status %w\", err))\n\t}\n\n\t// sourceVersions migration versions in source to be deleted similarly with serverVersions\n\tvar sourceVersions, serverVersions []uint64\n\n\tif !o.All {\n\t\t// if o.version isn't present on source and on server return error version isn't present.\n\t\tif _, ok := status.Migrations[o.Version]; !ok {\n\t\t\treturn errors.E(op, fmt.Errorf(\"version %v not found\", o.Version))\n\t\t}\n\n\t\tsourceVersions = []uint64{o.Version}\n\t\tserverVersions = []uint64{o.Version}\n\t} else if o.All {\n\t\tfor k, v := range status.Migrations {\n\t\t\tif v.IsApplied {\n\t\t\t\tserverVersions = append(serverVersions, k)\n\t\t\t}\n\n\t\t\tif v.IsPresent {\n\t\t\t\tsourceVersions = append(sourceVersions, k)\n\t\t\t}\n\t\t}\n\t}\n\n\t// resets the migrations on server\n\terr = migrateDrv.RemoveVersions(serverVersions)","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_delete.go#L159-L195","documentation":"Raised when `hasura migrate delete --version N` is called and version N does not exist in the migration status (neither on the server nor in the project source directory).","triggerScenarios":"Deleting a version that was already deleted, never existed, or was renamed (e.g. passing 1650000000000 when files use a different timestamp).","commonSituations":"Wrong version number copy-pasted, migration files moved/deleted manually, prior delete already removed the version.","solutions":["Run `hasura migrate status` and copy the exact version number","If already deleted, no action needed","Use --all to delete every version if that's the intent","Check the migrations directory on disk for the actual version prefixes"],"exampleFix":"# before\nhasura migrate delete --version 12345\n# after\nhasura migrate delete --version 1651234567890  # exact version from migrate status","handlingStrategy":"validation","validationCode":"// verify version exists before delete\nstatus, _ := migrateDrv.GetStatus()\nif _, ok := status.Migrations[version]; !ok { log.Fatal(\"version missing\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always copy versions from migrate status output","Script a status check before delete commands"],"tags":["version","not-found","migrations","hasura"],"backgroundTag":"migration-version-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}