Influxdb: Authorization failed everytime with: no user provided error

Created on 14 Sep 2017  路  3Comments  路  Source: influxdata/influxdb

Directions

Bug report

__System info:__
influxdb version: 1.3.5
os: ubuntu / xenial

__Steps to reproduce:__

  1. Create user admin with password pass as admin
  2. Set http auth to true
  3. Try to call:

curl -G "http://localhost:8086/query?u=admin&p=pass" --data-urlencode "q=SHOW DATABASES"
curl -G "http://localhost:8086/query" -u admin:pass --data-urlencode "q=SHOW DATABASES"

__Expected behavior:__ Authenticate and operate with database

__Actual behavior:__ Failed to authenticate with message:
{"error":"error authorizing query: no user provided"}

__Additional info:__ In CLI i first use auth command and then i call show databases. Get same result: ERR: error authorizing query: no user provided

Most helpful comment

@ricco24 I can't reproduce this.

Are you sure that you have set everything up properly? The order of things should be:

  • InfluxDB is running with no http-auth setup.
  • Create an admin user CREATE USER admin WITH PASSWORD 'pass' WITH ALL PRIVILEGES.
  • Shut down InfluxDB.
  • Edit the configuration file and set auth-enabled = true in the [http] section.
  • Restart InfluxDB ensuring you're using the configuration file you edited.

Then your cURL command should work:

$  curl -G "http://localhost:8086/query?u=admin&p=pass" --data-urlencode "q=SHOW DATABASES"
{"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["_internal"]]}]}]}

All 3 comments

@ricco24 I can't reproduce this.

Are you sure that you have set everything up properly? The order of things should be:

  • InfluxDB is running with no http-auth setup.
  • Create an admin user CREATE USER admin WITH PASSWORD 'pass' WITH ALL PRIVILEGES.
  • Shut down InfluxDB.
  • Edit the configuration file and set auth-enabled = true in the [http] section.
  • Restart InfluxDB ensuring you're using the configuration file you edited.

Then your cURL command should work:

$  curl -G "http://localhost:8086/query?u=admin&p=pass" --data-urlencode "q=SHOW DATABASES"
{"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["_internal"]]}]}]}

My fault. I have provisioned server via ansible and my admin user hasent got ALL privileges. Everything works fine now.

Wow it solved my problem, thanks for the solution @e-dard

Was this page helpful?
0 / 5 - 0 ratings