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_5969a618a67f4ad4ac3a812d3b843bce/FeatureServer/0
Update all maps true
Update Map Layer Publishing
=====================
Messages
Start Time: Wednesday, March 30, 2022 3:21:21 PM
Source Name: CommodityStaging Source Path:
\Documents\ArcGIS\Packages\EmergencyManagementMaps\emergencymanagement.gdb
To Name: L0Commodity_Staging To Path: https://services1.arcgis.com/X4F4xHLnScglSPkJ/arcgis/rest/services/CommodityStaging_active_5969a618a67f4ad4ac3a812d3b843bce/FeatureServer
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)