jenkinsci / ghprb-plugin

github pull requests builder plugin for Jenkins
https://plugins.jenkins.io/ghprb/
MIT License
506 stars 612 forks source link

Failed to connect to repository :git.exe ls-remote -h .git HEAD" returned status code 128: stdout: stderr: remote: Repository not found. fatal: repository not found #733

Closed ShivaPotlapelli closed 5 years ago

ShivaPotlapelli commented 5 years ago

git fetch --tags --progress https://github.com/XX/IO-QA-automation.git +refs/heads/:refs/remotes/origin/ ERROR: Error fetching remote repo 'origin' hudson.plugins.git.GitException: Failed to fetch from https://github.com/xx/IO-QA-automation.git at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:862) at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1129) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1160) at hudson.scm.SCM.checkout(SCM.java:504) at hudson.model.AbstractProject.checkout(AbstractProject.java:1203) 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:1727) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/XX/IO-QA-automation.git +refs/heads/:refs/remotes/origin/" returned status code 128: stdout: stderr: remote: Repository not found. fatal: repository 'https://github.com/XX/IO-QA-automation.git/' not found

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...

am-firnas commented 4 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.

svarshney2311 commented 4 years ago

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

GajenderTyagi commented 4 years ago

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:

GajenderTyagi commented 4 years ago

https://medium.com/facademy/setup-jenkins-for-private-repository-9060f54eeac9

this helped me, I had to create user with correct credentials :)

ShivaPotlapelli commented 4 years ago

this helped me, https://stackoverflow.com/questions/54440472/jenkins-shows-as-failed-to-connect-to-repository-on-enter-of-repository-url/64619271#64619271

T3TanushreeRay0428 commented 3 years ago

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.

siddheshmalpani commented 3 years ago

@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-----

MedeilPlusCloudCust commented 2 years ago

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

Rajendraladkat1919 commented 2 years ago

Why this issue is closed ? Does this issue is fixed ?

blacix commented 2 years ago

I've just bumped into this. I can clone the repo with the jenkins user, but cannot do so from a jenkins job.

kvtester commented 2 years ago

@ShivaPotlapelli Hi brother why should you close this issue .if you resolve those error plz tell the idea. it will be usefull for many

ShivaPotlapelli commented 2 years ago

@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

Rajendraladkat1919 commented 2 years ago

@ShivaPotlapelli can you please explain how above solution and the error message of current issue is corellated ?

nosheenakhtar commented 1 year ago

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

dirtegov commented 1 year ago

youjenkins.com/manage/configureSecurity/ "Git Host Key Verification Configuration" -> "Host Key Verification Strategy" - > Set : "No verification"

PmPPolska commented 4 months ago

http://new.meteo.pl/um/php/meteorogram_id_um.php?ntype=0u&id=999&fbclid=IwZXh0bgNhZW0CMTEAAR0HlE1psFrWNqq4O87Y0C9jdx5zkcKIaMY1EEtn2pbwXOPekarpXrmloLg_aem_Fa0mE0Gju6cN28ytZnBH8w