Tag: troubleshoot

Jenkins reports error on SVN update

One day a Jenkins server I use for Continuous Integration stopped updating code from SVN repositories. It reported an error ERROR: Failed to update https://svn.matuera.net/svn/project whilst throwing an SVNException.

In this post I describe how I was able to fix the problem and let the builds continue.

Stacktrace

The stacktrace that Jenkins reported was:

ERROR: Failed to update https://svn.daangemist.nl/svn/project
org.tmatesoft.svn.core.SVNException: svn: E175002: OPTIONS /svn/project failed
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:379)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:364)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:708)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:628)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:103)
    at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1018)
    at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getRepositoryUUID(DAVRepository.java:148)
    at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.createRepository(SvnRepositoryAccess.java:106)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepository(SvnNgRepositoryAccess.java:210)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.updateInternal(SvnNgAbstractUpdate.java:144)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.update(SvnNgAbstractUpdate.java:76)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:38)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:18)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
    at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:291)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:311)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:291)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:387)
    at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:143)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:153)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:903)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:884)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:867)
    at hudson.FilePath.act(FilePath.java:909)
    at hudson.FilePath.act(FilePath.java:882)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:843)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:781)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1408)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:657)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
    at hudson.model.Run.execute(Run.java:1603)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:246)
Caused by: svn: E175002: OPTIONS /svn/project failed
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:154)
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:97)
    ... 38 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: OPTIONS request failed on '/svn/project'
svn: E175002: Received fatal alert: bad_record_mac
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:754)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:373)
    ... 37 more
Caused by: svn: E175002: OPTIONS request failed on '/svn/project'
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:752)
    ... 38 more
Caused by: svn: E175002: Received fatal alert: bad_record_mac
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:109)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:505)
    ... 38 more
Caused by: javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1781)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1024)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1208)
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:674)
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:119)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.sendData(HTTPConnection.java:313)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:168)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:460)
    ... 38 more
ERROR: Subversion update failed
java.io.IOException
    at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:184)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:153)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:903)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:884)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:867)
    at hudson.FilePath.act(FilePath.java:909)
    at hudson.FilePath.act(FilePath.java:882)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:843)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:781)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1408)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:657)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:562)
    at hudson.model.Run.execute(Run.java:1603)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:246)
Caused by: hudson.scm.subversion.UpdaterException: failed to perform svn update
    ... 17 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: OPTIONS /svn/project failed
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:379)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:364)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:352)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:708)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:628)
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:103)
    at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1018)
    at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getRepositoryUUID(DAVRepository.java:148)
    at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.createRepository(SvnRepositoryAccess.java:106)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepository(SvnNgRepositoryAccess.java:210)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.updateInternal(SvnNgAbstractUpdate.java:144)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgAbstractUpdate.update(SvnNgAbstractUpdate.java:76)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:38)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgUpdate.run(SvnNgUpdate.java:18)
    at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
    at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
    at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
    at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:291)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:311)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:291)
    at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:387)
    at hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:143)
    ... 16 more
Caused by: svn: E175002: OPTIONS /svn/project failed
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:154)
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:97)
    ... 38 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: OPTIONS request failed on '/svn/project'
svn: E175002: Received fatal alert: bad_record_mac
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:64)
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:754)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:373)
    ... 37 more
Caused by: svn: E175002: OPTIONS request failed on '/svn/project'
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:208)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:752)
    ... 38 more
Caused by: svn: E175002: Received fatal alert: bad_record_mac
    at org.tmatesoft.svn.core.SVNErrorMessage.create(SVNErrorMessage.java:109)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:505)
    ... 38 more
Caused by: javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
    at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1781)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1024)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1208)
    at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:674)
    at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:119)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.sendData(HTTPConnection.java:313)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPRequest.dispatch(HTTPRequest.java:168)
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:460)
    ... 38 more

Initial research

At first I thought it had something to do with credentials or the Jenkins version, but checkout as the jenkins user from commandline did work. Also updating Jenkins did not resolve the issue.
Some research taught me that this problem only appears on Java 6 and is caused by the underlying SVNKit svn library used: 1, 2, 3 and 4.

The solution

In most posts the solution described is either upgrading the java version or by supplying an additional parameter at Jenkins startup to force SVNKit to work a bit differently. I do not know the exact effect it has
in SVNKit, but it does work. The Jenkins version I use on CentOS is started by a init-script in /etc/init.d/jenkins. I replaced the following line that starts Jenkins with:

JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"

With:

JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -Dsvnkit.http.sslProtocols="SSLv3" -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"

This solved the problem and allowed Jenkins to update normally.

Leave a Comment

setuid bit not set on sudo

I encountered the following message when attempting to execute a sudo command on a freshly installed system:

[webdevelop@arkos01 ~]$ sudo su -
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

To fix this, I had to login as root via SSH (by setting the sshd config value PermitRootLogin to yes) and execute the following command:

chmod u+s /usr/bin/sudo

Leave a Comment