nicgrayson / terraform-provider-marathon

a Terraform (http://terraform.io) provider for interacting with Marathon (https://mesosphere.github.io/marathon/)
MIT License
59 stars 24 forks source link

latest marathon release breaks terraform runs #25

Closed bodiug closed 8 years ago

bodiug commented 8 years ago

Since upgrading to Marathon release 1.1.1 I'm getting the following error from terraform:

2016/04/22 10:26:41 [DEBUG] terraform-provider-marathon: 2016/04/22 10:26:41 apiCall(): failed to unmarshall the response from marathon, error: json: cannot unmarshal object into Go value of type []*marathon.DeploymentStep
2016/04/22 10:26:41 [DEBUG] terraform-provider-marathon: 2016/04/22 10:26:41 [ERROR] waiting for application for deployment &{f129765e-c0d2-447e-8f7f-bb0da8d9cd27 2016-04-22T08:26:41.538Z} invalid response from Marathon
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalWriteState
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalApplyProvisioners
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalIf
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalWriteDiff
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalIf
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalWriteState
2016/04/22 10:26:41 [DEBUG] root: eval: *terraform.EvalApplyPost
2016/04/22 10:26:41 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* marathon_app.foo: invalid response from Marathon
2016/04/22 10:26:41 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* marathon_app.foo: invalid response from Marathon
2016/04/22 10:26:41 [ERROR] root: eval: *terraform.EvalOpFilter, err: 1 error(s) occurred:

* marathon_app.foo: invalid response from Marathon
2016/04/22 10:26:41 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* marathon_app.foo: invalid response from Marathon
2016/04/22 10:26:41 [TRACE] [walkApply] Exiting eval tree: marathon_app.foo
2016/04/22 10:26:41 [DEBUG] vertex provider.marathon (close), got dep: marathon_app.foo
2016/04/22 10:26:41 [DEBUG] waiting for all plugin processes to complete...
Error applying plan:

1 error(s) occurred:

* marathon_app.foo: invalid response from Marathon

The .tf files were not changed and worked fine before.

emicklei commented 8 years ago

It appears that marathon 1.1.1 returns a response on /v2/deployments that does not match its own documented spec.

To be more specific, the steps fields in https://mesosphere.github.io/marathon/docs/rest-api.html#get-v2-deployments which is implemented by https://github.com/gambol99/go-marathon/blob/master/deployment.go#L31 cannot be populated by the response of marathon

"steps":[{"actions":[{"type":"StartApplication","app":"/foo"}]},{"actions":[{"type":"ScaleApplication","app":"/foo"}]}]
astawiarski commented 8 years ago

We've got the same. Looks like it's related to changes to Marathon API responses that are not reflected in the provider yet.

bodiug commented 8 years ago

It's actually a bug in Marathon itself and fixed upstream already. ;)

https://github.com/mesosphere/marathon/issues/3820

adamdecaf commented 8 years ago

@guidob Are you still running into this on the latest marathon?

bodiug commented 8 years ago

@adamdecaf it's broken on 1.0 to 1.1.1. Still waiting for an upstream release with the fix. :|

bodiug commented 8 years ago

This is now working again after upgrading to terraform 0.7.3, marathon 1.1.2 and re-compiling terraform-marathon-provider.