ERROR
Executing a Python script containing a rebuild address locator function returns the following error message:
Error: ERROR 000005: Could not open the address locator. Failed to execute (RebuildAddressLocator).
This issue can occur for the following reasons.
Detached Records
Prior to rebuilding an address locator, if new records are added to the database, the conflicting outdated records that are still associated with the original address locator name are retained in the repository tables used by the ArcGIS Server service. These detached records prevent the system from rebuilding the address locator due to conflicts with the new records.
Note: Although the address locator can be rebuilt with a different name, to rebuild the address locator with the original name, refer to the Solution section on removing detached records.
Locks
The error is returned as active locks are in place on the address locator, preventing the address locator from being rebuilt. The active locks are in place as there are other services still accessing the geocoding service. For more information on how locks work, refer to ArcMap: Schema locking.
32-bit vs. 64-bit
Executing the rebuild address locator script in a 64-bit command line returns this error as the script may call upon tools or functions that are not supported by a 64-bit environment. There are instances where some ArcMap tools and programs run in the 64-bit environment despite a 32-bit installation of ArcMap. For more information, refer to ArcMap: Background Geoprocessing (64-bit).
Follow the steps for the solution which corresponds to the cause of the issue to find a solution.
Remove Detached Records
DELETE FROM <locator_name>_lox WHERE name = <address_locator_name>; DELETE FROM SDE_locators WHERE name = <address_locator_name>; DELETE FROM SDE_metadata WHERE name = <address_locator_name>; DELETE FROM SDE_table_registry WHERE name = <address_locator_name>; DELETE FROM SDE_column_registry WHERE name = <address_locator_name>; DELETE FROM GDB_ITEMS WHERE name = <address_locator_name>;
Note: The tables listed above are system tables containing records of an address locator.
Stop the Service
For more information on how to start and stop a service, refer to ArcGIS Help: Start and stop services.
Run the script in the 32-bit environment
Execute the script with the 32-bit version Python command line interface instead of the 64-bit version. The 32-bit version can be found in:
C:\Python27\ArcGIS10.x\python.exe
Additionally, if the script is executed using the Python console in ArcMap and it fails, change the Windows file association setting to run Python with in the 32-bit environment. For steps on how to do so, refer to FAQ: Why do Python scripts fail on a machine with both ArcGIS for Server and Desktop installed?
Get help from ArcGIS experts
Download the Esri Support App