+ Reply to Thread
Results 1 to 3 of 3

Thread: ArcPy FeatureSet load error when run in geoprocessing service from client

  1. #1
    Bruno St-Aubin
    Join Date
    Jul 2012
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default ArcPy FeatureSet load error when run in geoprocessing service from client

    Good day,

    I'm trying to get a geoprocessing service to work. The service runs fine from ArcCatalog when I'm on the server, it produces the expected results. Once published though, I cannot get it to run from the endpoint. It seems that a part of my python code is responsible. Basically, I have this simple piece of code that is supposed to look for a file on the disk and return it as a Feature Class :
    Code:
    import arcpy
    LayerName = arcpy.GetParameterAsText(0)
    path = "C:\\PathToDatabase\database.gdb\\"
    fs = arcpy.FeatureSet(path + LayerName)
    arcpy.SetParameterAsText(1, fs)
    When I execute the service from the endpoint I get this message :

    Unable to complete operation.
    Error executing tool.: Traceback (most recent call last): File "C:\PathToService\SearchByFeaturesTest.GPServer\extracted\v101\GetFileLocation.py", line 13, in <module> fs = arcpy.FeatureSet(path + LayerName) File "c:\program files\arcgis\server\arcpy\arcpy\arcobjects\mixins.py", line 1007, in __init__ self._arc_object.load(table) RuntimeError: RecordSetObject: Cannot open table for Load Failed to execute (Get Source FeatureSet). Failed to execute (SearchByFeaturesTest). Failed to execute (Search By Features Test).

    When I look at the extracted py file in the task folder (C:\PathToService\SearchByFeaturesTest.GPServer\extracted\v101\GetFileLocation.py), I can see that lines have been added to my original py file:
    Code:
    # Esri start of added variables
    import os, arcpy
    g_ESRI_variable_1 = os.path.join(arcpy.env.packageWorkspace,u'database.gdb')
    # Esri end of added variables
    
    # Esri start of added imports
    import sys, os, arcpy
    # Esri end of added imports
    
    import arcpy
    LayerName = arcpy.GetParameterAsText(0)
    path = g_ESRI_variable_1
    fs = arcpy.FeatureSet(path + LayerName)
    arcpy.SetParameterAsText(1, fs)
    I am truly stumped on this problem and I could realy use a hand, can anyone help?

    Thanks

    Bruno
    Last edited by BStAubin; 12-18-2012 at 11:32 AM.

  2. #2
    Bruno St-Aubin
    Join Date
    Jul 2012
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default Re: ArcPy FeatureSet load error when run in geoprocessing service from client

    After searching some more, it seems that the following thread may be related to my issue :

    http://forums.arcgis.com/threads/732...hes-ArcCatalog

  3. #3
    Bruno St-Aubin
    Join Date
    Jul 2012
    Posts
    8
    Points
    0
    Answers Provided
    0


    0

    Default Re: ArcPy FeatureSet load error when run in geoprocessing service from client

    After following some steps by the other poster in the thread mentionned, I managed to work around the path problem. However, it seems that I may now have an environment problem :

    Unable to complete operation.
    Error executing tool.: ERROR 000229: Cannot open C:\arcgisserver\directories\arcgisjobs\pathToService\je21b3d49f57f48609764fb57a445bc02\scratch\scratch.gdb\FEATURECLASS Failed to execute (Make Source Feature Layer). Failed to execute (SearchByFeaturesID). Failed to execute (Search By Features ID).


    Indeed, on the server, I cannot find any path named C:\arcgisserver\directories\arcgisjobs\pathToService\je21b3d49f57f48609764fb57a445bc02\scratch\scratch.gdb\FEATURECLASS. My instinct tells me it has something to do with the environments but I have no clue how to fix it.

    Help is still needed, thanks!

    Bruno

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts