{"record":{"id":"e0971db96d400b57","repo":"hasura/graphql-engine","slug":"error-validating-flags-w","errorCode":null,"errorMessage":"error validating flags: %w","messagePattern":"error validating flags: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/migrate_apply.go","lineNumber":433,"sourceCode":"\t\t\t\t},\n\t\t\t)\n\t\t}\n\t}\n\n\tif o.EC.AllDatabases && (len(o.GotoVersion) > 0 || len(o.VersionMigration) > 0) {\n\t\treturn herrors.E(op, \"cannot use --goto or --version in conjunction with --all-databases\")\n\t}\n\n\tmigrationType, step, err := getMigrationTypeAndStep(\n\t\to.UpMigration,\n\t\to.DownMigration,\n\t\to.VersionMigration,\n\t\to.MigrationType,\n\t\to.GotoVersion,\n\t\to.SkipExecution,\n\t)\n\tif err != nil {\n\t\treturn herrors.E(op, fmt.Errorf(\"error validating flags: %w\", err))\n\t}\n\n\tmigrateDrv, err := migrate.NewMigrate(o.EC, true, o.Source.Name, o.Source.Kind)\n\tif err != nil {\n\t\treturn herrors.E(op, err)\n\t}\n\n\tmigrateDrv.SkipExecution = o.SkipExecution\n\tmigrateDrv.DryRun = o.DryRun\n\tmigrateDrv.ProgressBarLogs = o.ProgressBarLogs\n\tmigrateDrv.NoTransaction = o.NoTransaction\n\tmigrateDrv.PerMigrationTransaction = o.PerMigrationTransaction\n\n\tif err := ExecuteMigration(migrationType, migrateDrv, step); err != nil {\n\t\treturn herrors.E(op, err)\n\t}\n\n\treturn nil","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/migrate_apply.go#L415-L451","documentation":"`hasura migrate apply` (Exec) validates its flags via migrate.ValidateUpgradeToV3Flags-ish checks (version, migration type, goto-version, skip-execution combos). Invalid combinations are wrapped in this message.","triggerScenarios":"Passing conflicting flags such as --version together with --goto-version, invalid --version-type, or --skip-execution with unsupported modes.","commonSituations":"Scripts combining flags copied from different CLI versions; using --goto-version without a valid up|down|version type.","solutions":["Run `hasura migrate apply --help` and check flag constraints for your CLI version","Use either --version N or --goto-version N, not both","Omit --skip-execution unless doing a version-chain-only update","Update scripts to the current flag semantics after CLI upgrades"],"exampleFix":"# before\nhasura migrate apply --version 2 --goto-version 5 --version-type up\n# after\nhasura migrate apply --goto-version 5 --version-type up","handlingStrategy":"validation","validationCode":"if [ -n \"$VERSION\" ] && [ -n \"$GOTO\" ]; then echo \"use only one of --version/--goto-version\"; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read `hasura migrate apply --help` after every CLI upgrade","Encode flag-combination rules in wrapper scripts"],"tags":["migrate-apply","flag-validation","cli-usage"],"backgroundTag":"invalid-cli-flags","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}