hashicorp/nomad-pack

A periodic definition with time_zone fails

agarfer1 opened this issue · 2 comments

A periodic definition that uses a time_zone fails, it can not be parsed correctly.

  periodic {
    crons             = ["0 6 * * *"]
    prohibit_overlap = true
    time_zone = "America/New_York"
  }

The same definition without the time_zone can be applied correctly.

panic: time: missing Location in call to Time.In
goroutine 1 [running]:
time.Time.In(...)
	time/time.go:1146
github.com/hashicorp/nomad-pack/internal/runner/job.(*Runner).handlePeriodicJobResponse(0xc00081f7f8?, {0x1785c18, 0xc0004dc1c8}, 0xc000645d40)
	github.com/hashicorp/nomad-pack/internal/runner/job/job.go:228 +0x28b
github.com/hashicorp/nomad-pack/internal/runner/job.(*Runner).Deploy(0xc00015e980, {0x1785c18, 0xc0004dc1c8}, 0xc00011c420)
	github.com/hashicorp/nomad-pack/internal/runner/job/job.go:145 +0x6[36](https://gitlab.com/5454[cropped]6810250090#L36)
github.com/hashicorp/nomad-pack/internal/cli.(*RunCommand).run(0xc0004e63c0)
	github.com/hashicorp/nomad-pack/internal/cli/run.go:141 +0x9c3
github.com/hashicorp/nomad-pack/internal/cli.(*RunCommand).Run(0xc0004e63c0, {0xc0001041a0?, 0xffffffffffffffff?, 0x0?})
	github.com/hashicorp/nomad-pack/internal/cli/run.go:[38](https://gitlab.com/5454[cropped]6810250090#L38) +0x218
github.com/mitchellh/cli.(*CLI).Run(0xc0004fc000)
	github.com/mitchellh/cli@v1.1.5/cli.go:262 +0x5b8
github.com/hashicorp/nomad-pack/internal/cli.Main({0xc000104180, 0x3, 0x3})
	github.com/hashicorp/nomad-pack/internal/cli/main.go:98 +0x2a5
main.main()
	github.com/hashicorp/nomad-pack/main.go:15 +0x79

Most likely you are using a docker image. The official image was assembled on alpine and does not have the tzdata package. As a workaround, you can mount the /usr/share/zoneinfo directory

@stBlackD Much appreciated! Got that added to the container to prevent that panic.