aetaric / checkrr

Checkrr Scans your library files for corrupt media and replace the files via sonarr and radarr
MIT License
179 stars 8 forks source link

Influxdb2[BUG] #77

Closed Manichee closed 6 months ago

Manichee commented 8 months ago

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?

aetaric commented 8 months ago

@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.

Manichee commented 8 months ago

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

aetaric commented 6 months ago

@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.