<?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: Cannot make feature layer in GP Service.  It works as a tool. in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235781#M8072</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you please let me know what messages you get when you wrap your Make Feature Layer line with try-except as follows?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(Watersheds_from_LiDAR, "watershed_lyr")
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages(2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(arcpy.GetMessages(2))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 11:53:30 GMT</pubDate>
    <dc:creator>NobbirAhmed</dc:creator>
    <dc:date>2021-12-11T11:53:30Z</dc:date>
    <item>
      <title>Cannot make feature layer in GP Service.  It works as a tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235780#M8071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having an odd problem and cannot find a solution.&amp;nbsp; I have a pretty lengthy script that is getting hung up near the beginning.&amp;nbsp; When the script reaches the command arcpy.MakeFeatureLayer_management(input, 'lyr') I recieve the following message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.AttributeError'&amp;gt;: UNKNOWN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I really have no idea what is happening.&amp;nbsp; I can write the input fc to another location using fc2fc_conversion so I know the path is good.&amp;nbsp; I have checked and the output featureLayer name is not in memory.&amp;nbsp; It is like when the script is ran through a GP Service it does not have permission to write to the temp directory/ in memory or wherever it would store a feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have inserted a little of the code but it is a 500 line script.&amp;nbsp; Hope someone can help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;inputs_GDB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = r"c:\hydrologic_modeling\scratch\scratch.gdb"
# Data: KY_Pilot_LiDAR_Model_INPUTS GDB Variables
&amp;nbsp;&amp;nbsp;&amp;nbsp; Watersheds_from_LiDAR = inputs_GDB + os.sep + r"Other_INPUTS\watersheds_fr_LiDAR"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(Watersheds_from_LiDAR)
&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(Watersheds_from_LiDAR)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(desc.dataType)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(scratchWS)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(arcpy.env.workspace)
&amp;nbsp;&amp;nbsp;&amp;nbsp; # gp.environment: Set Processing Extent
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureClassToFeatureClass_conversion(Watersheds_from_LiDAR, projectArea_GDB, "watersheds_fr_LiDAR")
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.extent = Watersheds_from_LiDAR

##&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(str(arcpy.env.extent)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Make Feature Layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(Watersheds_from_LiDAR, "watershed_lyr")#, "", inputs_GDB)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("made")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 20:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235780#M8071</guid>
      <dc:creator>WesleyMarcell</dc:creator>
      <dc:date>2012-06-08T20:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot make feature layer in GP Service.  It works as a tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235781#M8072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you please let me know what messages you get when you wrap your Make Feature Layer line with try-except as follows?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(Watersheds_from_LiDAR, "watershed_lyr")
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages(2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(arcpy.GetMessages(2))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:53:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235781#M8072</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2021-12-11T11:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot make feature layer in GP Service.  It works as a tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235782#M8073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I attempted the change below and in the results window it returns no message.&amp;nbsp; It has the little info message symbol but it is blank next to it.&amp;nbsp; I put a print line below to say done.&amp;nbsp; Not sure what is going on...[ATTACH=CONFIG]15109[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Could you please let me know what messages you get when you wrap your Make Feature Layer line with try-except as follows?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(Watersheds_from_LiDAR, "watershed_lyr")
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print arcpy.GetMessages(2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(arcpy.GetMessages(2))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235782#M8073</guid>
      <dc:creator>WesleyMarcell</dc:creator>
      <dc:date>2021-12-11T11:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot make feature layer in GP Service.  It works as a tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235783#M8074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does the workflow run successfully on Desktop? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you can share your model &amp;amp; data then we can try to reproduce the issue and find what's going on. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 20:00:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235783#M8074</guid>
      <dc:creator>NobbirAhmed</dc:creator>
      <dc:date>2012-06-11T20:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot make feature layer in GP Service.  It works as a tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235784#M8075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;yes it works as a script tool through ArcMap.&amp;nbsp; It is a pretty large project ~7gb of data.&amp;nbsp; I have worked on this with ESRI support so I may open another ticket.&amp;nbsp; ESRI was very helpful getting the script migrated from 9.2 to 10.0 however I am now attempting to set this up as a GP service so there may be some permission issues between the SOC and wherever it writes the temporary Feature Layers when executing the script.&amp;nbsp; I appreciate the help though.&amp;nbsp; I was hoping for an easy fix.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2012 17:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235784#M8075</guid>
      <dc:creator>WesleyMarcell</dc:creator>
      <dc:date>2012-06-12T17:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot make feature layer in GP Service.  It works as a tool.</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235785#M8076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am facing similar issue on 7 May 2014.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the error :- Runtime error &amp;lt;type 'exceptions.AttributeError'&amp;gt;: UNKNOWN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the above error when I try to run the GP commands like &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management or arcpy.Delete_management.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above python command works on 1 machine, but gives the above error on another machine, reasons unknown. The ArcGIS Desktop installed on both machines is 10.0 SP5 Build 4400.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please suggest urgently as it's blocking the deliveries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kaushal Shah.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2014 09:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/cannot-make-feature-layer-in-gp-service-nbsp-it/m-p/235785#M8076</guid>
      <dc:creator>KaushalShah</dc:creator>
      <dc:date>2014-05-07T09:41:06Z</dc:date>
    </item>
  </channel>
</rss>

