Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69294

Unable to select credentials when configuring pipeline

      New install of Jenkins, installed the current plugin release, configured the Bitbucket Server instance with a new Personal Access Token. Clicked on Test Connection and got a positive response, as expected.

      Go to create a job, configure Pipeline, choose Bitbucket Server as the SCM and no Credentials are listed in the dropdown. No bother I thinks - and click Add to create again. Enter the PAT, give it a description of XYZ123, click Add, popup disappears and there's still no entry in the Credentials dropdown. So I can't continue with pipeline configuration.

      Go back to the main configuration, and the Credentials dropdown now contains an entry for XYZ123, but the one for the pipeline never shows any, no matter what I've tried.

       

      Tried in multiple browsers - no difference. Monitoring with browser dev tools shows a 200 response to the addCredentials POST call. The subsequent call to fillCredentialsIdItems returns with a 200 but has no values in the returned StandardListBoxModel.

          [JENKINS-69294] Unable to select credentials when configuring pipeline

          Hello schurchill
          Thank you for reporting this. I was unable to reproduce this issue. Can you confirm what credential type you're adding? You say "PAT" is that a "Bitbucket personal access token"? If so that one is only available when you configure your Bitbucket instance and is not available at the job level. Instead you need to use either SSH or a normal "Username with password" type. You can still use an access token as the password when using the "Username with password" credential type.

          Daniel Kjellin added a comment - Hello schurchill Thank you for reporting this. I was unable to reproduce this issue. Can you confirm what credential type you're adding? You say "PAT" is that a "Bitbucket personal access token"? If so that one is only available when you configure your Bitbucket instance and is not available at the job level. Instead you need to use either SSH or a normal "Username with password" type. You can still use an access token as the password when using the "Username with password" credential type.

          Stu Churchill added a comment -

          Hi Daniel,

          If so that one [a Bitbucket personal access token] is only available when you configure your Bitbucket instance and is not available at the job level.

          Aha, the confusion has come because the documentation page doesn't mention that a token can't be used at the job level. It just says "Under Source Code Management, select Bitbucket Server and enter the details of the job". Given the Bitbucket personal access token appeared as an option in the Kind selection when then trying to specify credentials, I assumed it was a valid choice. 

          As you say, I got round the problem by just using a regular username/password - it just seems strange that I can't re-use the perfectly valid access token I created earlier.

          Of course, what I'd really prefer to see is a token at the Bitbucket server level, and not one against an individual account. It's two servers that are being integrated here, after all - not people. As it stands, if I left the company and my Bitbucket account was disabled, it'd kill the build pipeline for the whole team.

           

          Cheers, Stu 

          Stu Churchill added a comment - Hi Daniel, If so that one [a Bitbucket personal access token] is only available when you configure your Bitbucket instance and is not available at the job level. Aha, the confusion has come because the documentation page doesn't mention that a token can't be used at the job level. It just says "Under Source Code Management, select Bitbucket Server and enter the details of the job" . Given the Bitbucket personal access token appeared as an option in the Kind selection when then trying to specify credentials, I assumed it was a valid choice.  As you say, I got round the problem by just using a regular username/password - it just seems strange that I can't re-use the perfectly valid access token I created earlier. Of course, what I'd really prefer to see is a token at the Bitbucket server level, and not one against an individual account. It's two servers that are being integrated here, after all - not people. As it stands, if I left the company and my Bitbucket account was disabled, it'd kill the build pipeline for the whole team.   Cheers, Stu 

          Hi Stu,
          Yes, I'll see if we can update the documentation to be a little bit clearer.

          Of course, what I'd really prefer to see is a token at the Bitbucket server level, and not one against an individual account. It's two servers that are being integrated here, after all - not people. As it stands, if I left the company and my Bitbucket account was disabled, it'd kill the build pipeline for the whole team.

          You are right, we are well aware of this, fixing is non-trivial but we have discussed a few different options, so we are aware of the limitations of using the access tokens as the server level credential.

          I will close this issue now as it seems you got things working. Thank you for taking the time to get back to me.

          Daniel Kjellin added a comment - Hi Stu, Yes, I'll see if we can update the documentation to be a little bit clearer. Of course, what I'd really prefer to see is a token at the Bitbucket server level, and not one against an individual account. It's two servers that are being integrated here, after all - not people. As it stands, if I left the company and my Bitbucket account was disabled, it'd kill the build pipeline for the whole team. You are right, we are well aware of this, fixing is non-trivial but we have discussed a few different options, so we are aware of the limitations of using the access tokens as the server level credential. I will close this issue now as it seems you got things working. Thank you for taking the time to get back to me.

            Unassigned Unassigned
            schurchill Stu Churchill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: