Skip to content

panic: runtime error: index out of range [0] with length 0

I just installed this (first time user) and am seeing a panic (logs below).

Version b8ae7b68 (current master), connecting to a single tracker. I noticed this by dropping into the IRC channel manually and seeing my configured user leaving and re-entering (running in a Docker container with restart: unless-stopped).

logs
[2020-07-04T15:11:05+10:00]  INFO app           : Using VERSION    = 1.8.0 (b8ae7b6@1593341917)
[2020-07-04T15:11:05+10:00]  INFO log           : Using LOG_LEVEL  = info
[2020-07-04T15:11:05+10:00]  INFO log           : Using LOG        = "/config/app/activity.log"
[2020-07-04T15:11:05+10:00]  INFO cfg           : Using CONFIG     = "/config/app/config.yaml"
[2020-07-04T15:11:05+10:00]  INFO db            : Using DATABASE   = "/config/app/vault.db"
[2020-07-04T15:11:05+10:00]  INFO autodl        : Using TRACKERS   = "/config/app/trackers"
[2020-07-04T15:11:05+10:00]  INFO autodl        : Finding available trackers from: https://github.com/autodl-community/autodl-trackers/tree/master/trackers
[2020-07-04T15:11:06+10:00]  INFO autodl        : Found 120 trackers
[2020-07-04T15:11:06+10:00]  INFO autodl        : Trackers are up to date
[2020-07-04T15:11:06+10:00]  INFO pvr           : Initialized PVR sonarr
[2020-07-04T15:11:06+10:00]  INFO pvr           : Initialized PVR radarr
[2020-07-04T15:11:06+10:00]  INFO pvr           : Initialized PVR lidarr
[2020-07-04T15:11:06+10:00]  INFO tracker       : Initializing trackers...
[2020-07-04T15:11:06+10:00]  INFO app           : Initialized core
[2020-07-04T15:11:06+10:00]  INFO web           : Started loghook
[2020-07-04T15:11:06+10:00]  INFO web           : Listening on 0.0.0.0:7337/
[2020-07-04T15:11:06+10:00]  INFO Milkie        : Connecting to irc.p2p-network.net:6667 (ssl: false / sasl: false)
[2020-07-04T15:11:06+10:00]  INFO app           : Connected to 1 trackers!
[2020-07-04T15:11:06+10:00]  INFO tasks         : Started scheduler
[2020-07-04T15:11:11+10:00]  INFO Milkie        : Joined: #milkie-announce
panic: runtime error: index out of range [0] with length 0

goroutine 73 [running]:
github.com/IncSW/go-bencode.(*unmarshaler).unmarshal(0xc000515230, 0x203000, 0x203000, 0x203000, 0x2e74656e)
        github.com/IncSW/go-bencode@v0.0.0-20191006112700-dd0b375b2060/unmarshaler.go:23 +0x974
github.com/IncSW/go-bencode.Unmarshal(...)
        github.com/IncSW/go-bencode@v0.0.0-20191006112700-dd0b375b2060/unmarshaler.go:13
gitlab.com/cloudb0x/trackarr/utils/torrent.TorrentDecode(0xc00059e000, 0x0, 0x200, 0x1e, 0xc000093348, 0x2)
        gitlab.com/cloudb0x/trackarr/utils/torrent/parse.go:62 +0xb6
gitlab.com/cloudb0x/trackarr/utils/torrent.GetTorrentDetails(0xc0000f4060, 0x5b, 0x1e, 0xc0004acab0, 0x1748540, 0x0, 0x0)
        gitlab.com/cloudb0x/trackarr/utils/torrent/parse.go:33 +0x164
gitlab.com/cloudb0x/trackarr/release.(*Release).bencodeLookup(0xc0003d8800, 0x0, 0x0, 0x0)
        gitlab.com/cloudb0x/trackarr/release/bencode.go:27 +0xcb
gitlab.com/cloudb0x/trackarr/release.(*Release).Process(0xc0003d8800)
        gitlab.com/cloudb0x/trackarr/release/process.go:74 +0x1152
gitlab.com/cloudb0x/trackarr/autodl/processor.(*Processor).processQueue.func1(0xc0003d8800)
        gitlab.com/cloudb0x/trackarr/autodl/processor/process.go:94 +0x2b
created by gitlab.com/cloudb0x/trackarr/autodl/processor.(*Processor).processQueue
        gitlab.com/cloudb0x/trackarr/autodl/processor/process.go:93 +0x4d3
config (with certain details redacted)
database:
  maxagehours: 72

server:
  apikey: REDACTED
  baseurl: /
  host: 0.0.0.0
  port: 7337
  publicurl: https://trackarr.REDACTED

trackers:
  milkie:
    enabled: true
    bencode:
      name: true
      size: true
    irc:
      nickname: REDACTED_autodl
      verbose: true
    settings:
      passkey: REDACTED

pvr:
- name: sonarr
  url: https://sonarr.REDACTED
  apikey: REDACTED
  enabled: true
  filters:
    accepts:
    - Category contains "tv"
    ignores:
    - TorrentName contains "[HorribleSubs]"
    - any (Files, {# matches "(?i)\\.(bdmv|mpls|miniso|cci|cer|clpi|m2ts|VOB|IFO|BUP|iso|rar|r01)$"})
- name: radarr
  url: https://radarr.REDACTED
  apikey: REDACTED
  enabled: true
  filters:
    accepts:
    - Category contains "movie"
    ignores:
    - Category contains "XXX"
    - Category contains "Disk"
    - Category contains "DVD-R"
    - TorrentName contains "3D"
    - 'any (["VOB", "DVD9", "DVD5", "BD25", "BD50"], {Tags contains #})'
    - any (Files, {# matches "(?i)\\.(bdmv|mpls|miniso|cci|cer|clpi|m2ts|VOB|IFO|BUP|iso|rar|r01)$"})
- name: lidarr
  url: https://lidarr.REDACTED/api/v1/release/push
  apikey: REDACTED
  enabled: true
  filters:
    accepts:
    - Category contains "music"

Basically this is the example configs without the exclusion on HEVC. The crash clearly looks related to the bencode portion. Setting both bencode options for my single tracker to false appears to avoid the issue, so far...

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information