Error: ERROR 000005: Could not open the address locator
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 due to the following causes:
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 for Server service. These orphaned records prevent the system from rebuilding the address locator due to conflicts with the new records. For more information on repository tables, refer to ArcGIS Help: Types of repositories.
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 orphaned 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 ArcGIS Help: 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 ArcGIS Help: Background Geoprocessing (64-bit).
Solution or Workaround
Follow any of the suggested solutions below to fix the issue, depending on the causes.
- Remove Orphaned Records
- Identify the name of the address locator to rebuild.
- Create a backup of the server database.
- Run the following queries in the database to remove orphaned records from the <locator_name>_lox, SDE_locators, SDE_metadata, SDE_table_registry, SDE_column_registry, and GDB_items system tables:
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.
- Execute the Python script to rebuild the address locator.
- Stop the Service
- Stop the ArcGIS for Server service.
- Execute the script to rebuild the address locator.
- Start the service.
- Run the script in the 32-bit environment
C:\Python27\ArcGIS10.x\python.exeAdditionally, 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?
- ArcGIS Help: Building a query expression
- ArcGIS Help: Locators in a geodatabase in SQL Server
- How To: Connect and run queries to a SQL Server database from Python