Unpackerr / unpackerr

Extracts downloads for Radarr, Sonarr, Lidarr, Readarr, and/or a Watch folder - Deletes extracted files after import
https://unpackerr.zip
MIT License
1.03k stars 36 forks source link

Extraction failing due to runtime error #466

Closed PrymalInstynct closed 3 months ago

PrymalInstynct commented 3 months ago

I noted today that extractions seem to be failing with the following error. I am using the hotio nightly version of the unpackerr container image.

[INFO] 2024/07/18 05:45:14 [Unpackerr] Queue: 1 waiting, 0 queued, 0 extracting, 0 extracted, 0 imported, 0 failed, 0 deleted
[INFO] 2024/07/18 05:46:14 [Sonarr] Extraction Queued: /data/torrents/tv/show-ep, retries: 0, 1 archive: /data/torrents/tv/show-ep.rar, delete orig: false, queue size: 1
panic: runtime error: index out of range [-1]

goroutine 21 [running]:
github.com/Unpackerr/unpackerr/pkg/unpackerr.(*Unpackerr).updateHistory(...)
        /unpackerr/pkg/unpackerr/tray_other.go:30
github.com/Unpackerr/unpackerr/pkg/unpackerr.(*Unpackerr).logQueuedDownload(0xc000128d90, 0x1, 0xc000218200, 0xc0001beb10)
        /unpackerr/pkg/unpackerr/handlers.go:149 +0x475
github.com/Unpackerr/unpackerr/pkg/unpackerr.(*Unpackerr).extractCompletedDownload(0xc000128d90, {0xc000208150, 0x2a}, {0x5?, 0x7?, 0x11837a0?}, 0xc000218200)
        /unpackerr/pkg/unpackerr/handlers.go:138 +0x49d
github.com/Unpackerr/unpackerr/pkg/unpackerr.(*Unpackerr).extractCompletedDownloads(0xc000128d90, {0xc0000b1e54?, 0x0?, 0x11837a0?})
        /unpackerr/pkg/unpackerr/handlers.go:86 +0xd6
github.com/Unpackerr/unpackerr/pkg/unpackerr.(*Unpackerr).Run(0xc000128d90)
        /unpackerr/pkg/unpackerr/start.go:295 +0x3fd
created by github.com/Unpackerr/unpackerr/pkg/unpackerr.(*Unpackerr).startTray in goroutine 1
        /unpackerr/pkg/unpackerr/tray_other.go:12 +0x73
[INFO] 2024/07/18 05:46:15 Unpackerr v58e050870d5b00fdcd52c99c482ea3208dee9004- Starting! PID: 171, UID: 13009, GID: 100, Umask: 2, Now: 2024-07-18 05:46:16 -0600 MDT
davidnewhall commented 3 months ago

Thanks for the report. This looks bad, and I'll dig in shortly.

davidnewhall commented 3 months ago

This is the bug-causing commit. https://github.com/Unpackerr/unpackerr/commit/9098c4b9065587f910c9503d85729821730621a7

davidnewhall commented 3 months ago

I've pushed a fix for this to the unstable build. I don't think hotio builds that, so I'm going to ask you to switch to a different image briefly to test this. Please switch from hotio/unpackerr to ghcr.io/unapckerr/unpackerr:unstable and remove the PUID and GUID env variables. Replace them with user: (docker compose) or --user (docker run). This particular difference is documented here: https://unpackerr.zip/docs/install/docker#permissions

Let me know if this works out. Thanks!

PrymalInstynct commented 3 months ago

Thanks, I was able to test this successfully.