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

Pagination of Availability Statuses does not work #23148

Closed
jkroepke opened this issue Jul 3, 2024 · 5 comments
Closed

Pagination of Availability Statuses does not work #23148

jkroepke opened this issue Jul 3, 2024 · 5 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Resource Health Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@jkroepke
Copy link

jkroepke commented Jul 3, 2024

Bug Report

  • import path of package in question, e.g. github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth
  • SDK version e.g. 1.3.0,1.4.0-beta.2,
    • Specify the exact commit if possible; one way to get this is the REVISION
      column output by go list -m <module>, for example go list -m github.com/Azure/azure-sdk-for-go/sdk/azcore.
  • output of go version go version go1.22.4 darwin/arm64
  • What happened? Pagination of Availability Statuses returns into 400 Bad Request
  • What did you expect or want to happen? Pagination works
  • How can we reproduce it?
package main

import (
	"context"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resourcehealth/armresourcehealth"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		panic(err)
	}

	client, err := armresourcehealth.NewAvailabilityStatusesClient("...", cred, nil)
	if err != nil {
		panic(err)
	}

	pager := client.NewListBySubscriptionIDPager(nil)

	for pager.More() {
		_, err := pager.NextPage(context.Background())
		if err != nil {
			panic(err)
		}
	}
}
  • Anything we should know about your environment.
    I error appears only, if the Rest API has multiple pages

I can observe that the first response contains a nextLink property. Following the nextLink property return into a Bad Request 400: {"message":"Query option 'SkipToken' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.","code":"InvalidODataQueryOptions"}

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 3, 2024
@jhendrixMSFT jhendrixMSFT added Resource Health Mgmt This issue is related to a management-plane library. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jul 15, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Jul 15, 2024
@Alancere
Copy link
Contributor

Alancere commented Jul 19, 2024

reproduce, I can successfully return the result.
image

It seems that when there are multiple pages, skiptoken will be added to the path(debug: AZURE_SDK_GO_LOGGING=all)
image

@Alancere Alancere added the Service Attention Workflow: This issue is responsible by Azure service team. label Jul 19, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @stephbaron.

@jkroepke
Copy link
Author

@Alancere did you run the code without stopping in the first loop?

The first fetch works fine, following the next link return an error

@Alancere
Copy link
Contributor

Alancere commented Jul 19, 2024

@Alancere did you run the code without stopping in the first loop?

The first fetch works fine, following the next link return an error

The first time it stopped, the first time it was normal, the second time the nextLink url was added with skiptoken. But I can execute it normally

@jkroepke
Copy link
Author

it seems fixed by upstream

@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Resource Health Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants