laptop and a wrench

Error

Calling ArcPy StageService in ArcGIS Pro for a new layer returns the following error, "Selected layer does not contain a required layer type for web feature layer."

Última publicación: May 14, 2020 ArcGIS Pro
Número de ID del error BUG-000130380
EnviadoApril 24, 2020
Última modificaciónFebruary 20, 2025
Relacionado conArcGIS Pro
Versión encontrada2.5
Sistema operativoWindows OS
Versión de sistema operativo10.0 64 Bit
EstadoKnown Limit

Información adicional

This issue is a technical limitation. The user has to save the .aprx file before trying to stage the service.

Solución alternativa

  1. Add a new layer.
  2. Before the ArcPy CreateWebLayerSDDraft or StageService methods are called in the code, save the project in the code (or manually in ArcGIS Pro).

Below is an example:

aprx.save() 

# Replace out_sddraft path, service name and folder name 

arcpy.mp.CreateWebLayerSDDraft(map_or_layers=selected_layer,

         out_sddraft='C:/.../mydraft.sddraft',

         service_name='MyServiceName',

         folder_name='MyFolder',

         overwrite_existing_service=True,

         copy_data_to_server=True,

         enable_editing=True,

         allow_exporting=True,

         enable_sync=True)

# Replace paths

arcpy.StageService_server('C:/.../mydraft.sddraft', 'C:/.../mydraftsd.sd', 5) 

Pasos para reproducir

ID del error: BUG-000130380

Software:

  • ArcGIS Pro

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga