ArcGIS Server Replication and/or ArcGIS Server Feature Editing fails with an error code '400'. This issue is reproducible on all the ArcGIS Server versions starting at 10.2.
An error is shown in the ArcGIS Server logs similar to this:
Unable to create object class extension COM component [Database.ArcFM.MapInset]. Replica: Fuse.
The issue is due to an ArcFM Map Inset feature class present in the same dataset as the service referenced feature class(es). For example, if a Fuse is published as a feature service and a replica is attempted to be created from that feature service, it will fail since the ArcFM Map Inset feature class is present within the same dataset where the Fuse feature class resides. This could be the Electric dataset, or any other dataset, where both the Fuse and Map Inset feature classes are present.
This has been logged by Esri Support as [BUG-000101128 : Feature Service Create Replica operation fails when the feature class which is not the feature service's data source within the same feature dataset of the data source contains custom class extension or doesn't have GlobalID's]. (12/2/2016). This bug is currently under investigation by Esri. Any update will be added to this KB.
Move the ArcFM Map Inset feature class out of the current dataset and into a new (or other existing) dataset. Here are the steps to do so:
Note that this is a permanent database solution and precaution should be taken before implementation in test / dev / prod. Furthermore, no records can exist in any of the delta tables of this feature class. This should be verified prior to proceeding. If none, continue.
1. Find, or Create, a dataset that does not utilize features that participate in the feature service.
2. Right-click the dataset from Step 1 > New > Feature Class.
3. Change its Type to ArcFM Map Inset Feature. The geometry should remain Line.
4. Unless otherwise required to be changed, accept all the defaults to create the new ArcFM Map Inset Feature Class.
Register the dataset as versioned:
5. Right-click the same dataset as Step 2. > Manage > Register as Versioned.
Add Modelnames, AutoUpdaters, and Tasks:
6. Apply all that is required as described here: ArcFM Desktop Configuration Guide
1. Log in to ArcFM > Open a new map > add both the new and existing Map Inset features.
2. Open both attribute tables by right-clicking the layer > Attribute Table.
3. Start an Edit Session (or a Session through Session Manager)
Note: Step 4.1 and 5.1 have to be selections made from within the table, not in the map. This is due to some required features that do not exist spatially (thus not in the map).
4.1 Select all the features in the existing map inset table that have the "Scaled Map Inset" subtype. (Ex. Select by Attribute).
4.2 Right-click anywhere in the map > Copy.
4.3 Right-click anywhere in the map > Paste.
4.4 Set the Target as the New Map Inset > Scaled Map Inset.
5.1 Select all the features in the existing map inset table that have the "Linked Map Insert" subtype. (Ex. Select by Attribute).
5.2 Right-click anywhere in the map > Copy.
5.3 Right-click anywhere in the map > Paste.
5.4 Set the Target as the New Map Inset > Linked Map Insert.
Verify if all the linked items have been migrated successfully.
6. Reconcile & Post if the editing workflow was completed in a version.
Once this has been completed and verified, the old Map Inset feature class can be removed, thus resolving this problem.