<?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 ERROR 002901: Sharing related error during geo-processing (Unable to check if service exists. (SN)) Failed to execute (UploadServiceDefinition) in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-002901-sharing-related-error-during-geo/m-p/1168786#M7345</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are working on an automation process which should publish multidimensional cloud raster files.&lt;/P&gt;&lt;P&gt;We tested with Notebooks in ArcGIS Pro 2.8 and ArcGIS Notebook Server 10.9.1. Both approaches produce the same error messages.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import arcpy
import json
import shutil
import arcgisscripting
import xarray as xr
from netCDF4 import Dataset as NetCDFFile 
import numpy as np
gis = GIS("home")

output_draft = '/arcgis/home/temperature_interim2.sddraft'
service = "SN"
con = "/arcgis/home/hub_hereon_de_image.ags"
# arcpy.CreateImageSDDraft(out_rasterdataset, output_draft, service,
#                         'FROM_CONNECTION_FILE', con, True, None, "netCDF test", "netCDF,test")
arcpy.CreateImageSDDraft(out_rasterdataset, output_draft, service,
                        'ARCGIS_SERVER')

try:
    arcpy.StageService_server(
        '/arcgis/home/temperature_interim2.sddraft', '/arcgis/home/temperature_interim3.sd')
    warnings = arcpy.GetMessages(1)
    print(warnings)
except Exception as stage_exception:
    print("Sddraft not staged. Analyzer errors encountered - {}".format(str(stage_exception)))

inSdFile = '/arcgis/home/temperature_interim3.sd'
arcpy.UploadServiceDefinition_server(inSdFile, con)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;---------------------------------------------------------------------------
ExecuteError                              Traceback (most recent call last)
/tmp/ipykernel_482/388611030.py in &amp;lt;module&amp;gt;
      3 # inServer = '/arcgis/home/rasterimage.ags'
      4 # inServer=r"C:/Users/Chaudhr1/arcgis/rasterimage.ags"
----&amp;gt; 5 arcpy.UploadServiceDefinition_server(inSdFile, con)

/opt/conda/lib/python3.7/site-packages/arcpy/server.py in UploadServiceDefinition(in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups)
   1293         return retval
   1294     except Exception as e:
-&amp;gt; 1295         raise e
   1296 
   1297 

/opt/conda/lib/python3.7/site-packages/arcpy/server.py in UploadServiceDefinition(in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups)
   1290     from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject
   1291     try:
-&amp;gt; 1292         retval = convertArcObjectToPythonObject(gp.UploadServiceDefinition_server(*gp_fixargs((in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups), True)))
   1293         return retval
   1294     except Exception as e:

/opt/conda/lib/python3.7/site-packages/arcpy/geoprocessing/_base.py in &amp;lt;lambda&amp;gt;(*args)
    510         val = getattr(self._gp, attr)
    511         if callable(val):
--&amp;gt; 512             return lambda *args: val(*gp_fixargs(args, True))
    513         else:
    514             return convertArcObjectToPythonObject(val)

ExecuteError: ERROR 002901: Sharing related error during geo-processing (Unable to check if service exists. (temp_netCDFwv1))
Failed to execute (UploadServiceDefinition).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we use a simple Map Image Service the process is working fine. Not with an Image layer.&lt;/P&gt;&lt;P&gt;It would be nice if someone could give us a hint?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx a lot.&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 14:52:49 GMT</pubDate>
    <dc:creator>MaxBöcke</dc:creator>
    <dc:date>2022-04-28T14:52:49Z</dc:date>
    <item>
      <title>ERROR 002901: Sharing related error during geo-processing (Unable to check if service exists. (SN)) Failed to execute (UploadServiceDefinition)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-002901-sharing-related-error-during-geo/m-p/1168786#M7345</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are working on an automation process which should publish multidimensional cloud raster files.&lt;/P&gt;&lt;P&gt;We tested with Notebooks in ArcGIS Pro 2.8 and ArcGIS Notebook Server 10.9.1. Both approaches produce the same error messages.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import arcpy
import json
import shutil
import arcgisscripting
import xarray as xr
from netCDF4 import Dataset as NetCDFFile 
import numpy as np
gis = GIS("home")

output_draft = '/arcgis/home/temperature_interim2.sddraft'
service = "SN"
con = "/arcgis/home/hub_hereon_de_image.ags"
# arcpy.CreateImageSDDraft(out_rasterdataset, output_draft, service,
#                         'FROM_CONNECTION_FILE', con, True, None, "netCDF test", "netCDF,test")
arcpy.CreateImageSDDraft(out_rasterdataset, output_draft, service,
                        'ARCGIS_SERVER')

try:
    arcpy.StageService_server(
        '/arcgis/home/temperature_interim2.sddraft', '/arcgis/home/temperature_interim3.sd')
    warnings = arcpy.GetMessages(1)
    print(warnings)
except Exception as stage_exception:
    print("Sddraft not staged. Analyzer errors encountered - {}".format(str(stage_exception)))

inSdFile = '/arcgis/home/temperature_interim3.sd'
arcpy.UploadServiceDefinition_server(inSdFile, con)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error Message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;---------------------------------------------------------------------------
ExecuteError                              Traceback (most recent call last)
/tmp/ipykernel_482/388611030.py in &amp;lt;module&amp;gt;
      3 # inServer = '/arcgis/home/rasterimage.ags'
      4 # inServer=r"C:/Users/Chaudhr1/arcgis/rasterimage.ags"
----&amp;gt; 5 arcpy.UploadServiceDefinition_server(inSdFile, con)

/opt/conda/lib/python3.7/site-packages/arcpy/server.py in UploadServiceDefinition(in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups)
   1293         return retval
   1294     except Exception as e:
-&amp;gt; 1295         raise e
   1296 
   1297 

/opt/conda/lib/python3.7/site-packages/arcpy/server.py in UploadServiceDefinition(in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups)
   1290     from arcpy.arcobjects.arcobjectconversion import convertArcObjectToPythonObject
   1291     try:
-&amp;gt; 1292         retval = convertArcObjectToPythonObject(gp.UploadServiceDefinition_server(*gp_fixargs((in_sd_file, in_server, in_service_name, in_cluster, in_folder_type, in_folder, in_startupType, in_override, in_my_contents, in_public, in_organization, in_groups), True)))
   1293         return retval
   1294     except Exception as e:

/opt/conda/lib/python3.7/site-packages/arcpy/geoprocessing/_base.py in &amp;lt;lambda&amp;gt;(*args)
    510         val = getattr(self._gp, attr)
    511         if callable(val):
--&amp;gt; 512             return lambda *args: val(*gp_fixargs(args, True))
    513         else:
    514             return convertArcObjectToPythonObject(val)

ExecuteError: ERROR 002901: Sharing related error during geo-processing (Unable to check if service exists. (temp_netCDFwv1))
Failed to execute (UploadServiceDefinition).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we use a simple Map Image Service the process is working fine. Not with an Image layer.&lt;/P&gt;&lt;P&gt;It would be nice if someone could give us a hint?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx a lot.&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 14:52:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-002901-sharing-related-error-during-geo/m-p/1168786#M7345</guid>
      <dc:creator>MaxBöcke</dc:creator>
      <dc:date>2022-04-28T14:52:49Z</dc:date>
    </item>
  </channel>
</rss>

