aetaric / checkrr

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

issues with influxdb2 #39

Closed douginoz closed 1 year ago

douginoz commented 1 year ago

Running checkrr 3.0 in docker. The scheduled time to run comes and goes and nothing happens. Well, almost - looking at the docker logs in portainer, checkrr is idle and servicing web GET requests as normal. But just when it's scheduled to kick off again, the following occurs:

[GIN] 2023/01/14 - 03:59:56 | 200 |     122.738µs |    192.168.1.35 | GET      "/api/stats/historical"
[GIN] 2023/01/14 - 03:59:57 | 200 |    1.108937ms |    192.168.1.35 | GET      "/api/files/bad"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x7a7c7b]
goroutine 734 [running]:
github.com/aetaric/checkrr/features.(*Stats).FromConfig(_, {{0x9ebf70, 0x1}, {0x0, 0x0, 0x0}, {0x1019360, 0x13bed20}, {0x0, 0x0, ...}, ...})
    /Users/aetaric/src/checkrr/features/stats.go:63 +0x4bb
github.com/aetaric/checkrr/check.(*Checkrr).Run(0xc000822300)
    /Users/aetaric/src/checkrr/check/checkrr.go:54 +0x20c
github.com/robfig/cron/v3.(*Cron).startJob.func1()
    /Users/aetaric/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:312 +0x6a
created by github.com/robfig/cron/v3.(*Cron).startJob
    /Users/aetaric/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:310 +0xad

checkrr/features/stats.go:63 is:

org, _ := s.influxdb1.OrganizationsAPI().FindOrganizationByName(context.Background(), influx.GetString("org"))

Which might be a bit strange since this line is within the "if config.Sub("influxdb2") != nil" block - influxdb2, not influxdb1.

My checkrr.yaml has the following:

stats: # These will slow down the runtime substantually, but... DATA influxdb2: url: "http://192.168.1.111:8086/" token: "<removed but normally a valid token generated in influxdb2" org: "sanityfromtheinside" bucket: "checkrr"

This error occurs even if org: is left as the default in the example (org: "default"). The token, org and bucket values are valid and correct.

After the stack trace is displayed, checkrr continues (or may be restarting automatically) but doesn't ever start a scan. Running InfluxDB v2.6.1 on ubuntu 20.04 with checkrr 3.0.0.