DNC List Download

Hello, I have a script that was working until yesterday morning. It downloads the dnc list after getting the uri. I have to go through a proxy server, but every other api call I have working in multiple different scripts are still working fine through that proxy, except for dowloading the csv for DNC lists and Contact Lists as well. Did anything change on the PureCloud side a couple days ago? I am getting a 403 forbidden error.

A 403 generally indicates a permissions issue. Check the response payload for additional details on the error.

/usr/local/lib/python3.6/site-packages/google/auth/crypt/_cryptography_rsa.py:22: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
import cryptography.exceptions
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 700, in urlopen
self._prepare_proxy(conn)
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _prepare_proxy
conn.connect()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 369, in connect
self._tunnel()
File "/usr/lib64/python3.6/http/client.py", line 929, in _tunnel
message.strip()))
OSError: Tunnel connection failed: 403 Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 450, in send
timeout=timeout
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api-downloads.usw2.pure.cloud', port=443): Max retries exceeded with url: /dnc-lists/exports/[[[[REDACTED]]]] (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/kohls/apps/ai-ops/aiops-ml/rundeck/scripts/purecloud/pcInventory.py", line 401, in
pc.main()
File "/kohls/apps/ai-ops/aiops-ml/rundeck/scripts/purecloud/pcInventory.py", line 371, in main
dnc_numbers = self.dncListGet(id)
File "/kohls/apps/ai-ops/aiops-ml/rundeck/scripts/purecloud/pcInventory.py", line 333, in dncListGet
api_response, timeout=15, headers=headers, proxies=self.proxies
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 667, in send
history = [resp for resp in gen]
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 667, in
history = [resp for resp in gen]
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 245, in resolve_redirects
**adapter_kwargs
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 513, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api-downloads.usw2.pure.cloud', port=443): Max retries exceeded with url: /dnc-lists/exports/[[[[REDACTED]]]] (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden',)))
Result: 1
Failed: NonZeroResultCode: Result code was 1
Execution failed: 855251 in project AIOPS: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [aiops-rundeck-c1-prd-1.kohls.com: NonZeroResultCode: Result code was 1 + {dataContext=MultiDataContextImpl(map={ContextView(step:1, node:aiops-rundeck-c1-prd-1.kohls.com)=BaseDataContext{{exec={exitCode=0}}}, ContextView(node:aiops-rundeck-c1-prd-1.kohls.com)=BaseDataContext{{exec={exitCode=0}}}}, base=null)} ]}, Node failures: {aiops-rundeck-c1-prd-1.kohls.com=[NonZeroResultCode: Result code was 1 + {dataContext=MultiDataContextImpl(map={ContextView(step:1, node:aiops-rundeck-c1-prd-1.kohls.com)=BaseDataContext{{exec={exitCode=0}}}, ContextView(node:aiops-rundeck-c1-prd-1.kohls.com)=BaseDataContext{{exec={exitCode=0}}}}, base=null)} ]}, status: failed]

@Dustin_York Please contact your company's security team immediately to inform them of a potential data breach of all the phone numbers in that DNC list. I have edited your post to remove the download URL with the embedded auth token in it, but it was exposed publicly on the internet for ~30 mins before I caught it and removed it.

FWIW this appears to be an error on your side because I was able to successfully download the DNC export from the URL in your post. I have permanently deleted the file from my computer after seeing it completed successfully.

The error seems to originate from your proxy:

We encountered the similar problem last week.
Genesys Cloud changed firewall requirements.

June 10, 2024 - Genesys Cloud Resource Center (mypurecloud.com)

Before this release, download url is such like 'https://xxxxxx.s3..amazonaws.com/MediaCache/xxxx , but it changed to
'https://api-downlaods.mypurecloud.jp/MediaCache/xxxx' last week.
Your proxy may affect this change.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.