laptop and a wrench

Erro

The UpdateConnectionProperties method appends "URL=" to the Server parameter of the updated layer, resulting in a broken data source.

ArcGIS Pro
Número de ID do Erro BUG-000171987
EnviadoNovember 4, 2024
Última ModificaçãoOctober 20, 2025
Aplica-se àArcGIS Pro
Versão encontrada3.2.4
Sistema OperacionalWindows OS
Versão do Sistema Operacional11.0 64 bit
StatusUnder Consideration

Informações Adicionais

Unlike Feature Services and many other data types, Map Services are not yet supported in the function. Map Services are also not supported in the Update Data Sources panel within the Catalog View in ArcGIS Pro. By setting the function, you are forcing the new URL into the layer, even though it is currently unsupported. If you set it, the layer will not be updated, which is by design until Map Services are officially supported. But you can modify the CIM definition of the layer like this to update the Map Service URL: aprx = arcpy.mp.ArcGISProject('current') m = aprx.listMaps('Map')[0] lyr = m.listLayers('PyUnit10931_2')[0] c = lyr.getDefinition('V3') c.serviceConnection.url = 'https://tiles.arcgis.com/tiles/k4wsDILUIGeQ5HvW/arcgis/rest/services/MyServiceName/MapServer' lyr.setDefinition(c) More information on the CIM can be found here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm And here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS

Solução Provisória

Unlike Feature Services and many other data types, Map Services are not yet supported in UpdateConnectionProperties at this time. But you can modify the CIM definition of the layer like this: aprx = arcpy.mp.ArcGISProject('current') m = aprx.listMaps('Map')[0] lyr = m.listLayers('PyUnit10931_2')[0] c = lyr.getDefinition('V3') c.serviceConnection.url = 'https://tiles.arcgis.com/tiles/k4wsDILUIGeQ5HvW/arcgis/rest/services/MyServiceName/MapServer' lyr.setDefinition(c) More information on the CIM can be found here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/python-cim-access.htm And here: https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/updatingandfixingdatasources.htm#ESRI_SECTION1_DD16BE1F4AC54F078A04C84BD22C8D9B:~:text=%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ConPropsWithJoins(cp)-,Updating%20data%20sources%20using%20the%20CIM,-Starting%20with%20ArcGIS

Etapas para Reproduzir

ID do Erro: BUG-000171987

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download