Creating Replica via SyncManager Fails due to being unable to export relationships for layer

08-26-2022 12:49 PM
New Contributor III

I'm trying to export a file geodatabase via the createReplica operation. I've tried both through the python API and the REST API directly (using requests) but both fail on my hosted feature layer due to an issue exporting the relationships for one of my does not give any more information then that. Does anyone know a possible fix or the root cause of it? I have an almost identical hosted feature layer I use for testing and this works with no issue on it so it must be something with the data but I can't figure out what. 

The layer is Sync Enabled and here are the parameters I'm using:


# Using requests
data = {'f' : 'json',
    'replicaName' : "pi_features_prd",
    'layers' : layers,
    'layerQueries': json.dumps(layer_queries),
    'returnAttachments' : 'false',
    'returnAttachmentsDatabyURL' : 'false',
    'syncModel' : 'none',
    'dataFormat' : 'filegdb',
    'async' : 'true',
    'token': token}
result =, data=data).json()

# Using Python API
gis = GIS("", username, password)
fs_item = gis.content.get(item_id)
fc = FeatureLayerCollection.fromitem(fs_item)
sync_manager = SyncManager(fc)
result = sync_manager.create(
    sync_model = 'none', 

# the error
replicaName': 'pi_features_prd', 'replicaID': '', 'submissionTime': 1661540514537, 'lastUpdatedTime': 1661540521653, 'status': 'Failed', 'error': {'code': 500,
'message': 'Unable to create replica. Please check your parameters.', 'details': ['Exporting relationships for layer 7 failed.']}}


1 Reply
New Contributor

Hi, any update on this issue?

I'm having the same problem, although I'm not using any API. Instead, I'm trying to sync a FieldMaps via the interface. Still, accessing the result parameter in the job details gives me the following info:

"error": "{\"code\": 32, \"messageCode\": \"OffPkg_ 32\", \"message\": \"Replica job[itemID]/arcgis/rest/services/[serviceName]/FeatureServer/jobs/f89c9342-03b6-428b-b9b7-939cd7ac8fe5 encountered error {\\\"code\\\": 500, \\\"message\\\": \\\"Unable to create replica. Please check your parameters.\\\", \\\"details\\\": [\\\"Exporting relationships for layer 5 failed.\\\"]}\", \"params\": {\"url\": \"[itemID]/arcgis/rest/services/[serviceName]/FeatureServer/jobs/f89c9342-03b6-428b-b9b7-939cd7ac8fe5\", \"error\": \"{\\\"code\\\": 500, \\\"message\\\": \\\"Unable to create replica. Please check your parameters.\\\", \\\"details\\\": [\\\"Exporting relationships for layer 5 failed.\\\"]}\"}}"


0 Kudos