I have a script tool in Pro 2.9.5 that uses arcpy.management.ReconcileVersions. The input for the workspace is supposed to be a feature layer, for branch versioning, which we are using. When I run the script tool, it succeeds and does exactly what I want.
Explanation of the input_database below (arcpy.management.ReconcileVersions(input_database....):
The enterprise geodatabase that contains the versions to be reconciled. The default is to use the geoprocessing workspace environment. For branch versioning, this will be the feature service URL (that is, https://mysite.mydomain/server/rest/services/ElectricNetwork/FeatureServer). |
My code is getting the url of the item, which ends up being the feature service url. Again, works great in Pro. When I publish the tool to our federated server as a Web Tool, it fails, and says the workspace type is not correct.
Full error in GP tool when run at REST service:
ReconcileVersions retval = convertArcObjectToPythonObject(gp.ReconcileVersions_management(*gp_fixargs((input_database, reconcile_mode, target_version, edit_versions, acquire_locks, abort_if_conflicts, conflict_definition, conflict_resolution, with_post, with_delete, out_log, proceed_if_conflicts_not_reviewed, reconcile_checkout_versions), True))) File "E:\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000837: The workspace is not the correct workspace type. Failed to execute (ReconcileVersions).
I have tried everything I can think of, including using the .sde workspace and nothing seems to work. Any ideas?!
This is a confirmed bug, FYI.