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

Branches auto-discovering not working on Bitbucket server #799

Open
maannima opened this issue Jan 17, 2024 · 2 comments
Open

Branches auto-discovering not working on Bitbucket server #799

maannima opened this issue Jan 17, 2024 · 2 comments
Labels

Comments

@maannima
Copy link

Jenkins and plugins versions report

Environment
Bitbucket Server v8.9.6
Jenkins 2.426.2
OS: Linux - 4.18.0-372.80.1.el8_6.x86_64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
Bitbucket Branch Source Plugin 856.v04c46c86f911
Pipeline: Multibranch 756.v891d88f2cd46

What Operating System are you using (both controller, and any agents involved in the problem)?

Bitbucket Server v8.9.6
Jenkins 2.426.2
OS: Linux - 4.18.0-372.80.1.el8_6.x86_64
Java: 17.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
Bitbucket Branch Source Plugin 856.v04c46c86f911
Pipeline: Multibranch 756.v891d88f2cd46

Reproduction steps

Setup a multi-branch project with a Single repository source

Get credentials to access the Bitbucket API

Create a Bitbucket HTTP access tokens (project admin)

image

Bitbucket Endpoints configuration in Jenkins > Manage Jenkins

Added Jenkins Credentials:

  • Scope: Global Credentials
  • Copy paste the HTTP access token, starting with BBDC-
  • Kind: Username with password
  • Username: Bitbucket project key (INFSCR)
  • Id blank (so auto-generated)
  • Description: Name of Http access key

image

Configure the multi-branch project source

  • Selected the correct Bitbucket URL
  • Used the Bitbucket project key for Owner

image

Expected Results

Expected was a working integration between Jenkins and Bitbucket server. But the Repository Name in Branch Sources can't be filled in and doesn't show a drop down.

Actual Results

Repository Name in Branch Sources can't be filled in and doesn't show a drop down.
image

Anything else?

As a result the Scan Multibranch Pipeline Logs show the following

[Wed Jan 17 13:54:57 UTC 2024] Starting branch indexing... ERROR: [Wed Jan 17 13:54:57 UTC 2024] Could not update folder level actions from source f0326964-f8d1-41b6-9041-46ce232fcc15 [Wed Jan 17 13:54:57 UTC 2024] Finished branch indexing. Indexing took 9 ms FATAL: Failed to recompute children of tests » stack-aws-container-registery-maianni1-test com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: 403: . HttpResponseProxy{HTTP/1.1 403 [Date: Wed, 17 Jan 2024 13:54:57 GMT, Content-Type: application/json;charset=UTF-8, Content-Length: 70, Connection: keep-alive, Set-Cookie: AWSALB=z+cAOlLFOnOuMM++etnNvbLkfogJt4wOp3Tm97i//z27yGJr+O+qiXCSfSXCM5R1TLM7H+Yq+PnGj0+UTeZsn4ovzEcfYktOOMRSbJFalpsFKoQsQ5hFBCturSlE; Expires=Wed, 24 Jan 2024 13:54:57 GMT; Path=/, Set-Cookie: AWSALBCORS=z+cAOlLFOnOuMM++etnNvbLkfogJt4wOp3Tm97i//z27yGJr+O+qiXCSfSXCM5R1TLM7H+Yq+PnGj0+UTeZsn4ovzEcfYktOOMRSbJFalpsFKoQsQ5hFBCturSlE; Expires=Wed, 24 Jan 2024 13:54:57 GMT; Path=/; SameSite=None; Secure, X-AREQUESTID: *VA1LQ8x834x14525318x1] ResponseEntityProxy{[Content-Type: application/json;charset=UTF-8,Content-Length: 70,Chunked: false]}} at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:978) at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRepository(BitbucketServerAPIClient.java:494) at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieveActions(BitbucketSCMSource.java:1107) at jenkins.scm.api.SCMSource.fetchActions(SCMSource.java:847) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:611) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:269) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:167) at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1057) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Finished: FAILURE

Are you interested in contributing a fix?

No response

@maannima maannima added the bug label Jan 17, 2024
@andygoossens
Copy link

andygoossens commented Feb 12, 2024

You claim to be using Bitbucket Server, but I assume that is a mistake on your part. Only Bitbucket Data Center has support for HTTP access tokens on project/repository level:
https://confluence.atlassian.com/bitbucketserver089/http-access-tokens-1236435579.html#HTTPaccesstokens-CreateHTTPaccesstokensforprojectsorrepositories

@maannima
Copy link
Author

The differentiation I'm aware of is between Bitbucket Server and Bitbucket Cloud. Bitbucket Server is a self-hosted solution, often deployed in a Data Center. This is the method I am using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants