I have a custom Core Host application built for use with ArcGIS Pro 2.9.8 and Enterprise 10.9.1. It's scheduled to run on a nightly basis as job on a server, under admin credentials and it's creating a new branch version to run within each night. The premise of the job is to search for active services created by an external but integrated asset management system, that were placed in a default location and use pre-defined mapping criteria, to map those services to their proper addresses by placing a new service tee and moving the existing geometry for the service line to the new location.
I have not had problems with my application in the past, but recently the job has started to fail out when calling the Search() method on the pipeline line feature class part of our Utility Network (version 5). I receive a general geodatabase exception:
ArcGIS.Core.Data.GeodatabaseGeneralException: 'Must be the owner to do this operation.' COMException: Exception from HRESULT: 0x80040217
The search method is taking in a spatial query and a false setting on the useRecyclingCursor parameter. When I pass in the same envelope and filter criteria (active lifecyclestatus) used in the Core Host app to the REST endpoint for the pipeline line feature class, I get back 1878 results, but when I try to set my row cursor equal to the search results in my application, I get the gdb exception when running. The data source connection is established as a web geodatabase with the service URL to the Utility Network within the application. Running under the UN owner credentials instead of the usual admin account for jobs, results in the same GDB exception.
Any thoughts on what might be going wrong/how to resolve this exception?
Did you update the server? What caused the script to fail suddenly?
It works on our production server and does not work on our lower environment server. The only updates to the servers that I am aware of, are the standard Microsoft and Windows patches that are installed monthly. There have not been any enterprise patches installed recently or updates made to the script's code. I did try copying the production code to the lower env server and running it and that did not work. I also cannot run against the lower env on my local dev machine.