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

Artifactory Release Staging can't push back to git/Stash Repository

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • artifactory-plugin
    • None
    • Jenkins 1.552
      Artifactory plugin for jenkins 2.2.1
      OS: Windows Server 2008 R2

      We are using Atlassian Stash as SCM, jenkins as CI-Server and Artifactory as binary version control.

      I have a job setup to pull from stash (with private/public ssh key pair), build and publish to artifactory.
      This build runs smoothly.
      But when i try to stage a release build with the artifactory plugin form within the jenkins job, i get the following errors at the end of the build:

      [RELEASE] Committing release version on branch 'release/project-0.0.2'
      [RELEASE] Creating tag 'project-0.0.2'
      [RELEASE] Pushing branch 'release/project-0.0.2' to 'ssh://git@gitserver:7999/test/project_main.git'
      Failure in post build SCM action: Failed to push: Command "git push ssh://git@gitserver:7999/test/project_main.git refs/heads/release/project-0.0.2" returned status code 128:
      stdout: 
      stderr: Permission denied (publickey).
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      
      ERROR: [RELEASE] Failed on build completion
      java.io.IOException: Failed checkout branch: Command "git checkout develop" returned status code 1:
      stdout: 
      stderr: error: pathspec 'develop' did not match any file(s) known to git.
      
      	at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234)
      	at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199)
      	at hudson.FilePath.act(FilePath.java:914)
      	at hudson.FilePath.act(FilePath.java:887)
      	at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60)
      	at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:137)
      	at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:308)
      	at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:276)
      	at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
      	at hudson.model.Run.execute(Run.java:1720)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      Finished: FAILURE
      

      When i change the authentication with Stash to username and password i get a different error just saying "authentication failed". So the plugin seems to fetch the credentials from the git client plugin. But for some reasing it can't push anyways. The user has the necessary rights inside stash.

      Can anybody point me in the right direction, how to solve this issue or at least, where i could go on searching for the root cause.

      Thanks in advance

            yossis yossis
            timmch Christopher Timm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: