arcpy 10.1 Tabulate Area fails unpredictably

1023
10
06-18-2013 11:43 AM
MichaelMcWilliams
New Contributor
Hello everyone,

I am creating python scripts that make use of the Tabulate Area tool (ArcGIS 10.1). I have lately been experiencing odd behavior where a script will work initially, and then not work for a period of time... and then it will work again somewhat unexpectedly. When it fails, it fails on the TabulateArea line.

I use PyScripter as my IDE, and a script failure generates the message:
"[Errno 10054] An existing connection was forcibly closed by the remote host"

I have also experimented using IDLE, and I get the same failure behavior, but I do not receive an error message... it just doesn't complete the script.

This is a simplified version of the code that will itself generate errors (and sometimes work):

import arcpy
from arcpy.sa import *

arcpy.env.overwriteOutput = True

zones = r'F:\...\zones.shp'
input_raster = r'F:\...\raster.shp'
outTable = r'F:\...\table.dbf'

arcpy.CheckOutExtension("Spatial")
TabulateArea(zones, 'zone_id', input_raster, 'raster_value', outTable, '#')



I have not experienced this problem with any other arcpy functions.

Does anyone have any ideas what could be going on? What is the "forcibly closed" message all about?

Thanks for your time and help!
Tags (2)
0 Kudos
10 Replies
MathewCoyle
Frequent Contributor
Are these files located on a network drive or server? That error seems to indicate you lost connection to that location temporarily. Try copying your data to a local drive to see if you get the same errors.
0 Kudos
MichaelMcWilliams
New Contributor
Hi,

Thanks for your response. The files are located on an external hard drive. I just moved them to the local drive, and I still get the error message.

I've been wondering if the problem could be related to locked files or folders, but I often get the error message on the first run after turning on my computer... not sure if that makes a difference though. Still, other arcpy functions will always work on the zone and raster files, e.g. changing the projection. It seems to be specific to Tabulate Area.
0 Kudos
MathewCoyle
Frequent Contributor
That seems like very odd behaviour if you are getting a socket closed error on local files. Are you using SP1? Do you have ArcGIS indexing on? Have an anti-virus program? I'd recommend contacting Esri support, the only bug I found for Tabluate Area was NIM002809 with this solution
The user's feature zone data had a range of 127707. Making a subscene of the data where the range was reduced below 100,000 (99,340 actually), the operation could complete.
0 Kudos
MichaelMcWilliams
New Contributor
OK. I will contact support. I do have SP1, and I also have virus software installed. I'm not sure what indexing is. I never got this problem with 10.0, so maybe it's a 10.1 thing.

Another weird thing, though, is that it works perfectly if I do it manually in ArcMap. I need to use python, however, to repeat the task many times over...

Thanks again for your help.
0 Kudos
curtvprice
MVP Esteemed Contributor
OK. I will contact support. I do have SP1, and I also have virus software installed. I'm not sure what indexing is. I never got this problem with 10.0, so maybe it's a 10.1 thing.

Another weird thing, though, is that it works perfectly if I do it manually in ArcMap


Are you running from 64 bit Python? If so you may want to try running it in 32 bit (like in ArcMap -- where it works for you).

Does anyone have any ideas what could be going on? What is the "forcibly closed" message all about?


All geoprocessing tools are set up to work in a client server context (the client is your script). This makes it possible to "easily" package them into a service. So sometimes error messages reference this.
0 Kudos
MathewCoyle
Frequent Contributor
Some virus scanners can interfere when files are changed in scripts like from python. They can be locked in an attempt to determine if the action is malicious or not and prevent further processing.

ArcGIS has an indexing service to calalog all GIS associated files in a given folder/database. You can check if it is on under Search Options in Catalog. This can also interfere with file changes if they are set to update too often.
0 Kudos
ChrisSnyder
Regular Contributor III
Can you disable your virus scan software? If so, do it and see if the issue persists...

http://forums.arcgis.com/threads/66584-repeated-AddField-operations-fails-in-10.1-works-in-10.0?p=24...
0 Kudos
MichaelMcWilliams
New Contributor
Thank you all for your suggestions.

I am indeed using 64-bit python. Right now, my tabulate area script is functioning as desired, but I will go through these different tests when it breaks down again. I will post the results.

Thanks again!
0 Kudos
PhilMorefield
Occasional Contributor III
I was just able to replicate the same problem. The solution was to alter the workflow and use rasters as the input zones. I was previously using shapefiles as the zones.

Windows 7 64-bit
ArcGIS 10.1, SP1, 64-bit Background Processing Patch
0 Kudos