Bamboo build using SVN repository for plans imported via Java specs scan fails with NullPointerException

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This knowledge-base article covers a scenario where a build fails for a plan which was created via Java specs scan import ( via an IDE ). The plan has a SVN repository linked locally.

The import of the plan is successful but the build fails with java.lang.NullPointerException which is seen in the build logs.

Environment

The issue is seen on Bamboo 9.1.0 but it might be applicable for any other supported version of Bamboo.

Diagnosis

The first step towards diagnosis is to refer the Bamboo build logs for the plan which is failing, the logs point to java.lang.NullPointerException as seen below:

1 2 3 4 5 6 ERROR [7-DelayedChangeDetectionThread:pool-10-thread-4] [ChainExecutionManagerImpl] Errors getting changes for job-key com.atlassian.bamboo.repository.RepositoryException: java.lang.NullPointerException at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:443) ~[atlassian-bamboo-core-9.1.0.jar:?] ... Caused by: java.lang.NullPointerException at com.atlassian.bamboo.repository.svn.v2.AbstractSvnExecutor.getSubstitutedAccessDataBuilder(AbstractSvnExecutor.java:166) ~[atlassian-bamboo-core-9.1.0.jar:?]

ℹ️ An interesting point to note is that the build works properly if the same repository is saved manually after import from Bamboo GUI by going to configure plan > repositories tab.

Cause

The cause of the issue is incorrect specs code for the repository section of the plan, it is missing the section for branch configuration and as per the error above, Bamboo is looking for the branch name and hence NullPointerException:

Specs code imported via IDE

1 2 3 4 5 6 7 8 9 10 11 .planRepositories(new AnyVcsRepository(new AtlassianModule("com.atlassian.bamboo.plugin.system.repository:svnv2")) .name("test-svn-repository") .serverConfiguration(new MapBuilder() .put("repository.svn.useExternals", false) .put("repository.svn.tag.create.autodetectPath", true) .put("repository.svn.authType", "password") .put("repository.svn.username", "test") .put("repository.svn.branch.create.autodetectPath", true) .put("repository.svn.userPassword", "BAMSCRT@0@0@+test") .put("repository.svn.repositoryRoot", "<https://test.com/trunk")> .build()))

The above specs code is missing the below sections related to branch configuration

Missing blocks

1 2 3 4 5 branchConfiguration(new MapBuilder() .put("repository.svn.branch.displayName", "trunk") .put("repository.svn.branch.path", "") .build()) .changeDetectionConfiguration(new VcsChangeDetection()))

Solution

The solution is to combine the above 2 sections as described in the cause section above for the specs and reimport the Java specs, kindly refer below

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 .planRepositories(new AnyVcsRepository(new AtlassianModule("com.atlassian.bamboo.plugin.system.repository:svnv2")) .name("test-svn-repository") .serverConfiguration(new MapBuilder() .put("repository.svn.useExternals", false) .put("repository.svn.tag.create.autodetectPath", true) .put("repository.svn.authType", "password") .put("repository.svn.username", "test") .put("repository.svn.branch.create.autodetectPath", true) .put("repository.svn.userPassword", "BAMSCRT@0@0@+test") .put("repository.svn.useExport", false) .put("repository.svn.repositoryRoot", "<https://test.com/trunk")> .build()) .branchConfiguration(new MapBuilder() .put("repository.svn.branch.displayName", "trunk") .put("repository.svn.branch.path", "") .build()) .changeDetectionConfiguration(new VcsChangeDetection()))

ℹ️ Please make sure to change the username, password, repositoryRooturl and branch name with appropriate values for your own instance.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.