AnsweredAssumed Answered

ERROR 000966 sharing tool with GPFeatureLayer

Question asked by don.morrison on Feb 17, 2020
Latest reply on Feb 20, 2020 by don.morrison

I'm going to open a problem ticket on this - I'm opening this here also in case anybody has any good ideas.

 

I added a tool to my python toolbox that has a parameter of type GPFeatureLayer. The tool runs fine from ArcPro. When I try to share it to ArcGIS Online as a geoprocessing package, it fails with this error in the SharingJobLog.log file

 

ERROR 000966: The input layer is not valid ErrorMessage: ERROR 000966: The input layer is not valid

 

I create two trivial tools  - The first with a GPString parameter and a GPFeatureLayer parameter, and no other code. The second exactly the same but with the GPFeatureLayer parameter removed. The second one shares OK, but the first on fails with the ERROR 000966. 

 

I'm not seeing anything in the documentation that indicates GPFeatureLayer is not supported in a shared geoprocessing package,  and I would hope that is not the case since it seems like a pretty basic requirement. 

 

 

 

Here are the tool definitions I used to test:

class PackageTestWithLayer(object):
  def __init__(self):
    self.label = "0. Package Test - with layer"
    self.description = ""
    self.canRunInBackground = False
  def getParameterInfo(self):
    layer_param = arcpy.Parameter(displayName="GPFeatureLayer Input",

            name="layer",

            datatype="GPFeatureLayer",

            parameterType="Optional",

            direction="Input")
    string_param = arcpy.Parameter(displayName="Text Input",

            name="text",

            datatype="GPString",

            parameterType="Optional",

            direction="Input")
    return [layer_param, string_param]
  def isLicensed(self):
    return True
  def updateParameters(self, parameters):
    return
  def updateMessages(self, parameters):
    return
  def execute(self, parameters, messages):
    return

 

class PackageTestWithNoLayer(object):
  def __init__(self):
    self.label = "0. Package Test - no layer"
    self.description = ""
    self.canRunInBackground = False
  def getParameterInfo(self):
    string_param = arcpy.Parameter(displayName="Text Input",

         name="text",

         datatype="GPString",

         parameterType="Optional",

         direction="Input")
    return [string_param]
def isLicensed(self):
   return True
def updateParameters(self, parameters):
   return
def updateMessages(self, parameters):
   return
def execute(self, parameters, messages):
   return

 

I'm running this on ArcPro  2.4.3  and Python 3.6.8 and Advanced license.

Outcomes