Jenkins svn ssh / host key verification problems

1,761 views
Skip to first unread message

Bjørn Water

unread,
Jan 4, 2013, 9:19:31 AM1/4/13
to jenkins...@googlegroups.com
So i am trying to use the M2-release plugin to release my project and push it to my nexus.
I can do svn checkout and i can even tag my build and see it in my repo 
but when i try to do mvn release:prepare after a succesfull build i get an error

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to commit files
Provider message:
The svn command failed.
Command output:
Host key verification failed.
svn: Commit failed (details follow):
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Unable to commit files
Provider message:
The svn command failed.
Command output:
Host key verification failed.
svn: Commit failed (details follow):
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
	at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at hudson.maven.agent.Main.launch(Main.java:185)
	at hudson.maven.MavenBuilder.call(MavenBuilder.java:153)
	at hudson.maven.Maven2Builder.call(Maven2Builder.java:79)
	at hudson.maven.Maven2Builder.call(Maven2Builder.java:55)
	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:326)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.plugin.MojoFailureException: Unable to commit files
Provider message:
The svn command failed.
Command output:
Host key verification failed.
svn: Commit failed (details follow):
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

	at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:287)
	at org.apache.maven.plugins.release.PrepareReleaseMojo.execute(PrepareReleaseMojo.java:237)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
	at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
	... 28 more
Caused by: org.apache.maven.shared.release.scm.ReleaseScmCommandException: Unable to commit files
Provider message:
The svn command failed.
Command output:
Host key verification failed.
svn: Commit failed (details follow):
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

	at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.checkin(AbstractScmCommitPhase.java:168)
	at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.performCheckins(AbstractScmCommitPhase.java:148)
	at org.apache.maven.shared.release.phase.ScmCommitPreparationPhase.runLogic(ScmCommitPreparationPhase.java:75)
	at org.apache.maven.shared.release.phase.AbstractScmCommitPhase.execute(AbstractScmCommitPhase.java:79)
	at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:203)
	at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:140)
	at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:103)
	at org.apache.maven.plugins.release.PrepareReleaseMojo.prepareRelease(PrepareReleaseMojo.java:279)
	... 32 more


I have already tried deleting my host key and requested a new one by doing a ssh directly from the server.
But still giving an error.

Anyone who knows what this error could be?

Thanks in advance,
Bjørn

teilo

unread,
Jan 4, 2013, 9:28:46 AM1/4/13
to jenkins...@googlegroups.com

Hi Bjørn

 As the jenkins user on the slave ssh to the svn server and accept its key.

 Depending on your ssh clinet it may override the entry stored in ~/.ssh/known_hosts or may not.  (if not then remove the entry manually from this file and retry with the ssh command)

That should get it working

 /James

domi

unread,
Jan 4, 2013, 9:32:35 AM1/4/13
to jenkins...@googlegroups.com
We had lots of issues when using the cli subversion client for release builds, therefore we moved to the svnjava provider and have no issues anymore:
/Domi

teilo

unread,
Jan 4, 2013, 9:36:12 AM1/4/13
to jenkins...@googlegroups.com, do...@fortysix.ch
I have completely to opposite experience, native svn+ssh is so much simpler than all other options!

The provider also says it only works with http/https so may not even be much use (but then again documentation could just be out of date)

Bjørn Water

unread,
Jan 4, 2013, 9:46:40 AM1/4/13
to jenkins...@googlegroups.com
Hi James,

I have manually removed the entry from the file and then did a SSH command again and accepted the certificate.
Still getting the same problems as before.
Is there a way to see if it overrides the entry?
Because it works when I tag it and that is also a commit right?

Thanks,

Bjørn

teilo

unread,
Jan 4, 2013, 9:54:09 AM1/4/13
to jenkins...@googlegroups.com
Jenkins tags using its inbuilt library (svnkit) as far as I am aware so the native ssh client doesn't get a look in.

to see if its overridden the entry just check ~/.ssh/known_hosts for an entry for your server (after you removed it)

What happens if as the jenkins user on the slave you run svn info svn+ssh://yourserver/path/to/repo  ?

Adam Tong

unread,
Jan 4, 2013, 10:09:53 AM1/4/13
to jenkins...@googlegroups.com
Hi,

Did you try copying the .ssh folder to the jenkins folder?

I am using git but this solved the problem.

Bjørn Water

unread,
Jan 4, 2013, 10:22:22 AM1/4/13
to jenkins...@googlegroups.com
yes it is in var/lib/jenkins/.ssh thats is where our keys are already in place

Bjørn Water

unread,
Jan 4, 2013, 10:32:55 AM1/4/13
to jenkins...@googlegroups.com
I have removed the host from the file and then ran it again.
There is no entry being made in that file so it does not override or writes something to the known_hosts file

teilo

unread,
Jan 4, 2013, 10:42:56 AM1/4/13
to jenkins...@googlegroups.com
are you sure you are looking in the correct file?
it should be in the home file of the user that the jenkins service runs as.
for the rpm the default (IIRC is ~jenkins/.ssh/known_hosts) - it may be somewhere else depending on your container / launch /install method.

the svn commands also needs to be run as this jenkins user.

Bjørn Water

unread,
Jan 4, 2013, 10:51:41 AM1/4/13
to jenkins...@googlegroups.com
Yes i have checked both the user file wich is jenkins and the root and they both contain .

Still think that it is very wierd that a checkout works and tagging it works aswell but doing a release gives host problems.
Shouldn't checkout and tag give the same problem then?

Bjørn Water

unread,
Jan 7, 2013, 3:51:39 AM1/7/13
to jenkins...@googlegroups.com
Anyone that has an idea? It is getting pretty anoying so far . Would love to get this working because it seems very promosing

Bjørn Water

unread,
Jan 7, 2013, 4:42:49 AM1/7/13
to jenkins...@googlegroups.com
So i have checked and the slave where i run my build process on does not contain a host key.
So i suspect this slave also needs one?


On Friday, January 4, 2013 3:19:31 PM UTC+1, Bjørn Water wrote:

Nord, James

unread,
Jan 7, 2013, 5:19:09 AM1/7/13
to jenkins...@googlegroups.com

Yes – the slave needs the servers host key in the known_hosts (or you can configure ssh to not use strict host checking[1] – depending on your level of security paranioa )

 

[1] http://linuxcommando.blogspot.co.uk/2008/10/how-to-disable-ssh-host-key-checking.html





**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
Reply all
Reply to author
Forward
0 new messages