brooklyncentral / clocker

Apache Brooklyn cloud native infrastructure blueprints
Apache License 2.0
427 stars 66 forks source link

Riak's HAProxyController deploy failed to launch #171

Open aledsage opened 8 years ago

aledsage commented 8 years ago

Using clocker master (freshly built)...

I ran clocker+weave in AWS. I deployed the standard Riak app, but it failed for HAProxyController's launch with the error shown below.

Failed after 1.30s

STDERR
stdin: is not a tty
[ALERT] 285/122957 (1320) : [/usr/local/sbin/haproxy.main()] No enabled listener found (check the <listen> keywords) ! Exiting.

STDOUT
Executed /tmp/brooklyn-20151013-132956077-eeVr-launching_HAProxyControllerImp.sh, result 1: Execution failed, invalid result 1 for launching HAProxyControllerImpl{id=c3wACkNB}

java.lang.IllegalStateException: Execution failed, invalid result 1 for launching HAProxyControllerImpl{id=c3wACkNB}
    at org.apache.brooklyn.entity.software.base.lifecycle.ScriptHelper.logWithDetailsAndThrow(ScriptHelper.java:388)
    at org.apache.brooklyn.entity.software.base.lifecycle.ScriptHelper.executeInternal(ScriptHelper.java:377)
    at org.apache.brooklyn.entity.software.base.lifecycle.ScriptHelper$8.call(ScriptHelper.java:287)
    at org.apache.brooklyn.entity.software.base.lifecycle.ScriptHelper$8.call(ScriptHelper.java:285)
    at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:342)
    at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:468)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

The stdin was:

export RUN_DIR="/usr/local/etc/haproxy"
mkdir -p $RUN_DIR
cd $RUN_DIR
/usr/local/sbin/haproxy -D -p /usr/local/etc/haproxy/pid -f /usr/local/etc/haproxy/haproxy.cfg -sf  $(cat /usr/local/etc/haproxy/pid)
aledsage commented 8 years ago

Invoking the restart() effector on the HAProxyController worked - it came up without error.

grkvlt commented 8 years ago

Looks like a race condition on startup? Maybe tweak the entity with some delays/checks?