I'm using Python 3.7 and ArcGIS Pro 2.8 (arcpy 2.8, py37_arcgispro_29734).
In working with data from a public source, I encounter issues with repair geometry (OGC validation). Fairly often I get a message of "ERROR 160189: The spatial index grid size is invalid." What's maddening, though, is that the error seems to be randomly occurring. Of the seven layers in the file, three sometimes have errors: one rarely (1 in 20), one usually (19 in 20), and one some of the time (12 in 20).
It is quite frustrating seeing that the same inputs (I'm wiping out the fgdb between trials and re-extracting from a single ZIP) are giving different results, and makes me think there is an issue in the RepairGeometry function (maybe a buffer problem or a race condition).
Attached is code to reproduce the issue including some statistics. Apologies that the original dataset is larger than ideal for a minimal example, but copying the problem features is hard (ArcGIS Pro UX problems being a separate issue altogether).
Overview:
Download data; 10x loop: clean data directory except for zip file, extract zip file, repair the three problem layers, noting if they encountered errors; aggregate statistics and write that out to a file. Functions are used to make it easier to step through manually/interactively.
The table that is output shows True if errors were encountered, False if it completed smoothly.
Example output:
Hennepin Dakota Scott
0 False False False
1 True True True
2 True True False
3 True True False
4 True True False
5 False True False
6 True True False
7 False True False
8 True True False
9 False True False
Requires:
arcpy, requests, pandas