hashicorp / hcdiag

hcdiag is a CLI utility that collects and bundles product and platform diagnostics. It supports Consul, Nomad, TFE, and Vault.
Mozilla Public License 2.0
56 stars 8 forks source link

Using hcdiag v0.5.0 With -config for Duration and Interval, Nomad and Consul Debug Runs Twice #315

Open MikaelHashiCorp opened 1 year ago

MikaelHashiCorp commented 1 year ago

What is the bug?
When I create an hcdiag.hcl with the following to run Consul and Nomad for 10 second duration at 5 second interval:

product "consul" {
  consul-debug {
    archive  = "true" // The argument \"archive\" is required
    duration = "10s"
    interval = "05s"
  }
}

product "nomad" {
  nomad-debug {
    duration = "10s"
    interval = "05s"
  }
}

Nomad debug and Consul debug run twice.

hcdiag-nomad-2runs

Nomad runs first for the 10s/5s setting: hcdiag-nomad_d10-i5 Then at the default 2m/30s setting: hcdiag-nomad_d2-i30 Creating two Nomad debug bundles (see first image above).

What version are you using?
hcdiag v0.5.0-rc2 and hcdiag v0.5.0 Nomad v1.4.3 Consul v1.14.4

Which HashiCorp products does this affect?
Hcdiag, Nomad, Consul

When does the error occur?
Share steps to reproduce the behavior, e.g.,

  1. Spin up an instance of Ubuntu 20.04.5 LTS.
  2. Log into the OS.
  3. Download hcdiag_0.5.0_linux_amd64.zip:
curl  https://releases.hashicorp.com/hcdiag/0.5.0/hcdiag_0.5.0_linux_amd64.zip -o hcdiag_0.5.0.zip
  1. Unzip hcdiag_0.5.0_linux_amd64.zip:
unzip hcdiag_0.5.0.zip
  1. Create hcdiag.hcl with duration and interval options:
product "consul" {
  consul-debug {
    archive  = "true" // The argument \"archive\" is required
    duration = "10s"
    interval = "05s"
  }
}

product "nomad" {
  nomad-debug {
    duration = "10s"
    interval = "05s"
  }
}
  1. Run hcdiag command:
hcdiag run -consul -nomad -config hcdiag.hcl
  1. Untar hcdiag bundle
tar -xvzf hcdiag*.tar.gz
  1. Review the directories and files from the bundle
ls -al hcdiag-2023*
drwxrwxr-x 2 ubuntu ubuntu       32 Feb  3 00:46 ConsulDebug501501014
drwxrwxr-x 2 ubuntu ubuntu       32 Feb  3 00:46 ConsulDebug964981707
-rw-rw-r-- 1 ubuntu ubuntu   178972 Feb  3 00:46 journald-consul.log
-rw-rw-r-- 1 ubuntu ubuntu 12211860 Feb  3 00:46 journald-nomad.log
-rw-rw-r-- 1 ubuntu ubuntu     9639 Feb  3 00:46 manifest.json
drwxrwxr-x 3 ubuntu ubuntu       24 Feb  3 00:46 NomadDebug3468325037
drwxrwxr-x 3 ubuntu ubuntu       24 Feb  3 00:46 NomadDebug3660757105
-rw-rw-r-- 1 ubuntu ubuntu   949446 Feb  3 00:46 results.json

What is the expected behavior?
Only one bundle each from Nomad and Consul, and only the 10s/5s bundles.

Is there a workaround?
No.

How does this impact you?

Are there any deadlines?
No.

Is there any additional context?
No.

aliciaclark1066 commented 1 year ago

Thanks for submitting this request! We'll triage your comments once the team can focus on hcdiag again. :)