brooklyncentral / clocker

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

HAProxyController reports failure when stopping if network has already been stopped #319

Open johnmccabe opened 8 years ago

johnmccabe commented 8 years ago

Deploying the HAProxyController in an app with other containers results in the proxy going on fire when the application is stopped due to the bridged network already have being removed by the point the proxy entity attempts to shutdown.

Thrown when stopping (machine).

Failure running task ssh: ( if test "$UID" -eq 0; then ( docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge ); else sudo -E -n -S -- docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge; fi ) (dPIe2RYs): SSH task ended with exit code 1 when 0 was required, in Task[ssh: ( if test "$UID" -eq 0; then ( docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge ); else sudo -E -n -S -- docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge; fi )]@dPIe2RYs: ( if test "$UID" -eq 0; then ( docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge ); else sudo -E -n -S -- docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge; fi )

Comparing with a VanillaDockerApplication this same error is ignored with the entity proceeding to shutdown without throwing an error.

Thrown when stopping (process)

Error invoking stop at DockerContainerImpl{id=I2fmfeD9}: SSH task ended with exit code 1 when 0 was required, in Task[ssh: ( if test "$UID" -eq 0; then ( docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge ); else sudo -E -n -S -- docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge; fi )]@Tdv5ySdI: ( if test "$UID" -eq 0; then ( docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge ); else sudo -E -n -S -- docker network inspect --format="{{ len .Containers }}" wxw6w38u_bridge; fi )

Invoking the stop effector a second time clears removes the app.