aetaric/checkrr

Influxdb2[BUG]

Closed this issue · 3 comments

Describe the bug
When I add influxdb2 to the config file I can no longer run the scan.

To Reproduce
Add to config file:

stats: # These will slow down the runtime substantually, but... DATA
  influxdb2:
    url: "http://192.168.x.x:8086"
    token: "APIKEY"
    org: "org"
    bucket: "checkrr"

Then click run now.

I get the below error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0xce66be]
goroutine 15 [running]:
github.com/aetaric/checkrr/features.(*Stats).FromConfig(_, {{0x177bde0, 0x1}, {0x0, 0x0, 0x0}, {0x1793cc0, 0x1fb95e0}, {0x0, 0x0, ...}, ...})
	/Users/aetaric/src/checkrr/features/stats.go:90 +0x4be
github.com/aetaric/checkrr/check.(*Checkrr).Run(0xc000192300)
	/Users/aetaric/src/checkrr/check/checkrr.go:57 +0x1c5
created by github.com/aetaric/checkrr/webserver.runCheckrr in goroutine 52
	/Users/aetaric/src/checkrr/webserver/webserver.go:218 +0x5f

In looking at the stats.go file on line 90 the line is:
s.writeAPI2 = s.influxdb1.WriteAPIBlocking(influx.GetString("org"), influx.GetString("bucket"))
I think that should have influxdb2 instead of 1?

@Manichee do you have the go toolchain installed? If you do, can you build and test 38e48b6 to confirm that works? If it does, I'll go ahead and push a build.

I do not sorry. I should have mentioned I am using docker.

@Manichee I'm going to assume 38e48b6 resolves this. If it still doesn't work in the next release, go ahead and reply back and I'll reopen this for further investigation.