vultr / vultr-cli

Official command line tool for Vultr services
Apache License 2.0
469 stars 75 forks source link

Vultr-cli crashes inside cloud-init #277

Open mercymantis opened 2 years ago

mercymantis commented 2 years ago

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.

optik-aper commented 2 years ago

Thanks for the report.

Steps to reproduce:

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.