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

Jenkins agents can't make git pull if bitbucket password contains skandinavian characters

    Details

    • Similar Issues:

      Description

      Jenkins ver. 2.126

      When following kind of password was configured to Bitbucket (Crowd):  Kesäalkoi123%

      Jenkins agents can't make git clone etc:

       

       

      Started by user XXXXXXXStarted by user XXXXXXXBuilding remotely on Windows_10 in workspace C:\Jenkins\workspace\xxxxxx > C:\Program Files\Git\mingw64\bin\git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > C:\Program Files\Git\mingw64\bin\git config remote.origin.url https://testi.me.fi/stash/scm/ot/xxxxxx.git # timeout=10Fetching upstream changes from https://testi.me.fi/stash/scm/ot/xxxxxx.git > C:\Program Files\Git\mingw64\bin\git --version # timeout=10using GIT_ASKPASS to set credentials  > C:\Program Files\Git\mingw64\bin\git fetch --tags --progress https://testi.me.fi/stash/scm/ot/xxxxxxn.git +refs/heads/:refs/remotes/origin/*ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException: Failed to fetch from https://testi.me.fi/stash/scm/ot/xxxxxx.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1208) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1794) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\mingw64\bin\git fetch --tags --progress https://testi.me.fi/stash/scm/ot/xxxxxxn.git +refs/heads/:refs/remotes/origin/*" returned status code 128:stdout: stderr: error: cannot spawn sh: No such file or directoryerror: cannot spawn sh: No such file or directoryfatal: Authentication failed for 'https://testi.me.fi/stash/scm/ot/xxxxxx.git/'

       

      And everything works fine if agents are not used  (Jenkins build is run locally on master)..

       

       

       

       

       

       

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          If you're running Jenkins 2.126 (a weekly version from two years ago), then you may also be running an outdated version of the git client plugin and git plugin. Git client plugin 3.0 and git plugin 4.0 include fixes for authentication that may resolve this issue as well. Those git plugin versions require a newer Jenkins versions than 2.126.

          If you're running a newer version of Jenkins and made a typo when entering the Jenkins version, please list the version.

          Please also provide the version of the git plugin and git client plugin that you are running.

          You may also need to correct the PATH to command line git. The git plugin is tested with command line git 2.27.0 installed as bin/git.exe as in C:\Users\MarkE\tools\git-2.27.0\bin\git.exe. I don't test with mingw64\bin\git.exe as the command line git executable. It may work, but it is not an installation that I test.

          Show
          markewaite Mark Waite added a comment - - edited If you're running Jenkins 2.126 (a weekly version from two years ago), then you may also be running an outdated version of the git client plugin and git plugin. Git client plugin 3.0 and git plugin 4.0 include fixes for authentication that may resolve this issue as well. Those git plugin versions require a newer Jenkins versions than 2.126. If you're running a newer version of Jenkins and made a typo when entering the Jenkins version, please list the version. Please also provide the version of the git plugin and git client plugin that you are running. You may also need to correct the PATH to command line git. The git plugin is tested with command line git 2.27.0 installed as bin/git.exe as in C:\Users\MarkE\tools\git-2.27.0\bin\git.exe . I don't test with mingw64\bin\git.exe as the command line git executable. It may work, but it is not an installation that I test.
          Hide
          pete123 Petri Panula added a comment -

          I will update the Jenkins when possible. It's running so many important jobs that downtime needs to scheduled and new version to be tested first etc... I'll come back to this later..

          Show
          pete123 Petri Panula added a comment - I will update the Jenkins when possible. It's running so many important jobs that downtime needs to scheduled and new version to be tested first etc... I'll come back to this later..
          Hide
          markewaite Mark Waite added a comment - - edited

          You could create a small test Jenkins instance on a disposable environment within your organization that would not disrupt production and would allow you to decide if the problem will be resolved in a future upgrade of the production instance.

          If you have Docker installed on a computer, then you can start a disposable instance Jenkins 2.235, the base version for the next long term support release, with the command:

          docker run -p 8080:8080 jenkins/jenkins:2.235-slim

          Install suggested plugins will download and install the most recent release of the git plugin. Then you can create a test job to see if the problem is already resolved in the latest version.

          If you're not allowed to run Docker, then you can download the jenkins.war file and run it through the same steps.

          Show
          markewaite Mark Waite added a comment - - edited You could create a small test Jenkins instance on a disposable environment within your organization that would not disrupt production and would allow you to decide if the problem will be resolved in a future upgrade of the production instance. If you have Docker installed on a computer, then you can start a disposable instance Jenkins 2.235, the base version for the next long term support release, with the command: docker run -p 8080:8080 jenkins/jenkins:2.235-slim Install suggested plugins will download and install the most recent release of the git plugin. Then you can create a test job to see if the problem is already resolved in the latest version. If you're not allowed to run Docker, then you can download the jenkins.war file and run it through the same steps.
          Hide
          jvz Matt Sicker added a comment -

          I'd also recommend against using username/passwords for git checkouts in the first place. You should create personal access tokens for that. It comes in handy if you ever want to enable two-factor authentication on your BitBucket account (same applies to GitHub and GitLab).

          Show
          jvz Matt Sicker added a comment - I'd also recommend against using username/passwords for git checkouts in the first place. You should create personal access tokens for that. It comes in handy if you ever want to enable two-factor authentication on your BitBucket account (same applies to GitHub and GitLab).

            People

            • Assignee:
              Unassigned
              Reporter:
              pete123 Petri Panula
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: