influxdata / community-templates

InfluxDB Community Templates: Quickly collect & analyze time series data from a range of sources: Kubernetes, MySQL, Postgres, AWS, Nginx, Jenkins, and more.

Home Page:https://www.influxdata.com/products/influxdb-templates/gallery/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better error message when improper token used

alsargent opened this issue · comments

Is your template request related to a problem? Please describe.

If you try to import a template with a token that's NOT an all-access token, you'll get an error: "Organization not found". This is a misleading error message. It's not necessarily that the org name doesn't exist. It's that the token used doesn't have enough privileges to look up all errors.

For example, my cloud instance has a token that does read/write on all buckets. And, in order to implement least-privilege (i.e., no more privileges than needed), my cloud instance doesn't usually have an all-access token. When I used this token to try to implement a template, I got the "org not found" issue.

Describe the solution you'd like

When a token doesn't have sufficient privileges to look up an org, deliver an error message:

Error: Token used doesn't have permissions to look up organizations. Use an all-access token instead.

Additional context

Although it was template import that lead me to this issue, I found the same problem in using the influx command. So, this issue might be copied, or moved, over to that repo as well.