vultr-cli icon indicating copy to clipboard operation
vultr-cli copied to clipboard

Vultr-cli crashes inside cloud-init

Open mercymantis opened this issue 3 years ago • 2 comments

The vultr-cli exits without any warnings/errors in the output or logs when run inside a cloud-init user-data script. It took me a while to figure out that it happens when the HOME environment variable is undefined.

A good solution would be to output a message so it appears in cloud-init-output.log.

mercymantis avatar Jul 21 '22 17:07 mercymantis

Thanks for the report.

Steps to reproduce:

  • download/extract a release
  • export Vultr API key
  • unset HOME
  • run a command (./vultr-cli instance list)
  • nothing is returned

I'll need to do some research on this since I don't see anything in our package that does use the HOME env var. Some of the vendor packages do mention it, though. When I go run main.go instance list I get this error:

build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined

But it doesn't seem like that should be an issue in the compiled binary.

optik-aper avatar Jul 21 '22 19:07 optik-aper