Jenkins Git Integration Beginner Problem

279 views
Skip to first unread message

debugl...@gmail.com

unread,
Aug 14, 2015, 11:55:10 AM8/14/15
to Jenkins Developers
Here is my build error (it has never worked, I am starting off with jenkins) on my project 'JenkinsCD':
-------------------------------
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/JenkinsCD/workspace
cvs checkout -P -D 14 Aug 2015 10:16:44 -0500 -d workspace origin/master 
ERROR: CVS Authentication failed: null
org.netbeans.lib.cvsclient.connection.AuthenticationException: SSH connection failed.
	at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:141)
	at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374)
	at java.lang.Thread.run(Thread.java:745)
Caused by: com.jcraft.jsch.JSchException: java.io.FileNotFoundException: /var/lib/jenkins/.ssh/id_rsa (Permission denied)
	at com.jcraft.jsch.KeyPair.load(KeyPair.java:524)
	at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
	at com.jcraft.jsch.JSch.addIdentity(JSch.java:389)
	at com.jcraft.jsch.JSch.addIdentity(JSch.java:370)
	at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:135)
	... 2 more
Caused by: java.io.FileNotFoundException: /var/lib/jenkins/.ssh/id_rsa (Permission denied)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:146)
	at java.io.FileInputStream.<init>(FileInputStream.java:101)
	at com.jcraft.jsch.Util.fromFile(Util.java:492)
	at com.jcraft.jsch.KeyPair.load(KeyPair.java:521)
	... 6 more
ERROR: Cvs task failed
Finished: FAILURE
----------------------------
I installed jenkins yesterday and git is already installed (pushing and pulling, version is 1.8.3.1) and I can view jenkins from browser. I am SSH-ing into the server using a username and password and I have created the id_rsa and id_rsa.pub inside of the .ssh folder in var/lib/jenkins/.ssh ; however I required sudo access to create the id_rsa and id_rsa.pub files because I have sudo level but not the specific root account access. Permissions for the two files in .ssh folder are: 

-rw-------. 1 root root 1675 Aug 13 18:13 id_rsa
-rw-r--r--. 1 root root  394 Aug 13 18:13 id_rsa.pub

This appears to be typically of these keys but I believe there may be issues with permissions (I mean look at the stack trace from the build error!) and also I have heard things about creating a jenkins user. Also the git repository is hosted on bitbucket but a local clone of the repo exists as well so if anyone has any advice whatsoever or thinks they know what the problem is I would greatly appreciate any help that you can offer, thanks :) 

debugl...@gmail.com

unread,
Aug 14, 2015, 11:58:01 AM8/14/15
to Jenkins Developers
Btw the linux distribution is CentOS Linux release 7.1.1503 (Core).

thanks again! :)

nicolas de loof

unread,
Aug 14, 2015, 12:02:56 PM8/14/15
to jenkin...@googlegroups.com
according to log your job is setup with CVS as SCM

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/6cee415e-e3b9-4da1-a05e-6619c1035ad5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

debugl...@gmail.com

unread,
Aug 14, 2015, 1:01:31 PM8/14/15
to Jenkins Developers


On Friday, August 14, 2015 at 9:02:56 AM UTC-7, nicolas de loof wrote:
according to log your job is setup with CVS as SCM


Thanks for your quick response friend!

This is correct, I have passed in my git credentials and repo address for ssh. However I am sensing that this was the incorrect way to go about integrating git - I selected that option because in the jenkins GUI on the Jenkins > MyProject > Configure the only options for SCM were "none", "CVS", "CVS ProjectSet", and "Subversion". Since your post I have downloaded the git plugin, git client plugin, and all bitbucket plugins. Right now (after changing the SCM option to "none") I just passed the trivial build where I run a basic ECHO shell script but don't actually get or use any of my Ruby on Rails code which I am trying to continuously integrate. 

Do you have any idea on how I would go about making a build pull the most recent code on my origin/master branch? My research indicates that a hook through bitbucket may be the most helpful but I am stuggling to figure out what option I change inside of the jenkins GUI to pull from my bitbucket SCM


nicolas de loof

unread,
Aug 14, 2015, 1:25:05 PM8/14/15
to jenkin...@googlegroups.com
first install git plugin, restart, then configure your job SCM with git repo URL and required ssh credentials
Run the build and check it can clone the repo. Setting up bitbucket hook is another story

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

debugl...@gmail.com

unread,
Aug 14, 2015, 1:43:09 PM8/14/15
to Jenkins Developers
Thanks Nicolas for the clear road-map! Love to see such great community feedback  
 
Reply all
Reply to author
Forward
0 new messages