Description
Issue Summary
When using tag triggers, Bamboo will log a NullPpointerExceltion if there is data inconsistency in the Database.
Steps to Reproduce
This is a way to reproduce the error:
- Create a repository with 1 tag: release1.
- Push the tag to Bitbucket Server.
- Create a Linked Repository in Bamboo and link it to a plan.
- Add a tag trigger to that plan.
- Wait for it to detect the initial tag:
- Delete that tag and create + push a new one:
Expected Results
No errors displayed in logs.
Actual Results
The following error is displayed in the server logs:
2021-02-15 15:39:46,076 ERROR [26-TagDetectionBackgroundThread:pool-49-thread-1] [TagDetectionServiceImpl] An exception occurred when trying to read and handle tags from repository java.lang.NullPointerException at com.atlassian.bamboo.tag.service.NewTagsDetector.compareAndReturnNewTags(NewTagsDetector.java:39) at com.atlassian.bamboo.tag.service.TagDetectionServiceImpl.detectTagsForRepository(TagDetectionServiceImpl.java:107) at com.atlassian.bamboo.tag.service.TagDetectorThread$1.run(TagDetectorThread.java:26) at com.atlassian.bamboo.plugin.BambooPluginUtils$Runnable.call(BambooPluginUtils.java:108) at com.atlassian.bamboo.plugin.BambooPluginUtils$Runnable.call(BambooPluginUtils.java:101) at com.atlassian.bamboo.plugin.BambooPluginUtils.callUnsafeCode(BambooPluginUtils.java:55) at com.atlassian.bamboo.tag.service.TagDetectorThread.run(TagDetectorThread.java:50) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41) at java.lang.Thread.run(Thread.java:748)
There are a variety of scenarios to get a NullPointerException, realted to the content of the table VCS_TAG, regardless of whether the trigger works or not.
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available