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] API Request "Unauthorized" #238

Open
anirudhRowjee opened this issue Sep 29, 2023 · 1 comment
Open

[influx] API Request "Unauthorized" #238

anirudhRowjee opened this issue Sep 29, 2023 · 1 comment

Comments

@anirudhRowjee
Copy link

In the latest release of TSBS, on attempting to call tsbs_load_influx, I am faced with the following error -

$ tsbs_load_influx --file /tmp/bulk_data/influx-data.gz
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.(*dbCreator).listDatabases(0x412545?)
        /home/anirudh/projects/tsbs/cmd/tsbs_load_influx/creator.go:64 +0x4a7
main.(*dbCreator).DBExists(0xe69c20?, {0x11779b0?, 0xc0003e6250?})
        /home/anirudh/projects/tsbs/cmd/tsbs_load_influx/creator.go:22 +0x17
github.com/timescale/tsbs/load.(*CommonBenchmarkRunner).useDBCreator(0xc00030a840, {0x11779b0, 0xc0003e6250})
        /home/anirudh/projects/tsbs/load/loader.go:230 +0x129
github.com/timescale/tsbs/load.(*CommonBenchmarkRunner).preRun(0xc00030a840, {0x11787e8, 0x1889ee0})
        /home/anirudh/projects/tsbs/load/loader.go:128 +0x72
github.com/timescale/tsbs/load.(*CommonBenchmarkRunner).RunBenchmark(0xc00030a840, {0x11787e8?, 0x1889ee0})
        /home/anirudh/projects/tsbs/load/loader.go:184 +0x3f
main.main()
        /home/anirudh/projects/tsbs/cmd/tsbs_load_influx/main.go:120 +0x85

Upon inspecting the source code, I tracked it down to this line (`cmd/tsbs_load_influx/creator.go:64) -

	for _, nestedName := range listing.Results[0].Series[0].Values {

Upon hitting the API Endpoint used to list all databases - http://localhost:8086/query?q=show%%20databases I see the following response

{"code":"unauthorized","message":"unauthorized access"}

here are my headers -

Content-Length: 55
Content-Type: application/json; charset=utf-8
Date: Fri, 29 Sep 2023 11:41:01 GMT
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.7.1
X-Platform-Error-Code: unauthorized

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Host: localhost:8086
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0

While there's an Auth token generated during the InfluxDB Setup phase, it doesn't look like the same is passed to the HTTP Client in TSBS, thus breaking API Compat.

Any further clarity on how to fix this (or even a WONTFIX) will be greatly appreciated. Thank you for your time!

@anirudhRowjee anirudhRowjee changed the title [influx] API Compatibility Broken [influx] API Request "Unauthorized" Sep 29, 2023
@OsgFreeze
Copy link

@anirudhRowjee I had the same problem. After some research and testing i found out that InfluxDB 2.x is currently not supported. TSBS only supports InfluxDB 1.x and since the newer versions had major changes to the whole structure, the load scripts won't work anymore. I dont know if this will be updatet in the future but for now i would recommend testing with an InfluxDB 1.8 instance.

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