Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autopilot health JSON containing non-JSON #24653

Closed
EtienneBruines opened this issue Dec 12, 2024 · 1 comment · Fixed by #24655
Closed

Autopilot health JSON containing non-JSON #24653

EtienneBruines opened this issue Dec 12, 2024 · 1 comment · Fixed by #24655
Assignees
Labels
hcc/jira stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli type/bug

Comments

@EtienneBruines
Copy link
Contributor

Nomad version

Nomad v1.9.3
BuildDate 2024-11-11T16:35:41Z
Revision d92bf10

Operating system and Environment details

Ubuntu 22.04.5 LTS

Issue

The following command should return a JSON object, but it returns the non-JSON output as well.

nomad operator autopilot health -json

Reproduction steps

  • Run the command

Expected Result

  • The JSON object only, like this:
{"Healthy":true,"FailureTolerance":1,"Servers":[{"LastContact":"48.28µs","ID":"62a2d14d-8bc1-00bc-e53d-eb3140150af8","Name":"hashivault-server-ham.q-mex.net.global","Address":"172.16.1.111:4647","SerfStatus":"alive","Version":"1.9.3","Leader":false,"LastTerm":2420762,"LastIndex":4570954,"Healthy":true,"Voter":true,"StableSince":"2024-12-12T01:48:26Z"},{"LastContact":"17.605323ms","ID":"173ca448-7e94-fec9-f35b-76086a1804e9","Name":"hashivault-server-haj.q-mex.net.global","Address":"172.19.1.100:4647","SerfStatus":"alive","Version":"1.9.3","Leader":false,"LastTerm":2420762,"LastIndex":4570954,"Healthy":true,"Voter":true,"StableSince":"2024-12-12T01:48:26Z"},{"LastContact":"0s","ID":"db9723c5-bed0-8ae2-9420-662cbcdaf37d","Name":"hashivault-server-del.q-mex.net.global","Address":"172.18.1.100:4647","SerfStatus":"alive","Version":"1.9.3","Leader":true,"LastTerm":2420762,"LastIndex":4570954,"Healthy":true,"Voter":true,"StableSince":"2024-12-12T01:48:26Z"}],"Leader":"db9723c5-bed0-8ae2-9420-662cbcdaf37d","Voters":["db9723c5-bed0-8ae2-9420-662cbcdaf37d","173ca448-7e94-fec9-f35b-76086a1804e9","62a2d14d-8bc1-00bc-e53d-eb3140150af8"]}

Actual Result

{"Healthy":true,"FailureTolerance":1,"Servers":[{"LastContact":"48.28µs","ID":"62a2d14d-8bc1-00bc-e53d-eb3140150af8","Name":"hashivault-server-ham.q-mex.net.global","Address":"172.16.1.111:4647","SerfStatus":"alive","Version":"1.9.3","Leader":false,"LastTerm":2420762,"LastIndex":4570954,"Healthy":true,"Voter":true,"StableSince":"2024-12-12T01:48:26Z"},{"LastContact":"17.605323ms","ID":"173ca448-7e94-fec9-f35b-76086a1804e9","Name":"hashivault-server-haj.q-mex.net.global","Address":"172.19.1.100:4647","SerfStatus":"alive","Version":"1.9.3","Leader":false,"LastTerm":2420762,"LastIndex":4570954,"Healthy":true,"Voter":true,"StableSince":"2024-12-12T01:48:26Z"},{"LastContact":"0s","ID":"db9723c5-bed0-8ae2-9420-662cbcdaf37d","Name":"hashivault-server-del.q-mex.net.global","Address":"172.18.1.100:4647","SerfStatus":"alive","Version":"1.9.3","Leader":true,"LastTerm":2420762,"LastIndex":4570954,"Healthy":true,"Voter":true,"StableSince":"2024-12-12T01:48:26Z"}],"Leader":"db9723c5-bed0-8ae2-9420-662cbcdaf37d","Voters":["db9723c5-bed0-8ae2-9420-662cbcdaf37d","173ca448-7e94-fec9-f35b-76086a1804e9","62a2d14d-8bc1-00bc-e53d-eb3140150af8"]}
Healthy: true
FailureTolerance: 1
Leader: db9723c5-bed0-8ae2-9420-662cbcdaf37d
Voters:  
        db9723c5-bed0-8ae2-9420-662cbcdaf37d
173ca448-7e94-fec9-f35b-76086a1804e9
62a2d14d-8bc1-00bc-e53d-eb3140150af8
Servers: 
ID                                    Name                                    Address            SerfStatus  Version  Leader  Voter  Healthy  LastContact  LastTerm  LastIndex  StableSince
62a2d14d-8bc1-00bc-e53d-eb3140150af8  hashivault-server-ham.q-mex.net.global  172.16.1.111:4647  alive       1.9.3    false   true   true     48.28µs      2420762   4570954    2024-12-12 01:48:26 +0000 UTC
173ca448-7e94-fec9-f35b-76086a1804e9  hashivault-server-haj.q-mex.net.global  172.19.1.100:4647  alive       1.9.3    false   true   true     17.605323ms  2420762   4570954    2024-12-12 01:48:26 +0000 UTC
db9723c5-bed0-8ae2-9420-662cbcdaf37d  hashivault-server-del.q-mex.net.global  172.18.1.100:4647  alive       1.9.3    true    true   true     0s           2420762   4570954    2024-12-12 01:48:26 +0000 UTC

Job file (if appropriate)

Irrelevant

Nomad Server logs (if appropriate)

Irrelevant

Nomad Client logs (if appropriate)

Irrelevant

@jrasell
Copy link
Member

jrasell commented Dec 12, 2024

Hi @EtienneBruines and thanks for raising this bug. I have raised a PR to fix this which is linked to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hcc/jira stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli type/bug
Projects
Development

Successfully merging a pull request may close this issue.

2 participants