GPKs and arcpy.CalculateField_management

2779
7
07-28-2012 08:07 PM
Labels (1)
BKuiper
Occasional Contributor III
Hi,

i'm trying to switch over from ArcGIS Server to ArcGIS Runtime but i'm experiencing some problems with the arcpy.CalculateField_management function.

The arcpy.CalculateField_management is unreliable when executed through ArcGIS Runtime.

I keep getting the following error, randomly, on different layers:

ERROR 999999: Error executing function.
Workspace or data source is read only.
Workspace or data source is read only.
Failed to execute (CalculateField).


I'm executing arcpy.CalculateField_management in sequence, on 1 to 20 layers. Each time a different layer will fail with the same error.

I think it is related to this problem: http://forums.arcgis.com/threads/46848-Table.Insert-fails-with-quot-Workspace-or-data-source-is-read...

but i'm not sure how I can use those suggestions within my application/python script.

I'm executing the following:

codeblock = """multiplier = """ + str(multiplier)
arcpy.CalculateField_management(orgfile, "val", "multiplier * math.pow(10, (!m! / 10))", "PYTHON_9.3", codeblock)

Any ideas how to fix this issue? Or will the ArcGIS Runtime fix this issue in their next release ?

Thanks for your time

EDIT: Through ArcGIS server i'm using ArcSDE but with ArcGIS Runtime i'm using a local File geodatabase.
EDIT2: The CalculateField is executed within the tempstore/scratch gdb of the ArcGIS Runtime directory structure.
0 Kudos
7 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

If you can post an example GPK I'll happily take a look.

Cheers

Mike
0 Kudos
BKuiper
Occasional Contributor III
Hi,

If you can post an example GPK I'll happily take a look.

Cheers

Mike


It is part of a pretty big python script but i will try to strip out this functionality and post it later this week.
0 Kudos
BKuiper
Occasional Contributor III
Hi,

I spend the last couple of days making a PoC that would isolate and demonstrate the problem but I was unable to.

I will send you a personal e-mail with the details on the error. Perhaps you can achieve to enable some additional debugging options, etc.

Greetings B
0 Kudos
MatthewBrown1
Occasional Contributor
I have been experiencing similar behaviour with a number of tools. It does appear to be random, but when I re-execute the model it works - no changes to the service, the code or the underlying data. Sometimes I have to try multiple times before it executes successfully.

It also happens if I re-run the geoprocessing after a successful result, but I think this has something to do with not disposing the gp task or service properly.
0 Kudos
BKuiper
Occasional Contributor III
Hi matthew, perhaps we can share some information about this problem.

Or you also experiencing this problem from ArcGIS 10.1 final release ? I didn't have this problem in previous releases.

Perhaps you can contact me by email ? Thanks!
0 Kudos
MatthewBrown1
Occasional Contributor
Hi Bjorn, Mike,

Just an update on our geoprocessing issues, we have been testing on the following platforms (results in parentheses):


[INDENT]Win XP SP3 VM - no network (no errors)[/INDENT]
[INDENT]Win XP SP3 32-bit HP business desktop - domain (intermittent errors)[/INDENT]
[INDENT]Win 7 SP1 32-bit VM - no network (no errors)[/INDENT]
[INDENT]Win 7 SP1 32-bit HP business laptop - workgroup (no errors)[/INDENT]
[INDENT]Win 7 SP1 64-bit VM - no network (no errors)[/INDENT]
[INDENT]Win 7 SP1 32-bit HP business desktop - domain (intermittent errors)[/INDENT]
[INDENT]Win 7 SP1 64-bit HP business desktop - domain (intermittent errors)[/INDENT]
[INDENT]Win 7 SP1 64-bit HP workstation - domain (intermittent errors)[/INDENT]


We are using x86 Runtime deployment and our build is targeting x86 CPUs.

We have also run this app with some stakeholders (using XP laptops of various specs) and failures were also reported, but not in a controlled testing environment.

It seems that the local processing fails when run on PCs that are on a domain, so there may be some domain setting/AD rules that are affecting the local server or the permissions to the user temp directories. Testing has been done with normal and elevated privileges.

I have also published the model as a geoprocessing service on ArcGIS Server 10.1 and run this from the Runtime SDK application (same model, same data, only minor changes to code to point the gp service to ArcGIS Server) with no errors on a dev box that fails with the local geoprocessing, so I am still reasonably confident that the source is somehow related to the Runtime SDK, but still at a loss to the exact cause. I hope the .1 release will solve this!

Thanks,

Matt
0 Kudos
MatthewBrown1
Occasional Contributor
Update:

http://forums.arcgis.com/threads/83700-Intermittent-Geoprocessing-Error?p=301565&viewfull=1#post3015...

It seems that the antivirus scans the file gdb and locks it before the workflow is finished.
0 Kudos