<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcPy FeatureSet load error when run in geoprocessing service from client in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387058#M30548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After searching some more, it seems that the following thread may be related to my issue : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/73207-Publishing-PYT-with-a-string-pointing-to-an-SDE-file-on-disk-crashes-ArcCatalog"&gt;http://forums.arcgis.com/threads/73207-Publishing-PYT-with-a-string-pointing-to-an-SDE-file-on-disk-crashes-ArcCatalog&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Dec 2012 18:31:45 GMT</pubDate>
    <dc:creator>BrunoSt-Aubin1</dc:creator>
    <dc:date>2012-12-18T18:31:45Z</dc:date>
    <item>
      <title>ArcPy FeatureSet load error when run in geoprocessing service from client</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387057#M30547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good day,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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 :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
LayerName = arcpy.GetParameterAsText(0)
path = "C:\\PathToDatabase\database.gdb\\"
fs = arcpy.FeatureSet(path + LayerName)
arcpy.SetParameterAsText(1, fs)
&lt;/PRE&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I execute the service from the endpoint I get this message :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Unable to complete operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error executing tool.: Traceback (most recent call last): File "C:\PathToService\SearchByFeaturesTest.GPServer\extracted\v101\GetFileLocation.py", line 13, in &amp;lt;module&amp;gt; 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).[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
# 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)
&lt;/PRE&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am truly stumped on this problem and I could realy use a hand, can anyone help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruno&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:25:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387057#M30547</guid>
      <dc:creator>BrunoSt-Aubin1</dc:creator>
      <dc:date>2021-12-12T16:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy FeatureSet load error when run in geoprocessing service from client</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387058#M30548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After searching some more, it seems that the following thread may be related to my issue : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/73207-Publishing-PYT-with-a-string-pointing-to-an-SDE-file-on-disk-crashes-ArcCatalog"&gt;http://forums.arcgis.com/threads/73207-Publishing-PYT-with-a-string-pointing-to-an-SDE-file-on-disk-crashes-ArcCatalog&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 18:31:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387058#M30548</guid>
      <dc:creator>BrunoSt-Aubin1</dc:creator>
      <dc:date>2012-12-18T18:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy FeatureSet load error when run in geoprocessing service from client</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387059#M30549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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 :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Unable to complete operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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).[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help is still needed, thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruno&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Dec 2012 18:43:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387059#M30549</guid>
      <dc:creator>BrunoSt-Aubin1</dc:creator>
      <dc:date>2012-12-18T18:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPy FeatureSet load error when run in geoprocessing service from client</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387060#M30550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/message/65859"&gt;Here&lt;/A&gt;&amp;nbsp;is the updated link I believe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2018 18:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-featureset-load-error-when-run-in/m-p/387060#M30550</guid>
      <dc:creator>ChristinaMosnick</dc:creator>
      <dc:date>2018-02-09T18:09:42Z</dc:date>
    </item>
  </channel>
</rss>

