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

Git2 plugin and HTTP-authentication fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      In this case: Jenkins 1.536 (Jenkins version doesn't really matter :) running on Linux(CentOS6.4) respectively MacOSX(Mavericks)
      Plugins: git v 2.0, git-client 1.4.6
    • Similar Issues:

      Description

      When using the git plugin 2.0 and git-client plugin 1.4.6 the connection to a remote git repository via https fails.
      Using a connection URL like https://<user>:<password>@<URL> I receive a "failed to connect" where the connection URL was reduced to https://<user>@<URL> - where of course was clear why it failed: The password wasn't submitted !?

      Reverting to versions 1.5.0 (git) respectively 1.0.7 (git-client) and a Jenkins restart solved it. Keeping one of both plugins on the newer version and only downgrading the other produced another symptom: The GIT was no longer available for configuration in Jenkins. So there's a dependency between both plugins.

      The "million-dollar-question" is: Is this a bug in those plugins? Or or do they simply need to be handled/configured differently. I didn't find any hint on this so far ..

        Attachments

          Activity

          Hide
          jklasen Juergen Klasen added a comment - - edited

          When running Jenkins as a service, using a dedicated user account here for is a must!!!

          Under Linux you don't want to run your service as root user. Similar you don't want to run the Jenkins service on Windows under the 'System Account'.

          And: YES, the pre-install script of that Linux rpm package does create the corresponding group and account named 'jenkins' for you. As well it registers Jenkins as service.

          For the Windows installation package I'm not sure. If I recall correctly there have been packages out which registered the service to run under the 'System Account' - which may no longer be true ...
          We ugraded the up'n running Windows Jenkins environments only with replacing the jenkins.war.

          But it's easy to check, under which account the Jenkins service is running under Windows (look into the Task manager )

          I have no update on the situation of git, git-client and credential-helper plugins on Windows though ... :|

          Show
          jklasen Juergen Klasen added a comment - - edited When running Jenkins as a service, using a dedicated user account here for is a must!!! Under Linux you don't want to run your service as root user. Similar you don't want to run the Jenkins service on Windows under the 'System Account'. And: YES, the pre-install script of that Linux rpm package does create the corresponding group and account named 'jenkins' for you. As well it registers Jenkins as service. For the Windows installation package I'm not sure. If I recall correctly there have been packages out which registered the service to run under the 'System Account' - which may no longer be true ... We ugraded the up'n running Windows Jenkins environments only with replacing the jenkins.war. But it's easy to check, under which account the Jenkins service is running under Windows (look into the Task manager ) I have no update on the situation of git, git-client and credential-helper plugins on Windows though ... :|
          Hide
          alp_shah Alpesh Shah added a comment -

          Hello,

          I did same as suggested by Artem Belov above. i.e. roll back to git 1.5 (from 2.0.3) and git-client 1.0.7 (from 1.6.3) and it worked find. Note that I tried git-client 1.4.6 first so that I can use credential option but it didn't work. So I think correct combination of these 2 plugins are important. (I plan to try git-client 1.2.0 which has credential support to avoid passing username password in url)

          Show
          alp_shah Alpesh Shah added a comment - Hello, I did same as suggested by Artem Belov above. i.e. roll back to git 1.5 (from 2.0.3) and git-client 1.0.7 (from 1.6.3) and it worked find. Note that I tried git-client 1.4.6 first so that I can use credential option but it didn't work. So I think correct combination of these 2 plugins are important. (I plan to try git-client 1.2.0 which has credential support to avoid passing username password in url)
          Hide
          markewaite Mark Waite added a comment -

          I am able to read and write a public bitbucket.org repository through https by embedding the user name and password into the URL, as in https://markewaite:mypassword@bitbucket.org/markewaite/git-client-plugin.git.

          I'm able to read and write a public bitbucket.org repository through https using a username / password credential through Jenkins credentials.

          I am not able to read or write a private bitbucket.org repository through https with the embedded user name and password in the URL or using the username / password credential through Jenkins credentials.

          Those results were checked with git plugin 2.2.5 and git client plugin 1.10.1.

          Show
          markewaite Mark Waite added a comment - I am able to read and write a public bitbucket.org repository through https by embedding the user name and password into the URL, as in https://markewaite:mypassword@bitbucket.org/markewaite/git-client-plugin.git . I'm able to read and write a public bitbucket.org repository through https using a username / password credential through Jenkins credentials. I am not able to read or write a private bitbucket.org repository through https with the embedded user name and password in the URL or using the username / password credential through Jenkins credentials. Those results were checked with git plugin 2.2.5 and git client plugin 1.10.1.
          Hide
          markewaite Mark Waite added a comment -

          The call to checkCredentials() has been removed in git-client-plugin from 1.13.1 and beyond. Would you be willing to test a pre-release of git-client-plugin 1.13.1 for this case?

          Show
          markewaite Mark Waite added a comment - The call to checkCredentials() has been removed in git-client-plugin from 1.13.1 and beyond. Would you be willing to test a pre-release of git-client-plugin 1.13.1 for this case?
          Hide
          markewaite Mark Waite added a comment -

          Call to checkCredentials removed in git-client-plugin 1.14.0, released 25 Dec 2014.

          Show
          markewaite Mark Waite added a comment - Call to checkCredentials removed in git-client-plugin 1.14.0, released 25 Dec 2014.

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              jklasen Juergen Klasen
            • Votes:
              11 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: