-
Bug
-
Resolution: Fixed
-
Critical
-
Powered by SuggestiMate
I have an error:
"Command "/usr/bin/git ls-remote -h git@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
- duplicates
-
JENKINS-45480 GIT Build with Parameters is not listing branches
-
- Resolved
-
- is caused by
-
JENKINS-56558 Environment variables get polluted from nodes
-
- Resolved
-
- is related to
-
JENKINS-47399 Using of ssh url with new version of git-parameter plugin
-
- Resolved
-
- relates to
-
JENKINS-56558 Environment variables get polluted from nodes
-
- Resolved
-
[JENKINS-50711] plugin doesn't work with ssh link to git repo
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)
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.
Hello,
I'm facing the same issue with Linux Jenkins Master and Windows Slave. Is there a workaround for this issue ?
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
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.)
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
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...
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
im getting the same error after upgrading plugin 0.9.11.
Error
[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://git@bitbucket.********/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
This is breaking the existing build and we couldn't rollback .since we are using the multibrnach pipeline.
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.
Not fixed for me
re-creating job doesn't help
Jenkins 2.235
git parameter plugin 0.9.12
git plugin 4.2.2
git client plugin 3.2.1
> git fetch --tags --progress -- ssh://git@zzz:2222/zzz.git +refs/heads/*:refs/remotes/origin/* # timeout=10 ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from sssh://git@zzz:2222/zzz.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:909) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1131) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1167) at hudson.scm.SCM.checkout(SCM.java:505) at hudson.model.AbstractProject.checkout(AbstractProject.java:1206) 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:1880) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress -- ssh://git@zzz:2222/zzz.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: /var/jenkins_home/workspace/devops/dsl-install@tmp/jenkins-gitclient-ssh3143469929684385959.sh-copy: 6: /var/jenkins_home/workspace/devops/dsl-install@tmp/jenkins-gitclient-ssh3143469929684385959.sh-copy: ssh: not found
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.