jenkinsci / bitbucket-branch-source-plugin

Bitbucket Branch Source Plugin
https://plugins.jenkins.io/cloudbees-bitbucket-branch-source
MIT License
216 stars 351 forks source link

Unable to add Bitbucket cloud repository #697

Closed rgaduput closed 1 year ago

rgaduput commented 1 year ago

Jenkins and plugins versions report

Environment ```text Jenkins: 2.332.3 OS: Linux - 3.10.0-862.14.4.el7.x86_64 Java: 11.0.15 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) --- Office-365-Connector:4.17.0 Parameterized-Remote-Trigger:3.1.5.1 ace-editor:1.1 allure-jenkins-plugin:2.30.3 analysis-model-api:10.10.1 ansible:1.1 ansicolor:1.0.1 ant:475.vf34069fef73c antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-1.0 aqua-security-scanner:3.2.1 artifactory:3.16.2 atlassian-bitbucket-server-integration:3.2.1 authentication-tokens:1.4 autocancel:1.0.5 aws-credentials:191.vcb_f183ce58b_9 aws-global-configuration:100.v4619b_45d2dfc aws-java-sdk:1.12.287-357.vf82d85a_6eefd aws-java-sdk-cloudformation:1.12.287-357.vf82d85a_6eefd aws-java-sdk-codebuild:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ec2:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ecr:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ecs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-efs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-elasticbeanstalk:1.12.287-357.vf82d85a_6eefd aws-java-sdk-iam:1.12.287-357.vf82d85a_6eefd aws-java-sdk-logs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-minimal:1.12.287-357.vf82d85a_6eefd aws-java-sdk-sns:1.12.287-357.vf82d85a_6eefd aws-java-sdk-sqs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ssm:1.12.287-357.vf82d85a_6eefd aws-parameter-store:1.2.2 azure-commons:1.1.3 azure-credentials:216.ve0b_4a_485ffc2 azure-sdk:118.v43f74dd9ca_dc bitbucket:223.vd12f2bca5430 bitbucket-build-status-notifier:1.4.2 blueocean:1.25.5 blueocean-autofavorite:1.2.5 blueocean-bitbucket-pipeline:1.25.5 blueocean-commons:1.25.5 blueocean-config:1.25.5 blueocean-core-js:1.25.5 blueocean-dashboard:1.25.5 blueocean-display-url:2.4.1 blueocean-events:1.25.5 blueocean-git-pipeline:1.25.5 blueocean-github-pipeline:1.25.5 blueocean-i18n:1.25.5 blueocean-jira:1.25.5 blueocean-jwt:1.25.5 blueocean-personalization:1.25.5 blueocean-pipeline-api-impl:1.25.5 blueocean-pipeline-editor:1.25.5 blueocean-pipeline-scm-api:1.25.5 blueocean-rest:1.25.5 blueocean-rest-impl:1.25.5 blueocean-web:1.25.5 bootstrap4-api:4.6.0-5 bootstrap5-api:5.2.0-1 bootstraped-multi-test-results-report:2.2.1 bouncycastle-api:2.26 branch-api:2.1046.v0ca_37783ecc5 build-monitor-plugin:1.13+build.202205140447 build-pipeline-plugin:1.5.8 build-timeout:1.20 build-user-vars-plugin:1.8 built-on-column:1.1 caffeine-api:2.9.3-65.v6a_47d0f4d1fe checks-api:1.7.4 cloud-stats:0.27 cloudbees-bitbucket-branch-source:773.v4b_9b_005b_562b_ cloudbees-disk-usage-simple:0.10 cloudbees-folder:6.722.v8165b_a_cf25e9 clover:4.13.0 cobertura:1.17 code-coverage-api:2.0.4 command-launcher:84.v4a_97f2027398 compress-buildlog:1.2 computer-queue-plugin:1.7 conditional-buildstep:1.4.2 config-file-provider:3.10.0 configuration-as-code:1429.v09b_044a_c93de configuration-as-code-secret-ssm:1.0.1 copyartifact:1.46.4 credentials:1087.1089.v2f1b_9a_b_040e4 credentials-binding:523.vd859a_4b_122e6 custom-checkbox-parameter:1.4 custom-tools-plugin:0.8 data-tables-api:1.11.4-4 delivery-pipeline-plugin:1.4.2 display-url-api:2.3.6 docker-commons:1.19 docker-compose-build-step:1.0 docker-workflow:1.28 durable-task:496.va67c6f9eefa7 ec2:1.68 echarts-api:5.3.2-2 email-ext:2.88 envinject:2.866.v5c0403e3d4df envinject-api:1.199.v3ce31253ed13 extended-choice-parameter:346.vd87693c5a_86c extended-read-permission:3.2 extensible-choice-parameter:1.8.0 external-monitor-job:191.v363d0d1efdf8 external-workspace-manager:1.2.3 favorite:2.4.1 font-awesome-api:6.1.1-1 forensics-api:1.13.0 git:4.11.3 git-client:3.11.0 git-parameter:0.9.16 git-server:1.11 github:1.34.3 github-api:1.303-400.v35c2d8258028 github-branch-source:1637.vd833b_7ca_7654 gradle:1.38 greenballs:1.15.1 h2-api:1.4.199 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953 hashicorp-vault-plugin:336.v182c0fbaaeb7 hidden-parameter:0.0.5 htmlpublisher:1.30 http_request:1.15 image-tag-parameter:1.10 ivy:2.2 jackson2-api:2.13.3-285.vc03c0256d517 javadoc:217.v905b_86277a_2a_ javax-activation-api:1.2.0-3 javax-mail-api:1.6.2-6 jaxb:2.3.6-1 jdk-tool:1.5 jenkins-design-language:1.25.5 jenkins-multijob-plugin:1.36 jira:3.7.1 jira-steps:2.0.141.vd0c6e6dc83f0 jjwt-api:0.11.5-77.v646c772fddb_0 job-dsl:1.79 job-restrictions:0.8 jobConfigHistory:1139.v888b_656ca_f6d jquery:1.12.4-1 jquery-detached:1.2.1 jquery3-api:3.6.0-4 jsch:0.1.55.2 junit:1.63 kubernetes:3580.v78271e5631dc kubernetes-cd:2.3.1 kubernetes-cli:1.10.3 kubernetes-client-api:5.12.2-193.v26a_6078f65a_9 kubernetes-credentials:0.9.0 ldap:2.10 list-git-branches-parameter:0.0.11 lockable-resources:2.15 logfilesizechecker:1.5 logstash:2.4.0 mailer:414.vcc4c33714601 mapdb-api:1.0.9.0 matrix-auth:3.1.2 matrix-project:771.v574584b_39e60 maven-plugin:3.18 mercurial:2.16.2 metrics:4.1.6.2 momentjs:1.1.1 monitoring:1.91.0 multiple-scms:0.8 node-iterator-api:1.5.1 nodejs:1.5.1 nodelabelparameter:1.10.3.1 oidc-provider:47.v182a_02f5b_771 okhttp-api:4.9.3-105.vb96869f8ac3a openJDK-native-plugin:1.5 packer:1.5 pam-auth:1.8 parameterized-scheduler:1.0 parameterized-trigger:2.44 performance:3.20 perfpublisher:8.09 periodicbackup:1.8 permissive-script-security:0.7 pipeline-as-yaml:0.16-rc pipeline-aws:1.43 pipeline-build-step:2.18 pipeline-graph-analysis:195.v5812d95a_a_2f9 pipeline-groovy-lib:612.v84da_9c54906d pipeline-input-step:448.v37cea_9a_10a_70 pipeline-maven:3.10.0 pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:2.2086.v12b_420f036e5 pipeline-model-definition:2.2086.v12b_420f036e5 pipeline-model-extensions:2.2086.v12b_420f036e5 pipeline-rest-api:2.24 pipeline-stage-step:293.v200037eefcd5 pipeline-stage-tags-metadata:2.2086.v12b_420f036e5 pipeline-stage-view:2.24 pipeline-utility-steps:2.12.1 plain-credentials:1.8 plugin-util-api:2.17.0 popper-api:1.16.1-3 popper2-api:2.11.5-2 powershell:1.7 prism-api:1.28.0-2 prometheus:2.0.11 pubsub-light:1.16 rebuild:1.34 resource-disposer:0.19 robot:3.2.0 run-condition:1.5 saferestart:0.3 saml:2.297.v1a_dff8e51f90 schedule-build:280.vc5c0311537f6 scm-api:608.vfa_f971c5a_a_e9 script-security:1175.v4b_d517d6db_f0 simple-theme-plugin:103.va_161d09c38c7 sloccount:1.25 snakeyaml-api:1.30.1 snyk-security-scanner:3.2.6 sonar:2.14 sse-gateway:1.25 ssh:2.6.1 ssh-agent:295.v9ca_a_1c7cc3a_a_ ssh-credentials:277.v95c2fec1c047 ssh-slaves:1.814.vc82988f54b_10 ssh-steps:2.0.39.v831c5e6468b_c sshd:3.237.v883d165a_c1d3 stashNotifier:1.28 statistics-gatherer:2.0.3 strict-crumb-issuer:2.1.0 structs:318.va_f3ccb_729b_71 subversion:2.15.5 swarm:3.32 syslog-logger:1.0.5 terraform:1.0.10 test-results-analyzer:0.3.5 thinBackup:1.10 timestamper:1.17 token-macro:293.v283932a_0a_b_49 trilead-api:1.57.v6e90e07157e1 uno-choice:2.6.1 validating-string-parameter:2.8 variant:1.4 vsphere-cloud:2.27 warnings-ng:9.12.0 windows-slaves:1.8.1 workflow-aggregator:581.v0c46fa_697ffd workflow-api:1164.v760c223ddb_32 workflow-basic-steps:948.v2c72a_091b_b_68 workflow-cps:2725.v7b_c717eb_12ce workflow-cps-global-lib:588.v576c103a_ff86 workflow-durable-task-step:1146.v1a_d2e603f929 workflow-job:1186.v8def1a_5f3944 workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:625.vd896b_f445a_f8 workflow-support:820.vd1a_6cc65ef33 ws-cleanup:0.42 xray-connector:2.6.1 ```

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

Jenkins mater running in a Docker container

Reproduction steps

Global Configuration for Bitbucket Cloud endpoint

  1. Manage Jenkins -> Configure System -> Bitbucket Endpoints -> Add -> Bitbucket Cloud -> Save

Job configuration

  1. New Item -> Enter Name -> Select Multi Branch Pipeline -> OK
  2. Branch Sources -> Bitbucket -> Server -> Select Bitbucket cloud instance -> Credentials -> Select Bitbucket cloud credentials -> Owner -> Paste the Bitbucket workspace ID

Expected Results

After adding the Owner field, in the Repository Name drop down should be able to select the repository from the Bitbucket cloud workspace provided.

Actual Results

When added bitbucket cloud workspace in Owner filed, Repository Name filed throws an error Could not find: <MY_WORKSPACE_ID>

Anything else?

Please note the credentials I have used are the combination of my user name (user@domain.com) and the app password created in Bitbucket cloud. While creating the app password in bitbucket cloud have given Permissions as Projects: read, write, Workspaces membership: read, Repositories: read, write, Pull Requests: read, write. While using same credentials in the Git plugin there are no issues (of course Git plugin uses the full URL). There is nothing in the Jenkins master logs at the same time.

Appreciate if any one can assist what i am missing here ? Does the plugin use Basic Auth with user and app password for authentication or something else like OAuth2?

Thanks.

rgaduput commented 1 year ago

Ok, After removing the @domain.com from user it is working.