influx client with type=flux doesn't authenticate
I'm running influxdb 1.7.3 with
[http]
flux-enabled = true
Running influx client:
influx -type=flux -host localhost4 -port 8086 -database my_database -username my_user -password <snip>
These crentials work without -type=flux. However when running with -type=flux and submitting a query:
Connected to http://localhost4:8086 version 1.7.3
InfluxDB shell version: 1.7.3
Enter a Flux query
> from(bucket:"my_database/my_measurement")
Error: client error: 401 Unauthorized
tcpdump shows no Authorization header being sent (it is being sent without -type=flux):
POST /api/v2/query HTTP/1.1
Host: localhost4:8086
User-Agent: Go-http-client/1.1
Content-Length: 384
Accept: text/csv
Content-Type: application/json
Accept-Encoding: gzip
{"spec":{"operations":[{"kind":"from","id":"from0","spec":{"bucket":"my_database/my_measurement"}}],"edges":null,"resources":{"priority":"high","concurrency_quota":0,"memory_bytes_quota":0},"now":"2019-02-06T15:28:54.739736155Z"},"query":"","type":"flux","dialect":{"header":true,"delimiter":"\u0000","commentPrefix":"#","dateTimeFormat":"RFC3339","annotations":["datatype","group","default"]}}
16:28:54.739963 IP 127.0.0.1.8086 > 127.0.0.1.43728: Flags [P.], seq 1:354, ack 564, win 386, options [nop,nop,TS val 1931512979 ecr 1931512979], length 353
E....E@[email protected]................]...w...........
s ..s ..HTTP/1.1 401 Unauthorized
Content-Type: text/csv
Request-Id: <snip>
Www-Authenticate: Basic realm="InfluxDB"
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.7.3
X-Request-Id: <snip>
Date: Wed, 06 Feb 2019 15:28:54 GMT
Content-Length: 49
error
unable to parse authentication credentials
Please help!
Confirm this bug, happens for me too.
As mentioned here: https://community.influxdata.com/t/how-to-building-flux-queries-in-chronograf/7440/5 this is also happining to me.
version: influxdb-1.7.4-1.x86_64
Thanks for the report and the issue is indeed that no credentials are being sent when using the -type=flux flag.
This will be resolved in v1.7 via #13067