Influx CLI query returns "Access is Denied" even though correct token is provided


Firstly I’m quite new to the InfluxDB ecosystem so apologies if I’ve done something stupid…

I’m struggerling to query my influxDB via the CLI. Using the python API I can run queries fine, but if I type the following into the command line

influx query 'from(bucket:"HARW") |> range(start:-60m)' --org UoB -t <token>

it returns “Access is denied”. However if for example I run

influx server-config -t <the same token>

a result is returned. (If I provide server-conif with an erronous token it returns a 401 error).

Therefore I believe the token I am using is correct, however I still get “access denied” when trying to run a query from the CLI. What am I doing wrong? Cheers in advance for your help.

Hello @qe19391,
I recommend setting up and influx cli config first and they performing queries:

And then you can literally do:

Without providing credentials. Give that a try and let me know how it goes :slight_smile:

Hi @Anaisdg, thanks for the response. In the end I found my issue - my url was specified as ‘https’ not ‘http’…