Hey all, running into an issue where I can rebuild a locator in Pro running the gp tool Rebuild Address Locator, but if I try to rebuild it in a script using arcpy, it doesn't work. I get 'Error 000005: Could not open the address locator' .
The rest of the code in my script publishing the locator and sharing it works fine, I just cant rebuild it. The execution block for this part of the script is about as simple as it can be as arcpy.geocoding.RebuildAddressLocator only has one argument, the locator path.
try:
arcpy.geocoding.RebuildAddressLocator(locator_path)
print("The geocoder was rebuilt successfully")
except arcpy.ExecuteError:
print("Error rebuilding")
print(arcpy.GetMessages(2))
I found this post - https://community.esri.com/t5/python-questions/error-000005-quot-could-not-open-address-locator/td-p/1285959
But I am already running this script on the same server where we do a lot of our Pro work, and always have Pro open and signed into both AGOL and our Portal. Doesn't seem to be a pathing or environment issue as publishing works fine.
Is this a bug or am I missing something? Thanks,