question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InvalidContinuationToken when paginating results with azure-mgmt-compute

See original GitHub issue

Package Name: azure-mgmt-compute Package Version: 28.0.1 Operating System: MacOS 12.6 Python Version: 3.8 and 3.9

Describe the bug Operations in the ComputeManagementclient that require pagination are failing after upgrading the package to 28.0.0 and 28.0.1.

To Reproduce Steps to reproduce the behavior:

  1. Have a subscription with multiple pages of resources, in my case, VMs
  2. Call list_all()
subscription_id = subscription.subscription_id
    compute_client = ComputeManagementClient(
            credential,
            subscription_id=subscription_id,
            api_version=compute_api_version
        )
        sub_vms = compute_client.virtual_machines.list_all()
        for vm in sub_vms:
            vm_id = vm.vm_id

Expected behavior ComputeManagementClient.virtual_machines.list_all() should paginate successfully and return all resources.

Screenshots If applicable, add screenshots to help explain your problem. Python 3.8and API version v2022-03-01

File "/tmp/tmpwe4ln3d0/my_script.py", line 164, in my_method
    for vm in sub_vms:
  File "/tmp/tmpwe4ln3d0/venv/lib/python3.8/site-packages/azure/core/paging.py", line 128, in __next__
    return next(self._page_iterator)
  File "/tmp/tmpwe4ln3d0/venv/lib/python3.8/site-packages/azure/core/paging.py", line 76, in __next__
    self._response = self._get_next(self.continuation_token)
  File "/tmp/tmpwe4ln3d0/venv/lib/python3.8/site-packages/azure/mgmt/compute/v2022_03_01/operations/_virtual_machines_operations.py", line 2263, in get_next
    raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (InvalidContinuationToken) Invalid continuation token in the request uri. Continuation token - 'continuation_token'

Python 3.9 and API version v2022-08-01

File "/Users/hussambteibet/PycharmProjects/zray_modules/modules/cloud_asset_inventory/azure_inventory.py", line 164, in get_subscription_data
    for vm in sub_vms:
  File "/Users/hussambteibet/PycharmProjects/zray_modules/venv/lib/python3.9/site-packages/azure/core/paging.py", line 128, in __next__
    return next(self._page_iterator)
  File "/Users/hussambteibet/PycharmProjects/zray_modules/venv/lib/python3.9/site-packages/azure/core/paging.py", line 76, in __next__
    self._response = self._get_next(self.continuation_token)
  File "/Users/hussambteibet/PycharmProjects/zray_modules/venv/lib/python3.9/site-packages/azure/mgmt/compute/v2022_08_01/operations/_virtual_machines_operations.py", line 2263, in get_next
    raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: (InvalidContinuationToken) Invalid continuation token in the request uri. Continuation token - 'continuation_token'.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
hussam-Taniumcommented, Oct 13, 2022

Hello @msyyc I have confirmed that the package is working properly.

1reaction
hussam-Taniumcommented, Oct 12, 2022

@msyyc I have also sent you an email with the next_link value

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Continuation token CosmosDB - Stack Overflow
I am running an Azure Function which queries an instance of a CosmosDB. I am trying to implement pagination with the Continuation Token, ......
Read more >
Pagination with the Azure SDK for .NET - Microsoft Learn
Learn how to use pagination with the Azure SDK for .NET. ... Name}"); } // The continuation token that can be used in...
Read more >
Unable to use continuation token for listing user entitlements
in a license management solution. This by default returns 100 users, and a value for $top can be provided. But there seems to...
Read more >
azure.mgmt.compute.v2019_03_01.operations ... - NET
Source code for azure.mgmt.compute.v2019_03_01.operations. ... that will be passed the direct response :keyword str continuation_token: A continuation token ...
Read more >
Paging through table data | BigQuery - Google Cloud
Shows how to page through the table data and query results using the BigQuery REST API with examples in C#, Java, Go, Python,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found