Reputation: 337
I'm attempting to clone a remote GitHub enterprise repository and am running into the following error after adding my remote repo's URL to the Git Plugin in my Jenkins configuration:
hudson.plugins.git.GitException: Command "/usr/bin/git -c askpass=true fetch --tags --progress https://github.com/myUsername/myProject.git refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: fatal: unable to access https://github.myOrg.com/myUsername/myProject.git/': Failed to connect to github.com port 443: Operation timed out at...
Configuration details & things I have tried:
Questions:
I have been troubleshooting this for a few days now and am unsure of what my problem(s) are at this point! Please help!!
Upvotes: 10
Views: 100142
Reputation: 1202
It is a bit strange but if you are using gitlab.com, it seems that the error is gone when you login to the website (gitlab.com) using the gitlab account used to clone the project from Jenkins.
Upvotes: 1
Reputation: 337
Problem has been resolved. Followed steps here for new keygen. Logged into terminal as: jenkins$ (sudo -i -u jenkins). I was able to eventually add newly generated keys to /Users/Shared/Jenkins/.ssh/id_rsa (I was trying to reproduce how my other ssh keys were stored on my mac in /Users/me/.ssh).
I also had to restrict permission levels on the above SSH key folder to avoid getting an error & authenticating with the ssh -T..and added to git -> account settings -> ssh key (specifically for jenkins).
After that, I went into Jenkins /configure and added my new private key location to CVS. In my project, I had to add credentials (SSH username w/private key) w/"From the Jenkins master ~/.ssh" radio button selected.
Upvotes: 1
Reputation: 5190
Regarding your 1st question - you need to associate correct ssh key
with appropriate repository. You can do it in
/var/lib/jenkins/.ssh/config
file - detailed explanation is
here this is more robust solution in terms of supporting of
multiple git repos OR you can just add correct ssh key into /.ssh
folder. For troubleshooting try to perform clone github repo under jenkins user
inside your jenkins box.
Regarding your 2nd question. Here are my network settings in jenkins
and I have no warning messages:
/etc/hosts
: 127.0.0.1 localhost localhost.localdomain
/etc/sysconfig/network
: HOSTNAME=localhost.localdomain
. Your hostname and localhost should be resolved inside jenkins server as well.
Upvotes: 5