{"record":{"id":"6573c2840eff8e5b","repo":"hasura/graphql-engine","slug":"error-in-creation-of-new-migrate-instance-w","errorCode":null,"errorMessage":"error in creation of new migrate instance %w","messagePattern":"error in creation of new migrate instance %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_delete.go","lineNumber":163,"sourceCode":"\n\to.Source = o.EC.Source\n\n\terr := o.RunOnSource()\n\tif err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\treturn nil\n}\n\nfunc (o *MigrateDeleteOptions) RunOnSource() error {\n\tvar op errors.Op = \"commands.MigrateDeleteOptions.RunOnSource\"\n\n\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}","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_delete.go#L145-L181","documentation":"Returned when migrate.NewMigrate fails to construct the migrations driver for `hasura migrate delete`. This initializes filesystem + server state for the given source, so an invalid source name/kind or an unreachable server triggers it.","triggerScenarios":"Passing --database-name that doesn't exist in the project config, an unsupported source kind, or server API errors while initializing migration state.","commonSituations":"Typo in database name, config.yaml missing the database entry, CLI/server version mismatch, wrong endpoint or admin secret.","solutions":["Verify the database name exists in config.yaml / the server's sources","Confirm endpoint and admin secret are correct","Run `hasura migrate status` to confirm the driver initializes","Upgrade CLI to match the server version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// confirm database exists in config before running\nhasura migrate status --database-name <db>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate database names against config.yaml","Keep CLI and server versions aligned"],"tags":["initialization","driver","config","hasura"],"backgroundTag":"driver-initialization-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}