SVN update fails with NullpointerException
症状
Performing a build fails with the exception below:
2009-01-08 08:09:47,109 WARN [BAM::appstack-build.srv.ambientia.fi::Agent] [BuildAgentControllerImpl] Error occurred while executing the build for LVI-ADMIN-12077
com.atlassian.bamboo.repository.RepositoryException: Unable to retrieve source code to '75994' for 'LVI-ADMIN'
at com.atlassian.bamboo.repository.svn.SvnRepository.retrieveSourceCode(SvnRepository.java:372)
at com.atlassian.bamboo.v2.build.task.CheckoutUpdateForBuild.call(CheckoutUpdateForBuild.java:94)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:192)
at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:89)
at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:105)
at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$1.run(NamedThreadFactory.java:32)
at edu.emory.mathcs.backport.java.util.concurrent.helpers.ThreadHelpers$1.run(ThreadHelpers.java:34)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.tmatesoft.svn.core.SVNException: svn: Error while dispatching event: null
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.svn.SVNEditModeReader.driveEditor(SVNEditModeReader.java:231)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.update(SVNRepositoryImpl.java:1481)
at org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:446)
at com.atlassian.bamboo.repository.svn.SvnRepository.update(SvnRepository.java:814)
at com.atlassian.bamboo.repository.svn.SvnRepository.retreiveSourceCodeWithException(SvnRepository.java:412)
at com.atlassian.bamboo.repository.svn.SvnRepository.retrieveSourceCode(SvnRepository.java:333)
... 7 more
Caused by: java.lang.NullPointerException
at com.atlassian.bamboo.repository.svn.UpdateEventHandler.handleEvent(UpdateEventHandler.java:149)
at org.tmatesoft.svn.core.wc.SVNBasicClient.dispatchEvent(SVNBasicClient.java:365)
at org.tmatesoft.svn.core.wc.SVNBasicClient.handleEvent(SVNBasicClient.java:428)
at org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.handleEvent(SVNWCAccess.java:94)
at org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.handleEvent(SVNWCAccess.java:78)
at org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor.openFile(SVNUpdateEditor.java:984)
at org.tmatesoft.svn.core.internal.wc.SVNUpdateEditor.openFile(SVNUpdateEditor.java:542)
at org.tmatesoft.svn.core.internal.wc.SVNCancellableEditor.openFile(SVNCancellableEditor.java:113)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.processCommand(SVNEditModeReader.java:149)
at org.tmatesoft.svn.core.internal.io.svn.SVNEditModeReader.driveEditor(SVNEditModeReader.java:214)
... 12 more
2009-01-08 08:09:47,109 INFO [BAM::appstack-build.srv.ambientia.fi::Agent] [RemoteBuildResultProcessor] Build LVI-ADMIN-12077 completed on Bamboo agent. Sending results to server.
原因
SVN issues a SKIP event which is skipping a file during the update process and the UpdateEventHandler
thinks it must be an error and expects an error message coming with that event. The event does not contain an error message thus a NPE is thrown when trying to retrieve the 'message'
When SVNEvent has its action set to SKIP, it is not necessary that there will be an error message - skipping conflicting file is not actually an error, but rather expected behavior of update.
ソリューション
Configure the plan to perform "clean checkout", this will remove all files from the working copy and avoid a conflict next time sources are checked out.
This issue has actually been resolved in Bamboo 2.2x. Atlassian recommends upgrading to the latest release for a proper fix.