When i try to upload a file i get few errors i cant find solution doing google search.
My Code
from BunnyCDN.Storage import Storage
from BunnyCDN.CDN import CDN
obj_storage = Storage('MY_STORAGE_API_KEY',
storage_zone='my-space', storage_zone_region='DE')
obj_storage.PutFile(file_name='new_thum.jpg',
storage_path='new-post/thumnail.jpg', local_upload_file_path='D:/Documents/python/images/')
here is the complete error output when run my python file.
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Python310\lib\socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connection.py", line 358, in connect
conn = self._new_conn()
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000028EC82B4040>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='de.storage.bunnycdn.com', port=443): Max retries exceeded with url: /my-space/new-post/my-thum.jpg (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000028EC82B4040>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\Documents\python\ui-library-automation\bunny\upload.py", line 10, in <module>
obj_storage.PutFile(file_name='new_thum.jpg',
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\BunnyCDN\Storage.py", line 148, in PutFile
response = requests.put(url, data=file_data, headers=self.headers)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\api.py", line 132, in put
return request('put', url, data=data, **kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "D:\Documents\python\ui-library-automation\uilib-env\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='de.storage.bunnycdn.com', port=443): Max retries exceeded with url: /my-space/new-post/my-thum.jpg (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000028EC82B4040>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Do you have a proxy setup?
In my case i experienced a similar error socket.gaierror: [Errno 11001] getaddrinfo failed with a different package only to find out my hostname was incorrect
When i try to upload a file i get few errors i cant find solution doing google search.
My Code
here is the complete error output when run my python file.