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

Credentials dropdown empty on git scm with specific authorize project settings

      Since recently (might be through the 2.7.3 to 2.7.4 upgrade) I am unable to select any credentials with the git settings directly in the job configuration.

      Even if I add credentials, it does not show in the list.

      Any advices?

      $ java -version
      java version "1.8.0_102"
      Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
      
      $ git --version
      git version 1.9.1
      
      Ubuntu 14.04 LTS latest apt update && apt upgrade
      

      Meanwhile switched the system, but same problem:

      $ java -version
      java version "1.8.0_112"
      Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
      
      $ git --version
      git version 2.1.4
      
      Debian 8 latest apt update && apt upgrade
      

          [JENKINS-38126] Credentials dropdown empty on git scm with specific authorize project settings

          Jamie Kelly added a comment -

          Cheers gents, reproducible on my setup too.

          Jamie Kelly added a comment - Cheers gents, reproducible on my setup too.

          we also ran into this problem and it was difficult to trace.

          Will the git plugin be fixed ?

          Bernhard Merkle added a comment - we also ran into this problem and it was difficult to trace. Will the git plugin be fixed ?

          Mark Waite added a comment -

          bernhard_merkle you may want to check git plugin 3.6.2 which was just recently released. stephenconnolly I believe that detected a case related to the authorize project plugin and included that in one of his changes.

          stephenconnolly has noted that the git plugin needs to change to use a newer credentials API as the best solution. It definitely has not made that change yet.

          Mark Waite added a comment - bernhard_merkle you may want to check git plugin 3.6.2 which was just recently released. stephenconnolly I believe that detected a case related to the authorize project plugin and included that in one of his changes. stephenconnolly has noted that the git plugin needs to change to use a newer credentials API as the best solution. It definitely has not made that change yet.

          thanks markewaite for the fast feedback.

          We have git plugin 3.6.2 installed and the problem is still there, so the fix of stephenconnolly seems not to fix the bug.

          the bug behavior is described exactly as in the comment above (authorize plugin and git plugin coexisting)

          Bernhard Merkle added a comment - thanks  markewaite  for the fast feedback. We have git plugin 3.6.2 installed and the problem is still there, so the fix of  stephenconnolly  seems not to fix the bug. the bug behavior is described exactly as in the comment above (authorize plugin and git plugin coexisting)

          Bernhard Merkle added a comment - https://issues.jenkins-ci.org/browse/JENKINS-38126?focusedCommentId=289182&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-289182

          This issue is still relevant with Jenkins ver. 2.176.2, git plugin 3.0.0-rc and Authorize Project 1.3.0

          It has been almost 3 years since this was reported and there is nothing more than a workaround? Is there an alternative to the Authorize Project Plugin?

           

          Matthias Flock added a comment - This issue is still relevant with Jenkins ver. 2.176.2, git plugin 3.0.0-rc and Authorize Project 1.3.0 It has been almost 3 years since this was reported and there is nothing more than a workaround? Is there an alternative to the Authorize Project Plugin?  

          René Scheibe added a comment -

          As the usage of the "Authorize Project" plugin is now recommended on the "Manage Jenkins" page, I think many more users will hit this issue.

          René Scheibe added a comment - As the usage of the "Authorize Project" plugin is now recommended on the "Manage Jenkins" page, I think many more users will hit this issue.

          René Scheibe added a comment - - edited

          I can reproduce this issue with Jenkins 2.176.2, git-plugin 3.11.0, authorize-project-plugin 1.3.0, credentials-plugin 2.2.1.

          I also checked with other SCM plugins. The credentials drop-down is correctly filled for subversion-plugin 2.12.2 and mercurial-plugin 2.8.

          René Scheibe added a comment - - edited I can reproduce this issue with Jenkins 2.176.2, git-plugin 3.11.0, authorize-project-plugin 1.3.0, credentials-plugin 2.2.1. I also checked with other SCM plugins. The credentials drop-down is correctly filled for subversion-plugin 2.12.2 and mercurial-plugin 2.8.

          ikedam added a comment -

          I tested the behavior of the combination of git-plugin, credentials-plugin and authorize-project-plugin and I believe this issue is caused for following three issues:

          There're three underlying issues causing this issue:

          1. Why this happens only for "Run as specific user" , not for other strategies like "Run as User who Triggered"?:
            • Because credentials in configuration pages are not for the user of builds, but for the user of the job. Jenkins can say that the user of the job is "user1" when you are using "Run as specific user" with "user1" though Jenkins cannot decide the user of the job when you are using "Run as User who Triggered" as the user can be decided only after a build is actually triggered by someone. So "Run as User who Triggered" results configuration pages behave just as when no authorization strategy is set. And this issue is specific to "Run as specific user".
          2. What is credentials for specific users?
            • You can configure user-scoped credentials in the user page, which can open from the link over the user name in the right-up part of Jenkins web UI.
            • I suppose many users configures only system-scoped credentials and this results "no credentials are shown".
          3. Why system global credentials are not displayed in the job configuration pages even when the user has Credentials/View permissions?
            • It might be a bug of credentials plugin (I'm not so sure as I don't know much about the design of credentials-plugin). I created JENKINS-58902 and please watch that ticket.

          The first and second ones can be resolved as "Not A Defect", as they are designated behavior.
          For the third one, I created JENKINS-58902. I believe this issue (JENKINS-38126) can be resolved as Duplicate, and please watch that ticket instead.

          Those causes are really complicated and I'm afraid they are beyond my English and difficult to read. I expect someone improve the explanation.
          And this ticket lasted for so long time and I might fail to get exactly what happened. Please add a comment or reopen the ticket if you have something that looks not resolved.

          ikedam added a comment - I tested the behavior of the combination of git-plugin, credentials-plugin and authorize-project-plugin and I believe this issue is caused for following three issues: There're three underlying issues causing this issue: Why this happens only for "Run as specific user" , not for other strategies like "Run as User who Triggered"?: Because credentials in configuration pages are not for the user of builds, but for the user of the job. Jenkins can say that the user of the job is "user1" when you are using "Run as specific user" with "user1" though Jenkins cannot decide the user of the job when you are using "Run as User who Triggered" as the user can be decided only after a build is actually triggered by someone. So "Run as User who Triggered" results configuration pages behave just as when no authorization strategy is set. And this issue is specific to "Run as specific user". What is credentials for specific users? You can configure user-scoped credentials in the user page, which can open from the link over the user name in the right-up part of Jenkins web UI. I suppose many users configures only system-scoped credentials and this results "no credentials are shown". Why system global credentials are not displayed in the job configuration pages even when the user has Credentials/View permissions? It might be a bug of credentials plugin (I'm not so sure as I don't know much about the design of credentials-plugin). I created JENKINS-58902 and please watch that ticket. The first and second ones can be resolved as "Not A Defect", as they are designated behavior. For the third one, I created JENKINS-58902 . I believe this issue ( JENKINS-38126 ) can be resolved as Duplicate, and please watch that ticket instead. Those causes are really complicated and I'm afraid they are beyond my English and difficult to read. I expect someone improve the explanation. And this ticket lasted for so long time and I might fail to get exactly what happened. Please add a comment or reopen the ticket if you have something that looks not resolved.

          Mark Waite added a comment -

          Following recommendation from ikedam and closing this duplicate

          Mark Waite added a comment - Following recommendation from ikedam and closing this duplicate

            lifeofguenter Günter Grodotzki
            lifeofguenter Günter Grodotzki
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: