AnsweredAssumed Answered

Portal 10.7 can't add Scene Layer Package from portal page

Question asked by dcoley on Jun 24, 2019
Latest reply on Apr 14, 2020 by dcoley

Hi - I have been able to add and publish a global scene layer package to ArcGIS online through the 'Add Item' button.  When I try to add the same layer package to Portal at 10.7, the 'Add item' method fails (regardless of browser) with a 'cannot write to file' error, even thought the item is clearly visible in Windows Explorer in my D;\arcgisportal\content\items directory.


I am able to add the package from Pro 2.3.3 using the 'share package' tool.

I am able to add the item using the 1.6.1 API item.add method:


import sys, os, arcpy, time, smtplib
from arcpy import env
from arcgis.gis import GIS
env.configKeyword= "DEFAULTS"
env.overwriteOutput = True
gis = GIS("", "myUserName", "myPassword")
slpkPath = r"V:\SarcoBuildingExtract"
thumbPath = r"V:\IconsImages\pdfIcon.png"
slpkExtent = '-82.580256,26.922512,-82.064256,27.438512'
slpkTypes = '[3D,ArcGIS Pro,ArcGIS Server,Scene,Scene Package,slpk]'
pub_params = '[3DObject,ArcGIS Server,Data,Scene Service,Service,Hosted Service]'

    for item in os.listdir(slpkPath):
    slpkFile = os.path.join(slpkPath, item)
    #print (item)
    if (item == 'PortalFootprintScene.slpk'):
       print (item)
       slpkProperties={'type':'Scene Package','typeKeywords':slpkTypes,
       'title':'PortalBuildingScenePackage2','snippet':'County Builiding Multipatch Features','description':'County Builiding Multipatch Features','tags': 'Planning', 'extent':slpkExtent}
       slpkItem = gis.content.add(item_properties=slpkProperties, data=slpkFile,      thumbnail=thumbPath, folder='SceneLayers')
       print (slpkProperties)

      print ('itemPublihed')

except Exception:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()[2]
e = sys.exc_info()[1]
print ("Line %i" % tb.tb_lineno)
message = message + "\n" + "Line %i" % tb.tb_lineno
message = message + "\n" + str(e)


In either case, whether adding the item from the api or from the share package module in Pro, the Publish fails with the API error: 'Cannot determine service type'  even though I am adding the typeKeywords.  In either case, Portal should be able to publish the hosted scene layer whether through the api or through the portal Content tab page.