Issue with bitbucket cloud and pagination. #321
Unanswered
cooper1101
asked this question in
Support
Replies: 2 comments
-
I tried using node-fetch in one of the functions in
It seems it's something with how the bitbucketclient handles the token when it needs to continue querying next pages. |
Beta Was this translation helpful? Give feedback.
0 replies
-
That's very strange, thanks for looking into this! Seems like a bug within the bitbucket client library we're using here If you could submit a PR that swaps bitbucketclient usage to node-fetch that would be amazing! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am running into an issue when getting repos for a workspace or project in bitbucket cloud. I am using a long-lived access token (tried with app password as well). When trying to get repos for a private workspace, the request fails.
I was able to narrow it down with extra loggers in the code to the following issue. When the initial request happens, it gets the response back with the results, in this case it's the first page, amount of results and pages as well as the next url. But when the request to the next url happens, that's where the request fails. The url in the next request is correct, can confirm with curl with the same access token. Running inside docker container and curl also was done from within the container. Here's a snippet of the extra logs:
[backend] | "pagelen": 10, [backend] | "size": 123, [backend] | "page": 1, [backend] | "next": "https://api.bitbucket.org/2.0/repositories/[redacted]?q=project.key%3D%22[redacted]%22&page=2" [backend] | } [backend] | 2025-05-30T11:21:26.996Z info: [Bitbucket] url is https://api.bitbucket.org/2.0/repositories/[redacted]?q=project.key%3D%22[redacted]%22&page=2 [backend] | 2025-05-30T11:21:27.173Z error: [Bitbucket] Failed to fetch repos for project [redacted]: Error: Failed to fetch projects for workspace [redacted]: { [backend] | "type": "error", [backend] | "error": { [backend] | "message": "Token is invalid, expired, or not supported for this endpoint." [backend] | } [backend] | }
Fetching repos one by one works when specifying the repos individually in the config, but this approach can't be used unfortunately. Any help is appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions