Cannot make feature layer in GP Service.  It works as a tool.

Discussion created by wmarcell on Jun 8, 2012
Latest reply on May 7, 2014 by kskaushal
I am having an odd problem and cannot find a solution.  I have a pretty lengthy script that is getting hung up near the beginning.  When the script reaches the command arcpy.MakeFeatureLayer_management(input, 'lyr') I recieve the following message:

<type 'exceptions.AttributeError'>: UNKNOWN
Failed to execute

I really have no idea what is happening.  I can write the input fc to another location using fc2fc_conversion so I know the path is good.  I have checked and the output featureLayer name is not in memory.  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.

I have inserted a little of the code but it is a 500 line script.  Hope someone can help.

inputs_GDB      = r"c:\hydrologic_modeling\scratch\scratch.gdb"
# Data: KY_Pilot_LiDAR_Model_INPUTS GDB Variables
    Watersheds_from_LiDAR = inputs_GDB + os.sep + r"Other_INPUTS\watersheds_fr_LiDAR"
    desc = arcpy.Describe(Watersheds_from_LiDAR)
    # gp.environment: Set Processing Extent
    arcpy.FeatureClassToFeatureClass_conversion(Watersheds_from_LiDAR, projectArea_GDB, "watersheds_fr_LiDAR")
    arcpy.env.extent = Watersheds_from_LiDAR

##    arcpy.AddMessage(str(arcpy.env.extent)

    # Process: Make Feature Layer
    arcpy.MakeFeatureLayer_management(Watersheds_from_LiDAR, "watershed_lyr")#, "", inputs_GDB)