English

Error: Packaging succeeded, but publishing failed. Service cannot be overwritten if Sync is enabled and Replicas exist

Error Message

When attempting to overwrite an existing feature service to be used in Collector for ArcGIS, the overwriting fails with the following error message:

Error:   
Packaging succeeded, but publishing failed. Service cannot be overwritten if Sync is enabled and Replicas exist
Screenshot of the error message

Cause

This error occurs when the web map containing the feature service is taken offline to make edits, and the edits are not synced back to the feature service in ArcGIS Online, which causes previously created replicas of the feature service to still be present at the REST endpoint. When a previous replica exists, overwriting the feature service is not allowed.

This is by design to prevent users from overwriting the existing data in the replica (for example, attempting to overwrite a feature service in a web map synced to a user's mobile device to allow the user to make updates while offline, fails and returns the error). This is because until the user syncs the data back to ArcGIS Online, the replica still remains.

Solution or Workaround

Remove any existing replicas of the feature service by unregistering the replicas from the feature service REST directory to overwrite the feature service. To do so, follow the instructions provided below.

Note:
Ensure the feature service is not being utilized in Collector for ArcGIS before performing the steps listed below. 
  1. On the item details page of the feature service, click the drop-down arrow located at the end of the feature layer name under the Layers heading, and click Service URL.
  2. When the ArcGIS REST Services Directory page opens up in the browser, remove the number 0 at the end of the feature service REST URL in the browser's address box, and press Enter.
Service URL in the browser's address box
  1. Click the Replicas link located at the Child Resources heading to direct to the replicas page, where all the replicas of the feature service at the REST endpoint are listed.
  2. To remove the replica, copy the replica ID, and click the back button on the browser.
Copy Replica ID
  1. Click the Unregister Replica link located at the Supported Operations heading.
  2. On the Unregister Replica page, paste the replica ID copied from Step 4 in the Replica ID field, and click the Unregister Replica button.
Screenshot of the Unregister Replica button

Related Information