Select to view content in your preferred language

layer.edit_features hangs

63
1
Jump to solution
a week ago
DonMorrison1
Frequent Contributor

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?

 

 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DonMorrison1
Frequent Contributor

I never really figured this out but was able to move on with my project by using the REST API instead (see this post). 

View solution in original post

0 Kudos
1 Reply
DonMorrison1
Frequent Contributor

I never really figured this out but was able to move on with my project by using the REST API instead (see this post). 

0 Kudos