Closed ShivaPotlapelli closed 5 years ago
same issue here too when I give repository url on setup, git and github plugins are preinstalled to jenkins.but I think the issue is to deal with ssh, but don't know how.
same issue for me too:
| Failed to connect to repository : Command "git.exe ls-remote -h -- https://github.com/svarshney2311/Digital_API_Automation.git HEAD" returned status code 128:stdout:stderr: Logon failed, use ctrl+c to cancel basic credential prompt.remote: Invalid username or password.fatal: Authentication failed for
No Solutions yet ?
Failed to connect to repository : Command "git ls-remote -h git@github.com:Programmersio-IBMi/company_system.git HEAD" returned status code 128:
https://medium.com/facademy/setup-jenkins-for-private-repository-9060f54eeac9
this helped me, I had to create user with correct credentials :)
ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://github.com/Intransigense/ems-system.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1000) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1301) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 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) Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- https://github.com/Intransigense/ems-system.git +refs/heads/:refs/remotes/origin/" returned status code 128: stdout: stderr: remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/Intransigense/ems-system.git/'
I have Jenkins installed on google kubernetes cluster. Any help would be appreciated!!! I created Credentials SSH username with private key.
@TanushreeRay0428 May be you're copying the wrong key in the credential store. You need to copy the private key generated something as below in Jenkins. At the same time copy the complete file content from .pub file into GitHub.
-----BEGIN OPENSSH PRIVATE KEY----- ... -----END OPENSSH PRIVATE KEY-----
Failed to connect to repository : Command "git.exe ls-remote -h -- https://github.com/vanuston-intelligence/medeilpluscloudboot.git HEAD" returned status code 128: stdout: stderr: remote: Repository not found. fatal: repository 'https://github.com/vanuston-intelligence/medeilpluscloudboot.git/' not found
Why this issue is closed ? Does this issue is fixed ?
I've just bumped into this. I can clone the repo with the jenkins user, but cannot do so from a jenkins job.
@ShivaPotlapelli Hi brother why should you close this issue .if you resolve those error plz tell the idea. it will be usefull for many
@kvtester please follow this slack answer https://stackoverflow.com/questions/54440472/jenkins-shows-as-failed-to-connect-to-repository-on-enter-of-repository-url/64619271#64619271
@ShivaPotlapelli can you please explain how above solution and the error message of current issue is corellated ?
The problem was that somehow I created the ssh files with the root user. So the files owner was root.
The solution was just change the ownership to the jenkins user.
chown jenkins id_rsa.pub chown jenkins id_rsa
I had the exact same problem. The way I solved it on Mac is this:
Switch to jenkins user (sudo -iu jenkins) Run: ssh-keygen (Note - You are creating ssh key pairs for jenkins user now. You should see something like this : Enter file in which to save the key (/Users/Shared/Jenkins/.ssh/id_rsa): Keep pressing Enter for default value till end Run the command showing in the Jenkins error message, on your teminal (eg : "git ls-remote -h git@github.com:adolfosrs/jenkins-test.git HEAD") You will be asked if you want to continue. Say yes The Github repo will be added to your known_hosts file in : /Users/Shared/Jenkins/.ssh/ Go back to Jenkins portal and try your Github SSH url It should work. Good Luck
youjenkins.com/manage/configureSecurity/ "Git Host Key Verification Configuration" -> "Host Key Verification Strategy" - > Set : "No verification"
Started facing this issue recently which went fine upto 100 builds but don't know what went wrong recently.Can some lookinto this and let us know what is the issue...