dashboard-api-python
dashboard-api-python copied to clipboard
Api calls silently fail when retries exceeded
Describe how you confirmed the issue is with the library, and not with the API itself, or a server-side issue of some other kind. Random failures in automation and a source code audit.
Python version installed 3.11
Meraki library version installed 2.0.2
Have you reproduced the issue with the latest version of this library? And with the latest version of Python? No
Describe the bug Api calls that fail due to the number of retries exceeded silently fail.
How can we replicate the problem you're reporting? The issue may be difficult to reproduce due to depending on api implementation details.
Expected behavior I would expect an exception to be raised
Additional Information
2025-06-25 21:40:15 meraki: INFO > POST https://api.meraki.com/api/v1/networks/***/bind
2025-06-25 21:40:15 meraki: WARNING > networks, bindNetwork - 429 Too Many Requests, retrying in 1 seconds
2025-06-25 21:40:16 meraki: INFO > POST https://api.meraki.com/api/v1/networks/***/bind
2025-06-25 21:40:17 meraki: WARNING > networks, bindNetwork - 429 Too Many Requests, retrying in 1 seconds
The calling code does not raise an exception
dashboard.networks.bindNetwork(network_id, bind_to_template_id)
I beleve the bug is that line 267 decrements the retries without raising an exception then on line 204 retries == 0. This then causes request to return None.
https://github.com/meraki/dashboard-api-python/blob/a026860357c997689c79295c9cac6040cbc13808/meraki/rest_session.py#L257-L270
https://github.com/meraki/dashboard-api-python/blob/a026860357c997689c79295c9cac6040cbc13808/meraki/rest_session.py#L204
@TKIPisalegacycipher Would you take a look?