Hey guys,
I am running into some problems this morning with trying to get my python scripts working. Any functions or API calls I try to make to the Cisco Meraki API seem to be timing out. Is anyone else experiencing this problem? Anyone know of a workaround? I am trying to automate switch configurations this morning.
2024-08-08 09:03:28 meraki: INFO > GET https://api.meraki.com/api/v1/organizations
2024-08-08 09:03:58 meraki: WARNING > organizations, getOrganizations - HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x1033e4080>: Failed to resolve 'api.meraki.com' ([Errno 8] nodename nor servname provided, or not known)")), retrying in 1 second
Traceback (most recent call last):
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
sock = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 976, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 490, in _make_request
raise new_e
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 466, in _make_request
self._validate_conn(conn)
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
conn.connect()
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 615, in connect
self.sock = sock = self._new_conn()
^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 203, in _new_conn
raise NameResolutionError(self.host, self, e) from e
urllib3.exceptions.NameResolutionError: <urllib3.connection.HTTPSConnection object at 0x1033e4080>: Failed to resolve 'api.meraki.com' ([Errno 8] nodename nor servname provided, or not known)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x1033e4080>: Failed to resolve 'api.meraki.com' ([Errno 8] nodename nor servname provided, or not known)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/meraki/rest_session.py", line 183, in request
response = self._req_session.request(method, abs_url, allow_redirects=False,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x1033e4080>: Failed to resolve 'api.meraki.com' ([Errno 8] nodename nor servname provided, or not known)"))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/kalebmohr/Work/BHC/cisco.py", line 9, in <module>
response = dashboard.organizations.getOrganizations()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/meraki/api/organizations.py", line 34, in getOrganizations
return self._session.get_pages(metadata, resource, params, total_pages, direction)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/meraki/rest_session.py", line 402, in _get_pages_legacy
response = self.request(metadata, 'GET', url, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kalebmohr/Work/.venv/lib/python3.12/site-packages/meraki/rest_session.py", line 197, in request
raise APIError(metadata, APIResponseError(e.__class__.__name__, 503, str(e)))
meraki.exceptions.APIError: organizations, getOrganizations - 503 HTTPSConnectionPool(host='api.meraki.com', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x1033e4080>: Failed to resolve 'api.meraki.com' ([Errno 8] nodename nor servname provided, or not known)")), {'error': 'HTTPSConnectionPool(host=\'api.meraki.com\', port=443): Max retries exceeded with url: /api/v1/organizations (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x1033e4080>: Failed to resolve \'api.meraki.com\' ([Errno 8] nodename nor servname provided, or not known)"))', 'status_code': 503}
Notice above I am getting tons of 503 errors, which is the HTTP code for service unavailable...
Is anyone else having issues?
Thanks,
Kaleb
Kaleb Mohr, CCNA. | Network Engineer
https://www.linkedin.com/in/kaleb-mohr
I am not an employee of Cisco or Cisco Meraki.