Prevent Bamboo from crashing during test with java.lang.IllegalMonitorStateException


While attempting to run a KitchenCI test on Bamboo, we get the following error:

Error occurred while running Task 'Kitchen Convergence Test(5)' of type net.bytesource.bamboo.cheftesttask:kitchenTestTask.
22-Mar-2016 16:47:21 java.lang.IllegalMonitorStateException
22-Mar-2016 16:47:21 at java.lang.Object.wait(Native Method)
22-Mar-2016 16:47:21 at net.bytesource.bamboo.cheftesttask.KitchenTestTask.execute(KitchenTestTask.java:25)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$124(TaskExecutorImpl.java:269)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:202)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:269)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:108)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:74)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:215)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:139)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl$1.call(BuildAgentControllerImpl.java:130)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:215)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:129)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:137)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
22-Mar-2016 16:47:21 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
22-Mar-2016 16:47:21 at java.lang.Thread.run(Thread.java:745)


I have tried tracking the cause of this error down but I am having zero luck figuring it out. I need to know how I can prevent, suppress, or otherwise ignore this error so that Bamboo will continue testing as configured.

1 answer

I am having the exact same problem.  Have you found a resolution yet?

 

The problem exists in Test Tasks for Chef Cookbooks v1.1 addon. The short answer is to downgrade versions to v1.0 and do not upgrade until the developer fixes the problem. To downgrade:

  1. Download the version 1.0 addon here:  https://marketplace.atlassian.com/download/plugins/net.bytesource.bamboo.cheftesttask/version/1
  2. Go to the Settings page in Bamboo (gear icon in top right).
  3. Under Add-Ons on the left, go to Manage add-ons.
  4. Remove the Test Tasks for Chef Cookbooks v1.1 addon.
  5. Choose Upload addon option. Provide the file you downloaded.
  6. Disregard Bamboo whining about alleged incompatibility. In this case, latest is definitely not the greatest.
  7. Profit!

Note that you should not have to go back into all of your build plans and re-add all the Chef related tasks. They should still be there.

The long answer, in case you're crafty with Java programming, is that there is a bug in the TaskResult execute(TaskContext taskContext) function of the KitchenTestTask.class file on line 25, as noted by the error in the log:

net.bytesource.bamboo.cheftesttask.KitchenTestTask.execute(KitchenTestTask.java:25)

I compared this file to the one in version 1.0 and found a block of code that has been added. Unfortunately, it appears as though code comments are an alien concept to this developer, so I'm not sure what they're trying to accomplish by adding the highlighted block:

kitchen_cheftask_fail.PNG

The above block of highlighted code does not exist in v1.0 and the release notes say nothing of adding this block into the code. I submitted a lengthy request to the developer of the plugin to fix the problem, but have yet to see any progress. We are running Bamboo (latest) on CentOS 6.7 Final with Java JDK 1.8.0u74. If the Developer can't (or won't) fix it, then we'll probably end up forking the plugin and and maintaining our own copy of it.

Ah, perfect.  that did the trick,  Thanks so much for your help!

 

If you do fork i'd love to know about it.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,786 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you