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

git-plugin tests or GitSampleRepoRule use fail when gpgsignin activated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None

      if git global config gpg-sign activated e.g git config --global commit.gpgsign true.

      unit test of git-plugin fail 

      cli 

      Caused by: hudson.plugins.git.GitException: Command "git commit -F /Volumes/workspace/dev/sources/jenkins/git-plugin/target/tmp/junit11293633318696642182/junit5698144647230035770@tmp/jenkins-gitclient-gitcommit4252944134817268881.txt" returned status code 128:stdout: stderr: error: gpg failed to sign the datafatal: failed to write commit object
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)}}{{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2601)}}

      jgit

      {}Caused by: org.eclipse.jgit.api.errors.ServiceUnavailableException: Signing service is not available{{ at org.eclipse.jgit.api.CommitCommand.sign(CommitCommand.java:290)}}{{ at org.eclipse.jgit.api.CommitCommand.call(CommitCommand.java:247)}}

      same when using GitSampleRepoRule

      {}Initialized empty Git repository in /Volumes/workspace/dev/sources/jenkins/cloudbees-analytics-plugin/plugin/target/tmp/junit3925781698945114105/junit839357165607123398/.git/[junit839357165607123398] $ git add file[junit839357165607123398] $ git config user.name "Git SampleRepoRule"[junit839357165607123398] $ git config user.email gits@mplereporule[junit839357165607123398] $ git commit --message=initerror: gpg failed to sign the datafatal: failed to write commit object   1.341 [id=802] INFO hudson.lifecycle.Lifecycle#onStatusUpdate: Stopping Jenkins   1.511 [id=802] INFO hudson.lifecycle.Lifecycle#onStatusUpdate: Jenkins stopped

       

      there are different options to use:

      • cli env var GIT_CONFIG_NOSYSTEM
      • jgit SystemReader.getInstance().getUserConfig().clear();

            olamy Olivier Lamy
            olamy Olivier Lamy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: