<?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 MakeFeatureLayer not recognizing input file path when run on ArcServer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570933#M44764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I ran this script successfully from ArcCatalog, for some reason the file path I'm providing to arcpy.MakeFeatureLayer() changes whenever I run it as a geoprocessing service on ArcGIS Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the snippets that lead to this error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;##buildRegQuery.py&lt;/P&gt;&lt;P&gt;[...]&lt;/P&gt;&lt;P&gt;path = os.path.join(root_path, r'Zips\esriZipsLayer_NAD83.shp')&lt;/P&gt;&lt;P&gt;geometry = regUtil.parse_geometry(coords)&lt;/P&gt;&lt;P&gt;regUtil.pull_attributes(3, path, geometry, '0.25 miles')&lt;/P&gt;&lt;P&gt;[...]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##regUtil.py&lt;/P&gt;&lt;P&gt;def pull_attributes(idx, path, geometry, distance):&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;search_cursor = select_by_location(path, geometry, distance)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [...]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def select_by_location(tiger_data_path, geometry, distance):&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;arcpy.MakeFeatureLayer_management(tiger_data_path, 'tigerLayer') ##throws error&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;arcpy.SelectLayerByLocation_management('tigerLayer', 'INTERSECT', geometry, distance)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return arcpy.da.SearchCursor('tigerLayer', '*')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once this code is copied to the local drive of the server (via creating geoprocessing service), it seems to be looking on the server for the data not on the machine I specified in the path. Regarding my original &lt;A _jive_internal="true" href="https://community.esri.com/thread/207330-geoprocessing-task-not-using-provided-file-paths"&gt;post&lt;/A&gt;, I have already set the permissions on the file server hosting the data for the publisher server to access the data by following &lt;A _jive_internal="true" href="https://community.esri.com/thread/161047"&gt;these&lt;/A&gt; instructions. But I'm still getting the same error and I don't feel like that explains why MakeFeatureLayer is getting a file path on the local drive when I'm explicitly providing it as input in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the stack trace:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;esriJobMessageTypeError&lt;/EM&gt;: Traceback (most recent call last): File "C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\my_toolboxes\buildRegQuery.py", line 45, in distance='0.25 miles') File "C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\my_toolboxes\regUtil.py", line 34, in pull_attributes search_cursor = select_by_location(path, geometry, distance) File "C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\my_toolboxes\regUtil.py", line 23, in select_by_location arcpy.MakeFeatureLayer_management(tiger_data_path, g_ESRI_variable_1) File "c:\program files\arcgis\server\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\tigerdata\Zips\esriZipsLayer_NAD83.shp does not exist or is not supported Failed to execute (MakeFeatureLayer).&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2018 18:25:59 GMT</pubDate>
    <dc:creator>DevonCanady</dc:creator>
    <dc:date>2018-01-04T18:25:59Z</dc:date>
    <item>
      <title>MakeFeatureLayer not recognizing input file path when run on ArcServer</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570933#M44764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although I ran this script successfully from ArcCatalog, for some reason the file path I'm providing to arcpy.MakeFeatureLayer() changes whenever I run it as a geoprocessing service on ArcGIS Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the snippets that lead to this error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;##buildRegQuery.py&lt;/P&gt;&lt;P&gt;[...]&lt;/P&gt;&lt;P&gt;path = os.path.join(root_path, r'Zips\esriZipsLayer_NAD83.shp')&lt;/P&gt;&lt;P&gt;geometry = regUtil.parse_geometry(coords)&lt;/P&gt;&lt;P&gt;regUtil.pull_attributes(3, path, geometry, '0.25 miles')&lt;/P&gt;&lt;P&gt;[...]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;##regUtil.py&lt;/P&gt;&lt;P&gt;def pull_attributes(idx, path, geometry, distance):&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;search_cursor = select_by_location(path, geometry, distance)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [...]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def select_by_location(tiger_data_path, geometry, distance):&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;arcpy.MakeFeatureLayer_management(tiger_data_path, 'tigerLayer') ##throws error&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;arcpy.SelectLayerByLocation_management('tigerLayer', 'INTERSECT', geometry, distance)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return arcpy.da.SearchCursor('tigerLayer', '*')&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once this code is copied to the local drive of the server (via creating geoprocessing service), it seems to be looking on the server for the data not on the machine I specified in the path. Regarding my original &lt;A _jive_internal="true" href="https://community.esri.com/thread/207330-geoprocessing-task-not-using-provided-file-paths"&gt;post&lt;/A&gt;, I have already set the permissions on the file server hosting the data for the publisher server to access the data by following &lt;A _jive_internal="true" href="https://community.esri.com/thread/161047"&gt;these&lt;/A&gt; instructions. But I'm still getting the same error and I don't feel like that explains why MakeFeatureLayer is getting a file path on the local drive when I'm explicitly providing it as input in my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the stack trace:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;esriJobMessageTypeError&lt;/EM&gt;: Traceback (most recent call last): File "C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\my_toolboxes\buildRegQuery.py", line 45, in distance='0.25 miles') File "C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\my_toolboxes\regUtil.py", line 34, in pull_attributes search_cursor = select_by_location(path, geometry, distance) File "C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\my_toolboxes\regUtil.py", line 23, in select_by_location arcpy.MakeFeatureLayer_management(tiger_data_path, g_ESRI_variable_1) File "c:\program files\arcgis\server\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Features: Dataset C:\arcgisserver\directories\arcgissystem\arcgisinput\RegQueryBuilder\RegQueryBuilder.GPServer\extracted\v101\tigerdata\Zips\esriZipsLayer_NAD83.shp does not exist or is not supported Failed to execute (MakeFeatureLayer).&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:25:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570933#M44764</guid>
      <dc:creator>DevonCanady</dc:creator>
      <dc:date>2018-01-04T18:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer not recognizing input file path when run on ArcServer</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570934#M44765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where is &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;root_path&lt;/SPAN&gt; being set and how is it being set?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:51:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570934#M44765</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-01-04T18:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: MakeFeatureLayer not recognizing input file path when run on ArcServer</title>
      <link>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570935#M44766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a UNC to a folder on another server&lt;BR /&gt;root_path = r'\\NewCaspian\BanksNew\Data\tiger\TigerData'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 18:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/makefeaturelayer-not-recognizing-input-file-path/m-p/570935#M44766</guid>
      <dc:creator>DevonCanady</dc:creator>
      <dc:date>2018-01-04T18:59:59Z</dc:date>
    </item>
  </channel>
</rss>

