I need to write a reconcile version script and publish it as web tool. After I publish the python script as web tool then execute, I got this error message:
If I run the script using ArcGIS Pro Desktop it shows reconcile successfully. However when publish the script as web tool and execute it returns starting editing on version error.
Below is the sample script that I wrote:
import arcpy, sys, datetime, os, tempfile, shutil
from arcpy import env
def main():
arcpy.env.overwriteOutput = True
url = "https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer"
version = "USER.MyVersion"
post_desc = "N"
portal_user = "user"
portal_pwd = "password"
portal_url = "portal_url"
with_post = "NO_POST"
if post_desc == "Y":
with_post = "POST"
workspace = url
arcpy.env.workspace = workspace
arcpy.SignInToPortal(portal_url, portal_user, portal_pwd)
reconcileLog = r'C:\NewFolder\Reconcile_Log.txt'
result = arcpy.ReconcileVersions_management(workspace,
"ALL_VERSIONS",
"SDE.DEFAULT",
version,
"LOCK_ACQUIRED",
"ABORT_CONFLICTS",
"BY_OBJECT",
"FAVOR_EDIT_VERSION",
with_post,
"KEEP_VERSION",
reconcileLog)
if len(result.getMessages(1)) > 0 :
arcpy.AddWarning ((result.getMessages(1)))
else:
arcpy.AddMessage ("Version reconciled successfully.")
if __name__ == "__main__":
main()
I did google about this error and there's no solution. And also the return message is very limited as it only shows error starting editing on version. Anyone have encounter this problem? Or have any solution about this?
Thanks for any suggestions!
Hi @CSM , We are also facing the same issue. Did you find any solution? Please share.