I'm writing a python script to update a public feature class on my enterprise portal. The edit_features API call hangs then times out with this message
*** requests.exceptions.ConnectionError: A connection error has occurred: HTTPSConnectionPool(host='gis.mortonarb.org', port=443): Max retries exceeded with url: /server/rest/services/Hosted/service_d8b3fda9400f4053aa5c90c400d6c07d/FeatureServer/0/applyEdits (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))
I can edit the feature class from the item's data tab and also directly in the REST service (anonymously), but it fails using the API. The API works for reading the layer.
CRTI_URL = 'https://gis.mortonarb.org/server/rest/services/Hosted/service_d8b3fda9400f4053aa5c90c400d6c07d/FeatureServer/0'
CRTI_FEATURE_LAYER = gis.content.search(CRTI_URL)[0].layers[0]
CRTI_FEATURE_LAYER.edit_features(updates=[{"objectid": 2, "is_copied": 1}])
Any ideas on what might be the problem?
Solved! Go to Solution.
I never really figured this out but was able to move on with my project by using the REST API instead (see this post).
I never really figured this out but was able to move on with my project by using the REST API instead (see this post).