Select to view content in your preferred language

Arcpy DeleteRows tool: error code 000732

1984
11
03-25-2021 09:17 AM
KevinPiraino2
Regular Contributor

I have created a simple python script to do the following:

  1. Scrape web page for data listed in table/json
  2. Write data into local FGDB table
  3. Map data in local FGDB using coordinates
  4. Replace SDE data with mapped data in local FGDB

Everything works up until step 4 which includes a DeleteRows function call and then an Append function call. I am using DeleteRows instead of truncate due to database locks. Currently this script works perfectly fine from my local machine, but on our server machine where this script will reside for scheduling purposes I run into the error 000732: dataset does not exist or is not supported. I have run through all of the suggested workarounds/solutions and none worked. I even ran the tool in catalog on the server machine and it worked, just not in the script. 

  1. Make sure file path provided is correct.
  2. Make sure file path provided is not a relative file path.
  3. No spaces in file path name
  4. No misspellings
  5. Backslashes instead of forward slashes
  6. No subtypes
  7. Process runs on windows machine not UNIX or Linux so hopefully no issue with Copy Rows or Make XY Event Layer tools
  8. Disabled background geoprocessing

Are there any additional suggestions or could this possibly be a bug?

0 Kudos
11 Replies
Tomasz_Tarchalski
Occasional Contributor

Hi,

make sure that the variable path is set like this:

myvariable_path = r'C:\Temp\Integrations'

the letter "r" (raw path) is important.

0 Kudos
KevinPiraino2
Regular Contributor

Tomasz,

Thank you for your suggestion, but unfortunately all of my variables that contain string paths already have the "r" pre-fix so this suggestion does not apply.

0 Kudos
DavidPike
MVP Frequent Contributor

The path isn't a Mapped drive on your local machine? Have you tried UNC or attempting to navigate to that path in Catalog/Windows Explorer on the server? 

0 Kudos
KevinPiraino2
Regular Contributor

David,

No the error occurs when trying to use the Delete Rows function against the SDE database table/feature class. Currently when I run the Delete Rows function against the SDE database table/feature class from my local machine the function has no problem executing. The issue occurs when attempting to run the Delete Rows function against the SDE database table/feature class from our server machine (where the script will be run from once its fully tested). I'm 99% sure its not the file path name since I was able to navigate to the SDE table/feature class using the file path the script uses (both in windows file explorer and ArcCatalog on the server machine). I even ran the Delete Rows tool in ArcCatalog (using the SDE data) and it ran fine. I then took the code snippet from the results pane and inserted it into the script and it still failed.

0 Kudos
DavidPike
MVP Frequent Contributor

if it's an SDE it's using a connection file I guess?  Is that connection file being properly referenced and is the same as on the local machine?

0 Kudos
KevinPiraino2
Regular Contributor

Yes you are correct, it is using an SDE file. I assume it's referencing the connection file properly. I have the SDE connection file located in the same folder the script runs from and the script references the file as such:

db_test = r'C:\rn_development\COVID_Testing_Sites\AZURE_HealthDepartment_gisadministrator_93.sde\HealthDepartment.DBO.CovidTestSites\HealthDepartment.DBO.IDPH_COVID_Test_Sites'

arcpy.DeleteRows_management(db_test)

 

As for the file being the same on the local machine, yes to an extent. The exact paths differs, but the file was originally copied from local machine to the server when I was setting up the final testing on the server machine.

0 Kudos
DavidPike
MVP Frequent Contributor

Perhaps the authentication in the connection file is OS_AUTH and the server doesn't have that privilege?

KevinPiraino2
Regular Contributor

Checking the connection properties of each SDE connection file, each file is "Database Authentication", so I don't believe that is the issue. 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

I believe @DavidPike is likely correct, i.e., you are using OS authentication in the SDE file, and the service account running GIS Server doesn't have permissions to delete records.

0 Kudos