Bamboo Data Center specs publish fails with error - Transaction rolled back because it has been marked as rollback-only
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 article covers a scenario where Bamboo Specs publishing failed for a particular plan in Bamboo. The error seen on the logs was "Transaction rolled back because it has been marked as rollback-only".
Environment
The issue was seen on Bamboo 9.6.0 but will be applicable for any other supported version.
Diagnosis
Looking at <bamboo-home>atlassian-bamboo.log file, we can see the below error when the specs publishing fails.
1
2
3
INFO [BambooServer] An error occurred while publishing plan BAM-BOO: java.lang.RuntimeException: org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
DEBUG [BambooServer] {"message":"java.lang.RuntimeException: org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only","status-code":500}
Cause
The error "Transaction rolled back because it has been marked as rollback-only" usually means Bamboo application started doing some transaction in this case started the process of specs publishing, but encountered some error and because of which it had to rollback the transaction as it could not complete it.
You can read more about it hereand 'org.springframework.transaction.UnexpectedRollbackException' when Viewing or Creating a Page
In this particular case we can see that just before the Specs publishing, below error was seen for one of the related plan branches for the main plan where specs publishing was happening, this error means Bamboo was not able to load the structure of one of the plan branches into memory which eventually lead to the failure of specs publishing.
1
2
ERROR [scheduler_Worker-14] [ImmutablePlanManagerImpl] Plan BAM-BOO10 failed to load and will not be available
java.lang.NullPointerException: null
Solution
The resolution might be different in each case, and depends on the issue identified in the log analysis. I am covering couple of possible solutions tested.
Solution 1
The first step is to check the error inside <bamboo-home>atlassian-bamboo.log, which is seen before the specs publish fails and try to resolve it, in the above case try to identify if anything is wrong with the structure of the plan branches which is coming in the logs.
This could also come because of a incorrect cache structure of the plan in Bamboo and one of the way to fix this is to forcefully recreate the plan cache structure which can be done by just disabling and enabling the plan branches or the main plan.
Solution 2
If there are no errors seen before the specs publishing fails and solution 1 does not work, Restart Bamboo and check if your problem is resolved.
Was this helpful?