Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

influx v1 auth ls fails with unable to decode response content type "text/html" #492

Open
lourot opened this issue Apr 6, 2023 · 8 comments

Comments

@lourot
Copy link

lourot commented Apr 6, 2023

Context: I'm following https://docs.influxdata.com/influxdb/cloud/tools/grafana/?t=InfluxQL in order to be able to query InfluxDB from Grafana using InfluxQL instead of Flux. My InfluxDB is an InfluxDB Cloud Free Plan

Steps to reproduce

I did

$ influx v1 dbrp create --db 030solutions --rp 030solutions --bucket-id a46c7dcec28c0316 --default

but then I can't create a v1 user/password as any command involving influx v1 auth fails with:

$ influx v1 auth ls
Error: could not find Authorizations for specified arguments: unable to decode response content type "text/html"

Version

influx binary downloaded from https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.1-linux-amd64.tar.gz running on Ubuntu 22.04

Additional info

$ influx version
Influx CLI dev (git: none) build_date: 2023-04-05T17:15:07Z

$ influx bucket ls
ID                      Name                    Retention       Shard group duration    Organization ID         Schema Type
0dbbb9df499fe0dc        _monitoring             168h0m0s        n/a                     d9a6d519ad91c068        implicit
2905109a0d9e4d8b        _tasks                  72h0m0s         n/a                     d9a6d519ad91c068        implicit
a46c7dcec28c0316        processing_pipeline     720h0m0s        n/a                     d9a6d519ad91c068        implicit

$ influx v1 dbrp ls
ID                      Database        Bucket ID               Retention Policy        Default Organization ID
0b017fc7da9fd000        030solutions    a46c7dcec28c0316        030solutions            true    d9a6d519ad91c068

VIRTUAL DBRP MAPPINGS (READ-ONLY)
----------------------------------
ID      Database        Bucket ID       Retention Policy        Default Organization ID

// CC @nikste

@lourot
Copy link
Author

lourot commented Apr 6, 2023

Same problem on a paid AWS InfluxDB subscription. Same problem when running the client on Debian 11 instead of Ubuntu 22.04

$ influx v1 auth ls --http-debug
2023/04/06 11:33:24 
GET /private/legacy/authorizations HTTP/1.1
Host: eu-central-1-1.aws.cloud2.influxdata.com
User-Agent: influx/dev (linux) Sha/none Date/2023-04-05T17:15:07Z
Accept: application/json
Authorization: Token ********
Accept-Encoding: gzip


2023/04/06 11:33:24 
HTTP/2.0 200 OK
Content-Type: text/html
Date: Thu, 06 Apr 2023 11:33:24 GMT
Etag: W/"6414b785-4cf"
Last-Modified: Fri, 17 Mar 2023 18:55:01 GMT
Strict-Transport-Security: max-age=15724800; includeSubDomains
Vary: Accept-Encoding
X-Influxdb-Build: Cloud
X-Influxdb-Request-Id: ffac5f0bab319aac83a28e713458dd55

<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="description" content="InfluxDB is a time series platform, purpose-built by InfluxData for storing metrics and events, provides real-time visibility into stacks, sensors, and systems."><title>InfluxDB</title><base href="/"><script>(function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', 'GTM-NXMTGSW');</script><script>window.userpilotSettings = {token: '72cf72g10'}</script><script src="https://js.userpilot.io/sdk/latest.js"></script><base href=""><link rel="icon" href="/favicon.ico"></head><body><div id="react-root" data-basepath=""></div><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NXMTGSW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><script defer="defer" src="/static/b5d622cfc1.js"></script></body></html>
Error: could not find Authorizations for specified arguments: unable to decode response content type "text/html"

@lourot
Copy link
Author

lourot commented Apr 6, 2023

Also if I try to just set up Grafana without username and password, it fails with error reading InfluxDB. Status Code: 501, which is also exactly what I see if I do:

$ influx v1 shell --http-debug
[...]
Connected to InfluxDB cloud2 2.0
2023/04/06 13:40:08 
GET /query?db=&q=SHOW+DATABASES&rp= HTTP/1.1
Host: eu-central-1-1.aws.cloud2.influxdata.com
User-Agent: influx/dev (linux) Sha/none Date/2023-04-05T17:15:07Z
Accept: application/json
Authorization: Token ********
Accept-Encoding: gzip


2023/04/06 13:40:08 
HTTP/2.0 501 Not Implemented
Content-Length: 54
Content-Type: application/json; charset=utf-8
Date: Thu, 06 Apr 2023 11:40:09 GMT
Request-Id: da020d107f4f66947e97cb3903fb472b
Strict-Transport-Security: max-age=15724800; includeSubDomains
Trace-Id: 6a49282f1ca08b3e
Trace-Sampled: false
Vary: Accept-Encoding
X-Influxdb-Build: Cloud
X-Influxdb-Request-Id: da020d107f4f66947e97cb3903fb472b
X-Platform-Error-Code: not implemented
X-Request-Id: da020d107f4f66947e97cb3903fb472b

{"code":"not implemented","message":"not implemented"}

@lourot
Copy link
Author

lourot commented Apr 6, 2023

No problem when running influxdb myself in a local docker container:

$ docker run -p 8086:8086 -v myInfluxVolume:/var/lib/influxdb2 influxdb:latest
$ influx config create --config-name 030_local_docker --host-url http://localhost:8086 --org 030Solutions --token ********
$ influx v1 auth ls
ID      Description     Username        v2 User Name    v2 User ID      Permissions

So this seems to be related to how InfluxDB Cloud gets deployed on AWS.

@jeffreyssmith2nd
Copy link
Contributor

The Cloud specific documentation needs to be updated, it does not support the V1 auth styles. To setup Grafana using InfluxQL against Cloud2, you can follow that guide and make sure you use token-authentication. You'll need to create an appropriately scoped API token to use.

@lourot
Copy link
Author

lourot commented Apr 6, 2023

Thanks a lot! Indeed I got the connection between Grafana and InfluxDB working with Flux (v2) instead of InfluxQL (v1), but for context: with Flux I can't get Grafana Geomap to work, which is how I ended up wanting to go back to v1, which is how I ended up stumbling upon this. Anyway, good to know that InfluxDB Cloud doesn't support v1, thanks again.

@lourot
Copy link
Author

lourot commented Apr 17, 2023

For reference I managed to get Grafana Geomap working with InfluxDB over Flux (v2), see grafana/grafana#54071 (comment)

Should we keep this issue open in order to document that Influx Cloud doesn't support v1 anymore, and rename the issue accordingly?

@jeffreyssmith2nd
Copy link
Contributor

Should we keep this issue open in order to document that Influx Cloud doesn't support v1 anymore

Just to be clear, the TSM based Cloud product should support V1 querying through InfluxQL. It requires that you use V2 Auth (tokens) but you should still be able to query using InfluxQL via DBRP Mappings.

@lourot
Copy link
Author

lourot commented May 3, 2023

Thanks, but I didn't manage, as described in the first comment #492 (comment)

EDIT: but maybe it's only me. Feel free to close this issue if that's the case, as I have switched to v2 meanwhile anyway. Thanks again!

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

No branches or pull requests

2 participants