typesafehub / sbt-conductr

Typesafe ConductR plugin for sbt
Other
29 stars 22 forks source link

Sandbox run fails to start but task result is [success] #207

Closed ignasi35 closed 7 years ago

ignasi35 commented 7 years ago

In conductR 2 (macOS) it is required to create network aliases.

When the aliases are missing, the command to start the sandbox properly reports that the sandbox can't be started and it even lists the command to solve the issue. But the result of the sbt task is [success] (painted green) giving the appearance that the command succeeded:

> sandbox run 2.0.0 -n 3 --feature visualization
15:47:20.272 [pool-37-thread-4] DEBUG c.l.l.i.api.tools.ServiceDetector - Loading service discovery class: com.lightbend.lagom.internal.javadsl.server.JavadslServiceDiscovery
15:47:20.322 [pool-37-thread-2] DEBUG c.l.l.i.api.tools.ServiceDetector - Loading service discovery class: com.lightbend.lagom.internal.javadsl.server.JavadslServiceDiscovery
15:47:20.392 [pool-37-thread-1] DEBUG c.l.l.i.api.tools.ServiceDetector - Loading service discovery class: com.lightbend.lagom.internal.javadsl.server.JavadslServiceDiscovery
15:47:20.452 [pool-37-thread-3] DEBUG c.l.l.i.api.tools.ServiceDetector - Loading service discovery class: com.lightbend.lagom.internal.javadsl.server.JavadslServiceDiscovery
|------------------------------------------------|
| Starting ConductR                              |
|------------------------------------------------|
Whoops. Network address aliases are required so that the sandbox can operate as a cluster of machines.

Please run the following and then try your command again:

sudo ifconfig lo0 alias 192.168.10.1 255.255.255.0
sudo ifconfig lo0 alias 192.168.10.2 255.255.255.0
sudo ifconfig lo0 alias 192.168.10.3 255.255.255.0

[success] Total time: 4 s, completed Feb 20, 2017 3:47:23 PM <--- see here
huntc commented 7 years ago

I think that it is tricky to customise this behaviour due to the capturing of output to a logger.

@markusjura Thoughts?

markusjura commented 7 years ago

Yes, even when the conductr-cli exits with exit code 1, sbt-conductr will still report it as a success. Cannot really be fixed. Therefore, closing the issue.

longshorej commented 7 years ago

I think we can fix this actually - we just need to throw an exception if the return code doesn't equal 0 in sandboxRun. L322 returns an int after the process exits, so that should capture what we want. @markusjura does that sound reasonable? Want me to take a look at it?

https://github.com/typesafehub/sbt-conductr/blob/master/src/main/scala/com/lightbend/conductr/sbt/ConductRPlugin.scala#L322