Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
TAGS
Community showcase
Published in Bamboo

Bamboo 7.1 is here and is packed with value!

I'm happy to announce that Bamboo 7.1 has been released and it’s overflowing with awesome new features. Top-voted issues First and foremost, a bunch of JAC top voted issues has been delivered - y...

918 views 4 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you