Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

up/downscaling broken #302

Closed
ygersie opened this issue Aug 28, 2017 · 9 comments
Closed

up/downscaling broken #302

ygersie opened this issue Aug 28, 2017 · 9 comments

Comments

@ygersie
Copy link

ygersie commented Aug 28, 2017

It seems Nomad 0.6 introduced differences between what is rendered by the CLI with nomad run -output job.hcl and what is retrieved by inspecting the API. The latter has an incorrect representation of the job which leads to the following error if no update { } stanza is configured:

2017/08/28 23:54:51.703105 [ERR] http: Request /v1/jobs?region=ams1&wait=60000ms, error: 1 error(s) occurred:

* Task group master validation failed: 1 error(s) occurred:

* 4 error(s) occurred:

* Invalid health check given: ""
* Healthy deadline must be greater than zero: 0s
* Minimum healthy time must be less than healthy deadline: 0s > 0s
* Stagger must be greater than zero: 0s

The API returns the following update stanza:

"Update": {
  "Stagger": 0,
  "MaxParallel": 0,
  "HealthCheck": "",
  "MinHealthyTime": 0,
  "HealthyDeadline": 0,
  "AutoRevert": false,
  "Canary": 0
}

while the CLI renders this:

"Update": null

This seems to me like a bug in the Nomad API but posting it here as it has broken the hashi-ui functionality. Current workaround for me is providing a max_parallel but this has the side effect of introducing CLI rendered defaults for stagger, health_check, min_healthy_time and healthy_deadline.

@jippi
Copy link
Owner

jippi commented Aug 29, 2017

It works for me, though the job need to be submitted through the recent nomad cli to work

@jippi jippi closed this as completed Aug 29, 2017
@ygersie
Copy link
Author

ygersie commented Aug 29, 2017

Nope, it's not fixed. Try posting a job without an update { } stanza configured

@jippi
Copy link
Owner

jippi commented Aug 30, 2017

It works for me on 0.5, 0.6.0 and 0.6.2 with latest hashi-ui

Did you try on 0.17.0 ?

jippi added a commit that referenced this issue Aug 30, 2017
@jippi
Copy link
Owner

jippi commented Aug 30, 2017

Can you try to test with #304 ? there should be a docker image build for the PR in a few minutes

@ygersie
Copy link
Author

ygersie commented Aug 30, 2017

@jippi tested but unfortunately doesn't work. I think an ugly hack is required to check if

"Update": {
    "Stagger": 0,
    "MaxParallel": 0,
    "HealthCheck": "",
    "MinHealthyTime": 0,
    "HealthyDeadline": 0,
    "AutoRevert": false,
    "Canary": 0
  }

MaxParallel is set to 0 and if so hashui needs to adjust the JSON to reflect: "Update": null

@ygersie
Copy link
Author

ygersie commented Aug 30, 2017

According to Nomad's changelog:
deployment: Specifying an update stanza with a max_parallel of zero is now a validation error. Please update the stanza to be greater than zero or remove the stanza as a zero parallelism update is not valid.
So it's invalid to specify MaxParallel 0 now anyway.

@ygersie
Copy link
Author

ygersie commented Aug 30, 2017

This should however be fixed upstream but haven't created an issue of it yet.

@jippi
Copy link
Owner

jippi commented Aug 30, 2017

I don't want to get in a habit of working around Nomad bugs in hashi-ui, so would recommend pushing it out to Nomad for a fix, asap, so it can be included in 0.6.3 :)

@ygersie
Copy link
Author

ygersie commented Aug 30, 2017

Logged an issue upstream ^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants