Warning 000585 with arcpy's Clear Workspace Cache tool

265
1
01-03-2024 11:57 AM
anonymous_geographer
Occasional Contributor

Hey everyone,

I recently upgraded from Pro 3.1.4 to Pro 3.2.1, and am running my scripts through some audits to ensure odd behavior has not been introduced with the minor release update. I'm hoping to get some clarification regarding new output messages I'm seeing in my Python script.

I have quite a few .sde enterprise connections that I use for various purposes. At the end of those operations (compressions, for example), I use the ClearWorkspaceCache_management code block.  For years, this has worked fine as-is. The arcpy.GetMessages() output will show Start Time and Succeeded.  However, with the upgrade to 3.2.1, I'm now getting an extra message "WARNING 000585: Warning occurred during execution."

Nothing seems to fail, but I'm concerned about what this new message is trying to warn me about.

A basic code snippet that produced the above warning message:

import arcpy

print("clearing cache...")

arcpy.ClearWorkspaceCache_management("C:\\Path\\To\\Connection\\Example.sde")

print(arcpy.GetMessages())

 

Output result:

clearing cache...
Start Time: Wednesday, January 3, 2024 1:30:26 PM
Succeeded at Wednesday, January 3, 2024 1:30:28 PM (Elapsed Time: 1.63 seconds)
WARNING 000585: Warning occurred during execution.


The warning code description left me puzzled, since it's a string path to the .sde file. I thought maybe it was some sort of format deprecation warning, so I tried the new arcpy.management.ClearWorkspaceCache() format. However, it gave the same Warning message.

I tried using .sde files created from ArcMap as well as ArcGIS Pro, in case of compatibility issues. Nope, that didn't change anything either.

I also tried changing the string path format I used from \\ to r', but no output difference with that either.

There has been only one scenario (so far) where I am able to make the Warning message disappear. Instead of assigning the .sde connection path to the geoprocessing tool itself, I needed to first assign it to the arcpy.env.workspace beforehand. From there, it appeared to work as intended.

import arcpy

print("clearing cache...")

arcpy.env.workspace = "C:\\Path\\To\\Connection\\Example.sde"

arcpy.ClearWorkspaceCache_management()

print(arcpy.GetMessages())


New output:

clearing cache...
Start Time: Wednesday, January 3, 2024 1:40:47 PM
Succeeded at Wednesday, January 3, 2024 1:40:47 PM (Elapsed Time: 0.20 seconds)


I see that the Clear Workspace Cache documentation shows the above example in the official code sample, but that documentation also shows that the input data can still be included within the tool itself.

anonymous_geographer_0-1704311156665.png

I guess I'm just confused as to what the Warning message is trying to actually tell me. Has anyone had any experience or epiphanies with this one yet?

Thanks for any insight. I'm hoping I won't need to modify every script to accommodate the arcpy.env.workspace format.




0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

The error is non-descript

000585: Warning occurred during execution.—ArcGIS Pro | Documentation

and you may have found the solution


... sort of retired...
0 Kudos