Error Jenkins: Failed to connect to repository

0 votes
I'm unable to connect Jenkins on a github repo.

When I specify the repository URL, Jenkins returns the following error message:

Failed to connect to repository : Failed to connect to //Zulaikha12/git-test.git (status = 407)
Jul 6, 2018 in Jenkins by Zulaikha
• 870 points
1,115 views

2 answers to this question.

0 votes

This happens when you create the ssh files with the root user access. This makes root the owner of the files.

The solution is to just change the ownership to the Jenkins user.

chown jenkins id_rsa.pub 
chown jenkins id_rsa
answered Jul 6, 2018 by Sophie may
• 9,870 points
0 votes

Jenkins runs as another user, not as your ordinary login. So, do as this to solve the ssh problem:

  1. Log on as jenkins su jenkins (you may first have to do sudo passwd jenkins to be able to set the password for jenkins. I couldn't find the default...)

  2. Generate ssh key pair: ssh-keygen

  3. Copy the public key (id_rsa.pub) to your github account (or wherever)

  4. Clone the repo as jenkins in order to have the host added to jenkins known_hosts which is neccessary to do. Now you can remove the cloned repo again if you wish.

answered Aug 7 by Sirajul
• 41,000 points

Related Questions In Jenkins

0 votes
1 answer
0 votes
1 answer

Error while talking to remote Oracle DB using Jenkins-CI

I installed Oracle XE to talk to ...READ MORE

answered May 1, 2018 in Jenkins by shubham
• 6,890 points
337 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
264 views
0 votes
1 answer
0 votes
5 answers

How to resolve this error “Jenkins Host key verification failed”?

HI Mam, Please check the following solution:: 1. Switch ...READ MORE

answered May 3 in Jenkins by anonymous
7,958 views
0 votes
2 answers

How to solve this error “Jenkins - j_acegi_security_check” ?

This is how I resolved this issue: # ...READ MORE

answered Aug 13, 2018 in Jenkins by lina
• 8,160 points
1,401 views