Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiomeraki.organizations.getOrganizationApiRequests failing after upgrading the SDK from 1.34.0 to 1.36.0 #222

Closed
obrigg opened this issue Aug 18, 2023 · 5 comments
Labels
not able to reproduce We weren't able to reproduce this in a test environment.

Comments

@obrigg
Copy link

obrigg commented Aug 18, 2023

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.
Same script works fine with SDK 1.34.0, but fails on 1.36.0.

Python version installed
Python 3.10.8

Meraki library version installed
1.34.0 and 1.36.0

Have you reproduced the issue with the latest version of this library? And with the latest version of Python?

OS Platform
MacOS Ventura 13.5

Describe the bug
After upgrading one of the virtual environments to the Python SDK 1.36.0, one of my scripts started failing with the operation aiomeraki.organizations.getOrganizationApiRequests ('URL' object has no attribute 'decode'). The operation works fine in sync mode and works fine when downgrading to version 1.34.0.

How can we replicate the problem you're reporting?
Try running the aiomeraki.organizations.getOrganizationApiRequests operation at versions 1.34.0 and 1.36.0.

@bbaileyga1
Copy link

Thanks, I find it curious that it worked fine with one org with 1 network but the second org with 10 networks it failed.

@obrigg
Copy link
Author

obrigg commented Aug 18, 2023

Good question. I'm not sure yet.
I think it depends on the amount of API activity in the organization.

@TKIPisalegacycipher
Copy link
Collaborator

On my end the command completes successfully, so I'm not able to reproduce this in 1.36.0.

Please provide an example script where this is reproducible.

@TKIPisalegacycipher TKIPisalegacycipher added the not able to reproduce We weren't able to reproduce this in a test environment. label Sep 11, 2023
@obrigg
Copy link
Author

obrigg commented Sep 11, 2023

Sure. Just tried it with 1.37 - still occurs.
The API key and org are the DevNet sandbox, that's why they're visible.

import asyncio
import meraki.aio

async def main():
    async with meraki.aio.AsyncDashboardAPI(
        api_key="75dd5334bef4d2bc96f26138c163c0a3fa0b5ca6",
        output_log=False,
        suppress_logging=True,
        maximum_concurrent_requests=5,
        nginx_429_retry_wait_time=2,
        wait_on_rate_limit=True,
        maximum_retries=100,
    ) as aiomeraki:
        try:
            api_requests = await aiomeraki.organizations.getOrganizationApiRequests(org_id, timespan=7 * 86400, perPage=1000, total_pages=10)
        except Exception as e:
            print(f"Some other ERROR: {e}")

org_id = 1215707
loop = asyncio.new_event_loop()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())

@TKIPisalegacycipher
Copy link
Collaborator

If you encounter this issue, please ensure you update to the latest version of the repo, at least 1.39.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not able to reproduce We weren't able to reproduce this in a test environment.
Projects
None yet
Development

No branches or pull requests

3 participants