Select to view content in your preferred language

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

535
1
08-26-2022 12:49 PM
CarlVricella
Regular Contributor

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 layers...it 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 = requests.post(replica_url, data=data).json()

# Using Python API
gis = GIS("https://arcgis.com", username, password)
fs_item = gis.content.get(item_id)
fc = FeatureLayerCollection.fromitem(fs_item)
sync_manager = SyncManager(fc)
result = sync_manager.create(
    output_fgdb_name, 
    layers, 
    json.dumps(layer_queries), 
    return_attachments=True, 
    sync_model = 'none', 
    asynchronous=True, 
    wait=False, 
    attachments_sync_direction='bidirectional',
    data_format='filegdb'
)



# 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
CSDING_GIS
Occasional 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 https://services3.arcgis.com/[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\": \"https://services3.arcgis.com/[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