Error from Pro 2.8.x to 2.9 upgrade

Jump to solution
11-23-2021 02:26 PM
New Contributor II

I have a code that a developer created that no long works for me.  With a recent upgrade from 2.8.x to 2.9, the script no errors out at a line "".  What I believe the code is trying to do update the source of feature layers in a map ("1_Service_Status_On").  However, when it comes to the line, it gives me the following error:

Traceback (most recent call last):
File "<string>", line 686, in <module>
File "A:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\", line 285, in save
return convertArcObjectToPythonObject(*gp_fixargs((), True)))
OSError: G:\SDE_User_Connections\Projects\UnitedStates\US_Test01\Web_Services\Test01_Project_Services.aprx

I'm running the code in an empty APRX file so I don't even have the Test01_Project_Services.aprx open.  I'm a novice at python so any I can provide more of the code if necessary.

0 Kudos
1 Solution

Accepted Solutions
New Contributor III

seems like there are still issues with even in 3.1, I can run a geoprocessing script with modifies then saves an .aprx file once after opening ArcGIS Pro, but the same script a second time will give the OSError until I re-open Pro

View solution in original post

22 Replies
Esri Contributor

project folder/files access permissions? 
I would try to do manually in Pro what they code is trying to do, you might get more descriptive error message.

0 Kudos
New Contributor II

Ihab thanks for responding, my user has admin rights to all the project folders.  Also I'm not sure why it's still referencing the default python library.  In Pro, I cloned the default python library and use it as the default library, which is saved on the C: drive.  One other note is that the code was written in python 2.7.16.  Not sure if that makes a difference.  These are the lines to the line 686 error:

for project_service_map_object in project_service_map_list:
if == r"1_Service_Status_On":
print("Captured -- " +

print("Creating a List of Layers in " +
project_service_layers_list = project_service_map_object.listLayers("*")

print("Updating Data Source for All Layers in the 1_Service_Status_On Map")
for layer in project_service_layers_list:
if not (layer.isGroupLayer or layer.isBasemapLayer):
print("Before: " + str(

0 Kudos
New Contributor III


I'm into this too. We are running and uploading analysis from the past year every single day. Today decided to upgrade ArcGIS PRO to 2.9 version, and now i'm getting this error in all my scripts, every time when i run  "". There is a way to downgrade to 2.8 version, i need this stuff working has it was in the past year.



New Contributor III


I'm having the same problem and it has nothing to do with access permissions or anything else. I run the same python in two computers that deal with the same files in our internal network. The one with the Pro 2.7 works and the one with the Pro 2.9 doesn't.

Besides, you don't need much code to show the problem. Two lines are enough to make the python crash:

# p_Pro_project is the path of an existing project
o_Pro_project =
Any ESRI people can confirm the bug or the "by design feature"? It would be nice at least to hear a YES or a NO.
New Contributor

My Current work around is to use 

New Contributor II

I will second this workaround! I had a similar issue where threw an OSerror, which began after we upgraded from ArcPro 2.8.3 to 2.9.1. We also had the same error on thrown on a GP service after upgrade from arcgis enterprise 10.8.1 to 10.9.1. altering the code to aprx.saveACopy() resulted in normal functionality on both pro and enterprise/server. Thanks for the tip!

0 Kudos
New Contributor

I am experiencing this same issue.

I try to save an aprx after loading some layouts using: 

and then I get the error.

File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\", line 285, in save
return convertArcObjectToPythonObject(*gp_fixargs((), True)))


ESRI please advise. Are we doing something wrong?

0 Kudos
New Contributor II

Yep. throws an OSError for me, every single time. v. 2.9

0 Kudos
New Contributor III

Looks like this is still an issue in Pro 2.9.2

I also get an OSError when calling in my script to replace project data sources

Any word from Esri about this?

0 Kudos