Auto-fixing validation errors
Published 26 February 2025
If anonymize fails with validation errors, it is possible to attempt to "auto-fix" any issues by passing the --autofix-file
command line parameter.
Doing so will create a file at the given path that can be used as an options file (passed to masking via the --options-file
command line parameter) to make anonymize run by ignoring any errors that occurred previously.
Generally, tables/columns that caused validation errors will be simply excluded via the generated file. In some cases however, a different configuration will be used.
Not all validation errors can be auto-fixed, so it is possible to generate an auto-fix file and anonymize still fail when using it.
Generating a file
If anonymize fails with validation errors, you can add the --auto-fix
command line parameter to run anonymize again to generate an options file with a suggested workaround for the errors:
- rganonymize mask
- --database-engine SqlServer
- --connection-string "[connection string]"
- --masking-file masking.json
- --auto-fix auto-fix.json
This will generate an options file (auto-fix.json
) that can be used to bypass the errors on next run:
- rganonymize mask
- --database-engine SqlServer
- --connection-string "[connection string]"
- --masking-file masking.json
- --options-file auto-fix.json