Tapad / sbt-marathon

An sbt plugin for launching application containers on the Mesosphere Marathon platform. (archived as unmaintained)
BSD 3-Clause "New" or "Revised" License
22 stars 3 forks source link

Debug marathonServiceRestart task #4

Closed jeffreyolchovy closed 7 years ago

jeffreyolchovy commented 7 years ago

This issue is the formal documentation and verification of the following error when invoking the marathonServiceRestart task:

> marathonServiceRestart
[trace] Stack trace suppressed: run last project/*:marathonServiceRestart for the full output.
[error] (server/*:marathonServiceRestart) Unable to restart application project/version
[error] Total time: 1 s, completed May 31, 2017 5:51:14 AM
> last project/*:marathonServiceRestart
java.lang.RuntimeException: Unable to restart application project/version
    at scala.sys.package$.error(package.scala:27)
    at sbtmarathon.MarathonSettings$$anonfun$defaultSettings$7.apply(MarathonSettings.scala:130)
    at sbtmarathon.MarathonSettings$$anonfun$defaultSettings$7.apply(MarathonSettings.scala:117)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

As far as I can tell, this regression was introduced when migrating logic from the internal plugin to the oss plugin.

This issue effects the current main line. Originally reported @ https://github.com/Tapad/sbt-marathon/pull/3#issuecomment-304919319 and verified against v0.1.1 and the HEAD of master.

jeffreyolchovy commented 7 years ago

For app restarts, use:

POST /v2/apps/{appId}/restart: Rolling restart of all tasks of the given app

Currently, we are sending an empty POST request to the application instance URL, which, afaict, will just result with an unspecified failure. Our closed source plugin was executing this request correctly with the proper /restart terminated URL.

For more info, see https://mesosphere.github.io/marathon/docs/rest-api.html#user-content-post-v2appsappidrestart.