Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Wrong error message when executing a SELECT query. #889

Open
christophmerscher opened this issue Apr 27, 2021 · 5 comments
Open

Wrong error message when executing a SELECT query. #889

christophmerscher opened this issue Apr 27, 2021 · 5 comments

Comments

@christophmerscher
Copy link

christophmerscher commented Apr 27, 2021

Hi everyone,

I'm trying to run a simple SELECT query from my database but it fails with following error message:

influxdb.exceptions.InfluxDBClientError: 403: {"error":"error authorizing query: my_user not authorized to execute statement 'SELECT * FROM \"measurements\"', requires READ on True"}

I know that my user have the required permissions because when connecting to the DB with a CLI I can execute the query. On top of that I checked the permissions with SHOW GRANTS and I could see that all requirements are satisfied (the user actualy does have all privileges).

I saw some simillar issues already (for instance in this issue) however this does not fit my case since I'm quoting the query.

My code:

results = influx_db_client.query('SELECT * FROM "measurements"')

What looks weird to me is that in the error message the qutoes around table are escaped.

  • InfluxDB version: 1.8.0
  • InfluxDB-python version: 5.3.1
  • Python version: 3.6.8
  • Operating system version: CentOS 7
@christophmerscher
Copy link
Author

Anyone else facing this issue ?

@babaMar
Copy link

babaMar commented Apr 20, 2022

Anyone else facing this issue ?

I am facing exactly the same issue. And it works with same user/pass from CLI

@christophmerscher
Copy link
Author

Hi @babaMar,

I wasn't able to solve the issue. However, when I wrote the code in Java I was able to run my query. Hence, I had the assumption that their might be an issue with the python API of influxdb.

If you can use a different language I would recommend to do so (Cause as mentioned for me when swtiching to Java it worked straight ahead).

However, I'm still curious to find out the actual cause of the issue.

@babaMar
Copy link

babaMar commented Apr 20, 2022

Hi @babaMar,

I wasn't able to solve the issue. However, when I wrote the code in Java I was able to run my query. Hence, I had the assumption that their might be an issue with the python API of influxdb.

If you can use a different language I would recommend to do so (Cause as mentioned for me when swtiching to Java it worked straight ahead).

However, I'm still curious to find out the actual cause of the issue.

I think I found the problem on my side. Most likely you're passing something else instead of the DB, and even if it doesn't exist it raises that error. requires READ on True it seems your client has True as DB

@christophmerscher
Copy link
Author

Too bad that I do not have the code base anymopre but good to know that the issues wasn't on the API but in my code base. Thx for the update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants