Summary
Script breaks if there is no blob endpoint in storage account.
Steps to Reproduce
Steps to reproduce the behavior:
- Create a subscription with storage accounts
- Leave some storage accounts without blob endpoint (only file endpoint etc)
- Run the scripts
- Error thrown
Actual Results (including error logs, if applicable)
Traceback (most recent call last):
File ".\BlobHunter.py", line 229, in
main()
File ".\BlobHunter.py", line 222, in main
check_subscription(tenants_ids[i], tenants_names[i], subs_ids[i], subs_names[i], credentials)
File ".\BlobHunter.py", line 110, in check_subscription
public_containers = check_storage_account(account, key)
File ".\BlobHunter.py", line 60, in check_storage_account
for cont in containers:
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\paging.py", line 129, in next
return next(self._page_iterator)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\paging.py", line 76, in next
self._response = self._get_next(self.continuation_token)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\storage\blob_models.py", line 402, in _get_next_cb
use_location=self.location_mode)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\storage\blob_generated\operations_service_operations.py", line 356, in list_containers_segment
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 211, in run
return first_node.send(pipeline_request) # type: ignore
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
[Previous line repeated 1 more times]
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline\policies_redirect.py", line 158, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\storage\blob_shared\policies.py", line 515, in send
raise err
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\storage\blob_shared\policies.py", line 489, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\storage\blob_shared\policies.py", line 290, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 71, in send
response = self.next.send(request)
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline_base.py", line 103, in send
self._sender.send(request.http_request, **request.context.options),
File "C:\Users\xxxxxxx\Desktop\blobhunt\lib\site-packages\azure\core\pipeline\transport_requests_basic.py", line 261, in send
raise error
azure.core.exceptions.ServiceRequestError: <urllib3.connection.HTTPSConnection object at 0x000002410ACAB198>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
Environment setup
Azure account with Storage Account Contributor permission
Windows Server 2016
##Additional information
I suspect the error caused because the script tries to request to invalid URI. The getaddrinfo indicates no DNS record for the URI. I double checked by directly accessing the URI in web browser.
kind/bug contributor