gbatalski/jclouds-plugin

Cassandra multi-node + chef-solo build fails

Closed this issue · 3 comments

Started by user anonymous
Building remotely on template1-us-east-1_i-726a990b in workspace /jenkins/workspace/SimpleTest2
Queuing cloud instance: #0 3, awsec2 template1
Queuing cloud instance: #1 3, awsec2 template1
Queuing cloud instance: #2 3, awsec2 template1
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 2 column 2
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 2 column 2
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 2 column 2
Terminating the Node : us-east-1/i-685ead11
Terminating the Node : us-east-1/i-745ead0d
Terminating the Node : us-east-1/i-725ead0b
FATAL: One or more nodes couldn't be processed.
java.lang.IllegalStateException: One or more nodes couldn't be processed.
at edu.kit.aifb.gb.jenkins.plugins.chef.SimpleParallelExecutor.apply(SimpleParallelExecutor.java:93)
at edu.kit.aifb.gb.jenkins.plugins.chef.ChefBuilder.build(ChefBuilder.java:77)
at edu.kit.aifb.gb.jenkins.plugins.chef.JCloudsEnabledBuilder.perform(JCloudsEnabledBuilder.java:61)
at edu.kit.aifb.gb.jenkins.plugins.chef.ChefBuilder.perform(ChefBuilder.java:65)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
at hudson.model.Run.run(Run.java:1438)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)

Ich sehe es mir gleich an

on ubuntu 12.04 () the openjdk installation folder has got a arch suffix. So the link to /usr/lib/jvm/java-6-openjdk necessary by jclouds init script is broken.

Adding the following snippet at the end of init script within the global config should do the trick:

mkdir -p /usr/lib/jvm

if [ "`uname -a | grep x86_64`" == '' ]; then
       arch="i386"
else  
       arch="amd64"
fi
echo "ln -Fs /usr/lib/jvm/java-6-openjdk-$arch  /usr/lib/jvm/java-6-openjdk" | sh

The issue is caused by the following bug: the browser textbox with the "json configuration" adds quotation marks at the beginning and end of the json object. Thus, the object is interpreted as a string.

Solution: add a comment in the first line of the json script
// bugfix comment
{
"cassandra":{
"java_heap_size_min" : "32M",
"java_heap_size_max" : "128M",
"java_heap_size_eden" : "32M",
"home_dir" : "/usr/share/cassandra"
},
"java": {
"install_flavor" : "sun"
},
"run_list": [
"recipe[cassandra::install_from_package]",
"recipe[cassandra::mx4j]",
"recipe[cassandra::jna_support]"
]
}