Error when using Replace Layers tool in Emergency Management Maps project

498
4
Jump to solution
03-30-2022 12:49 PM
MennoTerBals_GIS4C
Esri Contributor

When using the "Update Data Sources" task in the ArcGIS Pro project "Emergency Management Maps" the following error occurs upon running the Replace Layers script tool.

I'm using ArcGIS Pro 2.9.2

Any help would be appreciated. Thanks!

 

Replace Layers
=====================
Parameters

Data Sources 'Commodity Staging' https://services1.arcgis.com/X4F4xHLnScglSPkJ/arcgis/rest/services/CommodityStaging_active_5969a618a...
Update all maps true
Update Map Layer Publishing
=====================
Messages

Start Time: Wednesday, March 30, 2022 3:21:21 PM
Source Name: CommodityStaging Source Path: D:\Documents\ArcGIS\Packages\EmergencyManagementMaps\emergencymanagement.gdb
To Name: L0Commodity_Staging To Path: https://services1.arcgis.com/X4F4xHLnScglSPkJ/arcgis/rest/services/CommodityStaging_active_5969a618a...
Current map: 1 - Situation Map
Traceback (most recent call last):
File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 90, in _get
return convertArcObjectToPythonObject(getattr(self._arc_object, attr_name))
AttributeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Documents\ArcGIS\Packages\EmergencyManagementMaps\ReplaceLayers.py", line 82, in remap_layers
curr_fc_name = os.path.basename(os.path.normpath(layer.dataSource))
File "D:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 96, in _get
(attr_name, self.__class__.__name__))
AttributeError: The attribute 'dataSource' is not supported on this instance of Layer.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Documents\ArcGIS\Packages\EmergencyManagementMaps\ReplaceLayers.py", line 127, in <module>
remap_layers(from_source, to_source, all_maps_option, maps_to_update)
File "D:\Documents\ArcGIS\Packages\EmergencyManagementMaps\ReplaceLayers.py", line 104, in remap_layers
PrintException()
File "D:\Documents\ArcGIS\Packages\EmergencyManagementMaps\ReplaceLayers.py", line 20, in PrintException
linecache.checkcache(filename)
NameError: name 'linecache' is not defined

Failed script Replace Layers...
Failed to execute (ReplaceLayers).
Failed at Wednesday, March 30, 2022 3:21:22 PM (Elapsed Time: 0.55 seconds)

0 Kudos
1 Solution

Accepted Solutions
JeremiahLindemann
Esri Contributor

Hi @MennoTerBals_GIS4C thanks for the patience. We are working to get this resolved.  In the meantime here are a couple workarounds.

  • In the "1 - Situation" map, remove the group layer "Infrastructure" by moving all layers (Schools, Hospitals, Police Stations" as their own stand alone layers.  Run the tool and should update.
  • You can revert back to ArcGIS Pro 2.9.  We've confirmed the tool works in ArcGIS Pro 2.9, but can replicate the problem in Pro 2.9.2.

Thanks

Jeremiah

View solution in original post

4 Replies
LindsayThomas
Esri Contributor

What version of the Emergency Management Operations solution is being used?  (Deploying to ArcGIS Online, or ArcGIS Enterprise?)

Also, if you are deploying to enterprise what version is used?

0 Kudos
MennoTerBals_GIS4C
Esri Contributor

Thanks for the reply @LindsayThomas . I'm using the ArcGIS Online version which I deployed on March 29.

0 Kudos
JeremiahLindemann
Esri Contributor

Hi @MennoTerBals_GIS4C thanks for the patience. We are working to get this resolved.  In the meantime here are a couple workarounds.

  • In the "1 - Situation" map, remove the group layer "Infrastructure" by moving all layers (Schools, Hospitals, Police Stations" as their own stand alone layers.  Run the tool and should update.
  • You can revert back to ArcGIS Pro 2.9.  We've confirmed the tool works in ArcGIS Pro 2.9, but can replicate the problem in Pro 2.9.2.

Thanks

Jeremiah

MennoTerBals_GIS4C
Esri Contributor

Thanks @JeremiahLindemann ! The first workaround worked for me.