mrusme / planor

The Cloud Aviator: TUI client for cloud services (AWS, Vultr, Heroku, Render.com, Fleek, ...)
https://xn--gckvb8fzb.com
GNU General Public License v3.0
69 stars 4 forks source link

Vultr API login failure #1

Open paulie-g opened 2 years ago

paulie-g commented 2 years ago

Following the instructions exactly, refreshing the data yields this error (and no data obviously):

gave up after 4 attempts, last error : Get "https://api.vultr.com/v2/instances": oauth2: token expired and refresh token is not set
mrusme commented 2 years ago

Please make sure the API key you're using is still valid:

echo $VULTR_API_KEY
# check the key and if in doubt replace it with a new one
planor -p VULTR_API_KEY -c vultr

Just tested it myself and it works without any issue if the API key is valid.

paulie-g commented 2 years ago

Yes, the key is valid. For me, it works with curl:

curl "https://api.vultr.com/v2/instances"   -X GET   -H "Authorization: Bearer ${VULTR_API_KEY}"

.. does not work with planor, as described. Fresh build today from master. I was just trying planor out along with some of your other projects after coming across superhighway84. If it's enough for you that it works for you, that's perfectly fine. It really doesn't matter.

mrusme commented 2 years ago

@paulie-g could you generate a new token on the Vultr web UI and try it with that one? Also, could you please paste the exact command how you run planor?

paulie-g commented 2 years ago

I kept regenerating the API keys. To run planor, I copy-pasted from your response above just to be sure. I even tried hard-coding vultr and the api key into planor.go. I didn't have time to figure out where to insert logging to see the request actually being sent. If there's an easy way to instrument something like that in Go, let me know and I'll try it. Otherwise we can assume it's some weird heisenbug, possibly machine-specific, that's not worth tracking down.

As an aside, passing in '-c Vultr' rather than '-c vultr' results in a segfault.

paulie-g commented 2 years ago

Tried starting planor with HTTP_PROXY and HTTPS_PROXY, but it must use something other than go's http package and doesn't appear to respect them.