Select to view content in your preferred language

socket.gaierror: [Errno 11001] getaddrinfo failed

4080
0
08-28-2023 05:02 AM
Labels (3)
AbdujabborMakhmudov
New Contributor

Greetings,

i want to overwrite feature service in portal. i followed this guide https://developers.arcgis.com/python/samples/overwriting-feature-layers/ but im getting an error at overwriting part.

 

from arcgis.gis import GIS
from arcgis import features
import pandas as pd
import os
from arcgis.features import FeatureLayerCollection

portal_url = "https://myportalurl"
username = "login"
password = "pass"

gis = GIS(portal_url, username, password)

fileid = '9bfb22d38bee49af93ad56952f5a4cc3'

item = gis.content.get(fileid)

# item_props = {
#     "title": "Updated title",
#     "description": "Updated description"
# }
# item.update(
#     item_properties=item_props,
# )
# updating is not causing any problems

new_file_path = os.path.join( os.getcwd(), "uz_thermal_points.zip")

thermal_flayer_collection = FeatureLayerCollection.fromitem(item)

thermal_flayer_collection.manager.overwrite(new_file_path)

 

filename is the same as original published file. in the website, there is no error while overwriting features.
i got this error:

 

Exception has occurred: ConnectionError
A connection error has occurred: HTTPSConnectionPool(host='esrisrv.uzspace.org', port=6443): Max retries exceeded with url: /arcgis/rest/services/Hosted/uz_thermal_points/FeatureServer/layers?f=json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A5D6EDC10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000022A5D6EDC10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='esrisrv.uzspace.org', port=6443): Max retries exceeded with url: /arcgis/rest/services/Hosted/uz_thermal_points/FeatureServer/layers?f=json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A5D6EDC10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='esrisrv.uzspace.org', port=6443): Max retries exceeded with url: /arcgis/rest/services/Hosted/uz_thermal_points/FeatureServer/layers?f=json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A5D6EDC10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

During handling of the above exception, another exception occurred:

  File "D:\scripts\thermal_active\from arcgis.py", line 33, in <module>
    thermal_flayer_collection.manager.overwrite(new_file_path)
requests.exceptions.ConnectionError: A connection error has occurred: HTTPSConnectionPool(host='esrisrv.uzspace.org', port=6443): Max retries exceeded with url: /arcgis/rest/services/Hosted/uz_thermal_points/FeatureServer/layers?f=json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000022A5D6EDC10>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

 

 i found post which had similar problem, but solution required using request module instead of using the httplib. However, i cant control it in my case.

0 Replies