[JIRA] (JENKINS-50711) plugin doesn't work with ssh link to git repo

34 views
Skip to first unread message

admin-serg@ukr.net (JIRA)

unread,
Apr 10, 2018, 5:02:02 AM4/10/18
to jenkinsc...@googlegroups.com
Serg Pr created an issue
 
Jenkins / Bug JENKINS-50711
plugin doesn't work with ssh link to git repo
Issue Type: Bug Bug
Assignee: Boguslaw Klimas
Components: git-parameter-plugin
Created: 2018-04-10 09:01
Priority: Critical Critical
Reporter: Serg Pr

I have an error:

"Command "/usr/bin/git ls-remote -h g...@gitlab.site.com:name/project.git" returned status code 128: stdout: stderr: /tmp/ssh5744210594072786682.sh: line 6: ssh: command not found fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

 

As a result, I have a build error: 
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
If I fill the field "Default value" to "master" instead of "**" - I don't have Revision error in build process, but "Git Parameter Plugin's" error above, still exist and I can't choose the branch.

I use:

Git Parameter Plug-In: 0.9.1

Git plugin: 3.8.0

Git client plugin: 2.7.1

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

admin-serg@ukr.net (JIRA)

unread,
Apr 10, 2018, 5:13:01 AM4/10/18
to jenkinsc...@googlegroups.com
Serg Pr updated an issue
Change By: Serg Pr
Attachment: parameter-plugin-bug.txt

klimas7@gmail.com (JIRA)

unread,
Apr 15, 2018, 5:16:02 PM4/15/18
to jenkinsc...@googlegroups.com

klimas7@gmail.com (JIRA)

unread,
Feb 18, 2019, 5:07:04 PM2/18/19
to jenkinsc...@googlegroups.com
Boguslaw Klimas commented on Bug JENKINS-50711
 
Re: plugin doesn't work with ssh link to git repo

Hi,

I can't reproduce this issue, but I found code smells, which can provide to unexpected behavior. commit: f85678c3 I changed  it in release 0.9.10.

Additional I changed error handling, please look on wiki page

If this issue steal occurred in your environment after update the plugin. Please add more information which I can use to reproduce this issue and reopen this issue. 

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

klimas7@gmail.com (JIRA)

unread,
Feb 18, 2019, 5:07:07 PM2/18/19
to jenkinsc...@googlegroups.com
Boguslaw Klimas resolved as Fixed
 

Release 0.9.10

Change By: Boguslaw Klimas
Status: Open Resolved
Resolution: Fixed

john.elion@verizon.net (JIRA)

unread,
May 21, 2019, 10:06:02 AM5/21/19
to jenkinsc...@googlegroups.com
John Elion reopened an issue
 

I understand that a fix has been made, but I am seeing the exact behavior described here right down to the stack trace (with different line numbers) in Jenkins 2.164.2 running on Centos 7 Linux with Git Parameter 0.9.10, Git plugin 3.10.0 and Git Client Plugin 2.7.7.

The referenced Wiki page describes a similar error and states that the SSH command is not available.  However, in my installation I have confirmed that it is available from an interactive terminal session both on the Jenkins master and the Jenkins slave, from the Jenkins Groovy Console a groovy script that executes an arbitrary command prints the ssh help when "ssh" is the arbitrary command, and when "SSH" is entered as the only command in a "Execute windows batch script" build step in a Freestyle test job running on our Windows Jenkins slave.  (It's not clear to me whether this command is being attempted on the master, or on the slave where the job's workspace has already been created.)

I mean no disrespect by re-opening this bug, but I believe it is still occurring.  Could I ask that this be given a second look?  If there is any output or missing information I can provide I will be happy to try to find it.

 

[ Resurgence/jke_vulcan_playground ]  Unexpected error!
hudson.plugins.git.GitException: Command "git ls-remote -h ssh://vdn-bitbucket.pa10lab.gd-ms.us:7999/resurg/vulcan.git" returned status code 128:
stdout: 
stderr: /tmp/ssh2051896551955727069.sh: line 6: ssh: command not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1666)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1657)
 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:2877)

 

 

 

Change By: John Elion
Resolution: Fixed
Status: Resolved Reopened

korthaus@cordney.com (JIRA)

unread,
May 23, 2019, 6:34:03 AM5/23/19
to jenkinsc...@googlegroups.com
René Korthaus commented on Bug JENKINS-50711
 
Re: plugin doesn't work with ssh link to git repo

We can reproduce this issue with the latest 0.9.10, too. For us it only happens when the Jenkins master is a Linux node whereas the slave is a Windows node. Here are the steps:

 

  • Create a new freestyle job:
    • Check "This project is parameterized"
    • Add Parameter "Git Parameter"
      • Name: BRANCH_SPECIFIER
      • Parameter Type: Branch or Tag
      • Default Value: origin/master
    • Check "Restrict where this project can be run"
      • Label expression: <any expression that matches a node running the slave agent on Windows>
    • Under Source Code Management, add a Git repo to check out
      • Repository URL: <any URL to check out, using the ssh protocol (git@URL:group/project.git)>
      • Credentials: <whichever you need>
      • Branch Specifier ${BRANCH_SPECIFIER}
  • Build the freestyle job using "Build with parameters"
    • Actual Result: Branches are listed fine, clicking "Build" checks out the branch and makes the job run successful
  • Build the freestyle job a second time using "Build with parameters"
    • Expected Result: Branches are listed, clicking "Build" checks out the branch and finishes the job successfully
    • Actual Result: The default branch "origin/master" and an error message are shown

 


  • The default value has been returned
  • An error occurred while download data
  • Command "git ls-remote -h git@URL:group/project.git" returned status code 128:
  • stdout: 
  • stderr: /tmp/ssh7012935625751221498.sh: 6: /tmp/ssh7012935625751221498.sh: ssh: not found fatal: Could not read from remote repository.
  • Please make sure you have the correct access rights and the repository exists.
  • Please look at the Log
  • Please check the configuration

The problem is also reported in JENKINS-56558. It even points to the problematic code that causes it.

 

korthaus@cordney.com (JIRA)

unread,
May 23, 2019, 6:35:02 AM5/23/19
to jenkinsc...@googlegroups.com
René Korthaus edited a comment on Bug JENKINS-50711
We can reproduce this issue with the latest 0.9.10, too. For us it only happens when the Jenkins master is a Linux node whereas the slave is a Windows node. Here are the steps:

 
* Create a new freestyle job:
** Check "This project is parameterized"
** Add Parameter "Git Parameter"
*** Name: BRANCH_SPECIFIER
*** Parameter Type: Branch or Tag
*** Default Value: origin/master
** Check "Restrict where this project can be run"
*** Label expression: <any expression that matches a node running the slave agent on Windows>
** Under Source Code Management, add a Git repo to check out
*** Repository URL: <any URL to check out, using the ssh protocol (git@URL:group/project.git)>
*** Credentials: <whichever you need>
*** Branch Specifier ${BRANCH_SPECIFIER}
* Build the freestyle job using "Build with parameters"
** Actual Result: Branches are listed fine, clicking "Build" checks out the branch and makes the job run successful
* Build the freestyle job a second time using "Build with parameters"
** Expected Result: Branches are listed, clicking "Build" checks out the branch and finishes the job successfully
** Actual Result: The default branch "origin/master" and an error message are shown

 
{code:java}

{code}
*
The default value has been returned
* An error occurred while download data
* Command "git ls-remote -h git@URL:group/project.git" returned status code 128:
* stdout: 
*

stderr: /tmp/ssh7012935625751221498.sh: 6: /tmp/ssh7012935625751221498.sh: ssh: not found fatal: Could not read from remote repository.
* Please make sure you have the correct access rights and the repository exists.
* Please look at the Log
* Please check the configuration
{code}
The problem is also reported in JENKINS-56558. It even points to the problematic code that causes it.

 

praveenssit@gmail.com (JIRA)

unread,
May 31, 2019, 1:48:02 AM5/31/19
to jenkinsc...@googlegroups.com

Hello,

I'm facing the same issue with Linux Jenkins Master and Windows Slave. Is there a workaround for this issue ?

korthaus@cordney.com (JIRA)

unread,
May 31, 2019, 6:09:02 AM5/31/19
to jenkinsc...@googlegroups.com

Workaround is to clone using https.

mpflugfelder@contentwatch.com (JIRA)

unread,
Jun 5, 2019, 3:26:02 PM6/5/19
to jenkinsc...@googlegroups.com

I'm having the same problem, and it appears at this time that the workaround of using https to clone the repo does in fact work.

mpflugfelder@contentwatch.com (JIRA)

unread,
Jun 5, 2019, 3:30:02 PM6/5/19
to jenkinsc...@googlegroups.com
Mike Pflugfelder edited a comment on Bug JENKINS-50711
I'm having the same problem, and it appears at this time that the workaround of using https to clone the repo does in fact work.


 

Jenkins: 2.179

Git client plugin: 2.7.7

Git Parameter Plug-In: 0.9.10

Git plugin: 3.10.0

 

Jenkins master is Linux, Build slave is Windows 10 Pro

serhiiboolat@gmail.com (JIRA)

unread,
Jun 6, 2019, 3:58:02 AM6/6/19
to jenkinsc...@googlegroups.com

Is there any other workaround other than https? 

    • The default value has been returned
    • An error occurred while download data
    • Command "git ls-remote -h ssh://git@*********************" returned status code 128:
      stdout: 
      stderr: /tmp/*********************: 6: /tmp/****************************.sh: ssh: not found

    • fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

    • Please look at the Log
    • Please check the configuration

    serhiiboolat@gmail.com (JIRA)

    unread,
    Jun 6, 2019, 3:59:03 AM6/6/19
    to jenkinsc...@googlegroups.com
    Wild Gitler updated an issue
     
    Change By: Wild Gitler
    Comment:
    Is there any other workaround other than https? 
    * The default value has been returned
    * An error occurred while download data
    * Command "git ls-remote -h ssh://git@*********************" returned status code 128:
    stdout: 
    stderr: /tmp/**********************: 6: /tmp/*****************************.sh: ssh: not found

    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    * Please look at the Log
    * Please check the configuration

    john.elion@verizon.net (JIRA)

    unread,
    Jun 6, 2019, 1:14:03 PM6/6/19
    to jenkinsc...@googlegroups.com
    John Elion commented on Bug JENKINS-50711
     
    Re: plugin doesn't work with ssh link to git repo

    Discovered by accident:  If I create a copy of a job that has this bug, the copy does not seem to!  (Click "New Item" in a folder, give the new item a name and choose "Copy" down at the bottom, and enter the name of the job that is breaking like this.)  Save, run the job once (the first time it has been working for everybody), run it again - and the second time seems to be working.  Even after doing this, the original job still has the error described by this bug.

    I looked at the two config.xml files - they seem identical except for a GUID.  So I'm not sure why this happens, but it might provide a sort of workaround to those who are frustrated by this behavior.

    My jobs are all FreeStyle jobs.

    john.elion@verizon.net (JIRA)

    unread,
    Jun 6, 2019, 1:16:02 PM6/6/19
    to jenkinsc...@googlegroups.com
    John Elion edited a comment on Bug JENKINS-50711
    Discovered by accident:  If I create a copy of a job that has this bug, the copy does not seem to!  (Click "New Item" in a folder, give the new item a name and choose "Copy" down at the bottom, and enter the name of the job that is breaking like this.)  Save, run the job once (the first time it has been working for everybody), run it again - and the second time seems to be working.  Even after doing this, the original job still has the error described by this bug.

    I looked at the two config.xml files - they seem identical except for a GUID.  So I'm not sure why this happens, but it might provide a sort of workaround to those who are frustrated by this behavior.

    My jobs are all FreeStyle jobs.   I have seen this on multiple jobs (I had to essentially rename a bunch of jobs because their common suffix was part of an exclusion pattern in a test config.).  I am confident that, because it is still happening on the original jobs, it is not related to any sort of plugin upgrades (I have upgraded plugins, though the Git plugins I noted above are still at those same versions.)

     

    brian.grogan.jr@gmail.com (JIRA)

    unread,
    Jun 10, 2019, 2:19:03 PM6/10/19
    to jenkinsc...@googlegroups.com

    I have the same issue with one of the jobs on my Jenkins installation. 

    Error Output from the Console Log

    > git fetch --tags --progress git@git-server:organization/project.git +refs/heads/:refs/remotes/origin/

    ERROR: Error cloning remote repo 'origin'

    hudson.plugins.git.GitException: Command "git fetch --tags --progress git@git-server:organization/project.git +refs/heads/:refs/remotes/origin/" returned status code 128:

    stdout:

    stderr: /home/jenkins/workspace/project-name@tmp/ssh8085679836267327653.sh: 6: /home/jenkins/workspace/project-name@tmp/ssh8085679836267327653.sh: ssh: not found

    fatal: Could not read from remote repository. 

    Please make sure you have the correct access rights

    and the repository exists.

     

    Much like John Elion above, when I make a clone of the affected job, the cloned job has the same issue as the original job. If I create an entirely new job, and fill in the configuration values manually, the new job works fine. Somehow, the cloned job is "inheriting" the buggy behavior from its parent. 

    My jobs are the FreeStyle type, and they use the Build Parameters configuration option. On my Jenkins installation, I use the Git plug-in, the Git Client plug-in, and the GitLab plug-in. The Jenkins master and all of the Jenkins slaves run Ubuntu Linux. 

    So far, the only solution to this issue I can find is to manually re-create the affected job (no cloning). 

    Software Versions

    Jenkins: 2.178 

    Jenkins Master: Ubuntu 16.04.5 

    Jenkins Slaves: Ubuntu 16.04.5 

    Git Plug-in: 3.9.3 

    Git Client Plug-in: 2.7.7 

    GitLab Plug-in: 1.5.12 

     

    topserhii@gmail.com (JIRA)

    unread,
    Jun 13, 2019, 3:18:04 AM6/13/19
    to jenkinsc...@googlegroups.com

    Brian Grogan still have this error:

    > git fetch --tags --progress git@git-server:organization/project.git +refs/heads/:refs/remotes/origin/

    ERROR: Error cloning remote repo 'origin'

    hudson.plugins.git.GitException: Command "git fetch --tags --progress git@git-server:organization/project.git +refs/heads/:refs/remotes/origin/" returned status code 128:

    stdout:

    stderr: /home/jenkins/workspace/project-name@tmp/ssh8085679836267327653.sh: 6: /home/jenkins/workspace/project-name@tmp/ssh8085679836267327653.sh: ssh: not found

    fatal: Could not read from remote repository. 

    Please make sure you have the correct access rights

    and the repository exists.

    topserhii@gmail.com (JIRA)

    unread,
    Jun 13, 2019, 3:29:02 AM6/13/19
    to jenkinsc...@googlegroups.com
    Serhii VoLz edited a comment on Bug JENKINS-50711
    [~bgrogan] still have this error:

    {{> git fetch --tags --progress git@git-server:organization/project.git +refs/heads/*:refs/remotes/origin/*}}

    {{ERROR: Error cloning remote repo 'origin'}}

    {{hudson.plugins.git.GitException: Command "git fetch --tags --progress git@git-server:organization/project.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:}}


    {{stdout:}}

    {{stderr: /home/jenkins/workspace/project-name@tmp/ssh8085679836267327653.sh: 6: /home/jenkins/workspace/project-name@tmp/ssh8085679836267327653.sh: ssh: not found}}

    {{fatal: Could not read from remote repository.}}{{ }}

    {{Please make sure you have the correct access rights}}

    {{and the repository exists.}}


    I have same problem too... :(

    klimas7@gmail.com (JIRA)

    unread,
    Jun 16, 2019, 4:09:03 AM6/16/19
    to jenkinsc...@googlegroups.com

    klimas7@gmail.com (JIRA)

    unread,
    Jun 16, 2019, 4:12:02 AM6/16/19
    to jenkinsc...@googlegroups.com
    Boguslaw Klimas started work on Bug JENKINS-50711
     
    Change By: Boguslaw Klimas
    Status: Open In Progress

    klimas7@gmail.com (JIRA)

    unread,
    Jun 18, 2019, 3:33:03 PM6/18/19
    to jenkinsc...@googlegroups.com
    Boguslaw Klimas resolved as Fixed
     

    Hi,

    I released plugin in version 0.9.11 where this issue was resolved, could you check that and confirm the issue is resolved

     
    Regards
    Boguslaw

    Change By: Boguslaw Klimas
    Status: In Progress Resolved
    Resolution: Fixed

    vsm.ramesh@gmail.com (JIRA)

    unread,
    Jun 20, 2019, 3:55:03 AM6/20/19
    to jenkinsc...@googlegroups.com
    Ramesh Muthuraj commented on Bug JENKINS-50711
     
    Re: plugin doesn't work with ssh link to git repo

    im getting the same error after upgrading plugin 0.9.11. 

    Error
    [Pipeline]

    {[Pipeline] checkoutWiping out workspace first. Cloning the remote Git repository Cloning with configured refspecs honoured and without tags ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "/usr/bin/git fetch --no-tags --progress ssh://git@bitbucket**********.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: /home/ec2-user/workspace/*****/develop@tmp/ssh7643018751958026140.sh: line 6: ssh: command not found fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:629) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146) at hudson.remoting.UserRequest.perform(UserRequest.java:212) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:369) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to TPAAS-DEV at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357) at hudson.remoting.Channel.call(Channel.java:955) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146) at sun.reflect.GeneratedMethodAccessor440.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132) at com.sun.proxy.$Proxy128.execute(Unknown Source) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ... 4 more[Pipeline] }

    [Pipeline] // node[Pipeline] End of PipelineCloning repository ssh://git@bitbucket*********.git
    > /usr/bin/git init /home/ec2-user/workspace/**************/develop # timeout=10
    Fetching upstream changes from ssh://g...@bitbucket.trimble.tools/tpaas/identity.git
    > /usr/bin/git --version # timeout=10
    Plugin used

    git 3.10.0 truegit 3.10.0 truegit-parameter 0.9.11 truegit-server 1.7 truegitbucket 0.8 trueJenkins 2.121.2

    vsm.ramesh@gmail.com (JIRA)

    unread,
    Jun 20, 2019, 3:56:03 AM6/20/19
    to jenkinsc...@googlegroups.com
    Ramesh Muthuraj edited a comment on Bug JENKINS-50711
    Fetching upstream changes from ssh://git@bitbucket. trimble.tools ******** / tpaas/ identity.git

    > /usr/bin/git --version # timeout=10
    Plugin used

    git 3.10.0 truegit 3.10.0 truegit-parameter 0.9.11 truegit-server 1.7 truegitbucket 0.8 trueJenkins 2.121.2

    vsm.ramesh@gmail.com (JIRA)

    unread,
    Jun 20, 2019, 3:58:02 AM6/20/19
    to jenkinsc...@googlegroups.com

    This is breaking the existing build and we couldn't rollback .since we are using the multibrnach pipeline. 

    korthaus@cordney.com (JIRA)

    unread,
    Jul 11, 2019, 5:26:03 AM7/11/19
    to jenkinsc...@googlegroups.com

    I can confirm that the issue is fixed after an update to, i.e. I can not reproduce it with the steps from my comment above and we could change jobs that we adopted to use https URLs back to clone via SSH again and confirm that the jobs work fine now. Jenkins 2.176.1, git-parameter-plugin 0.9.11.

    Reply all
    Reply to author
    Forward
    0 new messages