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.

Too many requests to Bitbucket, scans are really slow (JENKINS-55071)

See original GitHub issue

Your checklist for this issue

  • Jenkins version

  • Plugin version

  • Bitbucket cloud

  • Bitbucket server and version

Description

Hello, first thanks for this plugin 😃

We have a Jenkins that scans periodically (every minute) some repositories (5 repositories) on Bitbucket cloud using a technical account that have read access on these repositories. All the repositories are part of a single team. The jobs are multibranch pipelines.

We saw that after some minutes, the scans start to become very slow as described at https://issues.jenkins-ci.org/browse/JENKINS-55071. In our case, 2mn to scan a repository of 2 branches and a size of 249.7 KB.

After checking the logs (see attached files), looks like Bitbucket is throttling the requests which makes me think that Jenkins or the plugin is making too many requests because the limits of Bitbucket API is very high: 60000 requests per hour (https://confluence.atlassian.com/bitbucket/rate-limits-668173227.html). Is it possible to log the requests made to Bitbucket ? I only get logs about the API rate limit ?

And also, the cache works for the team repositories list when creating a new multibranch Pipeline.

Jenkins: 2.172 Plugin version: 2.4.4

screencapture-jenkins-emp-istefr-fr-log-BitbucketPlugin-2019-04-17-10_55_09 log_config

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:24 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lifeofguentercommented, Jan 15, 2022

I am going to close this for now. I don’t think this is something this plugin can fix. Scanning is a very expensive process - irrespectively when using Bitbucket Cloud or even Bitbucket Server. It just does not scale by design - no matter how we would try to mitigate the issue.

I would recommend building either a proxy or allowing specific webhook endpoints from Bitbucket server IPs (https://support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/#Outgoing-Connections).

1reaction
MateusVMachadocommented, Apr 14, 2021

Hi, I’m having this problem too, but it started a few days ago and there was no change in Jenkins, nor the addition of new branchs. I contacted Atlassian and they sent me a file with all the called endpoints in the last 3 days. The result is strange, it shows that a commit endpoint has been called more than 2k times.

image

After restarting Jenkins, I realized that the problem stopped, and Atlassian support confirmed this. But after a few hours the problem returned.

Is there a log that can be activated to track these requests? We are unable to work due to this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Slow branch scan when using Bitbucket source - Jenkins Jira
Branch scan is very slow when using Bitbucket source in multibranch pipeline jobs. For example: repo with ~20 branches, when using Git ...
Read more >
Why is BitBucket slow? - Atlassian Community
Hello, I love BitBucket and I'm using it for many repos but page opening or code view are unfortunately loading slowly. I don't...
Read more >
Bitbucket Server integration - SonarQube Documentation
SonarQube's integration with Bitbucket Server allows you to maintain code quality and security in your Bitbucket Server repositories.
Read more >
Encountering some turbulence on Bitbucket's journey to a new ...
Rendering pull request diffs is currently slower and sometimes timing out. We are actively working on fixing this and expect the issue to...
Read more >
Bitbucket vs GitHub (Updated for 2022) - UpGuard
Bitbucket and Github are two of the largest web-based hosting services for source code and development projects.
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