{"record":{"id":"aee324f39339afa7","repo":"hasura/graphql-engine","slug":"unable-to-initialize-migrations-driver-w","errorCode":null,"errorMessage":"unable to initialize migrations driver: %w","messagePattern":"unable to initialize migrations driver: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_squash.go","lineNumber":114,"sourceCode":"\tnewVersion int64\n\n\tdeleteSource bool\n\tSource       cli.Source\n}\n\nfunc (o *migrateSquashOptions) run() error {\n\tvar op errors.Op = \"commands.migrateSquashOptions.run\"\n\n\to.EC.Logger.Warnln(\n\t\t\"This command is currently experimental and hence in preview, correctness of squashed migration is not guaranteed!\",\n\t)\n\n\to.EC.Spin(fmt.Sprintf(\"Squashing migrations from %d to latest...\", o.from))\n\tdefer o.EC.Spinner.Stop()\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(\"unable to initialize migrations driver: %w\", err))\n\t}\n\n\tstatus, err := migrateDrv.GetStatus()\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"finding status: %w\", err))\n\t}\n\n\tvar toMigration, fromMigration *migrate.MigrationStatus\n\n\tfromMigration, ok := status.Read(o.from)\n\tif !ok {\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\n\t\t\t\t\"validating 'from' migration failed. Make sure migration with version %v exists\",\n\t\t\t\to.from,\n\t\t\t),\n\t\t)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_squash.go#L96-L132","documentation":"Returned by `hasura migrate squash` when migrate.NewMigrate fails to build the migrations driver for the selected source, combining project directory state and server state.","triggerScenarios":"Invalid or missing --database-name, unsupported source kind, or failure contacting the server while initializing the driver.","commonSituations":"config.yaml not pointing at the right database, wrong endpoint/admin secret, CLI version older than the server's metadata API.","solutions":["Verify the database name and endpoint config","Run `hasura migrate status` to confirm driver init works","Align CLI and server versions","Check admin secret env var"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"hasura migrate status --database-name <db> # confirms driver init works","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate database name and endpoint before squash","Pin CLI version to server version"],"tags":["initialization","driver","squash","hasura"],"backgroundTag":"driver-initialization-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}