debridmediamanager / zurg-testing

A self-hosted Real-Debrid webdav server you can use with Infuse. Together with rclone it can mount your Real-Debrid torrent library into your filesystem and load it to Plex or Jellyfin.
498 stars 39 forks source link

Bug: runtime error: invalid memory address or nil pointer dereference goroutine 511707 [running]: (Zurg hotfix8) #74

Closed Varming73 closed 9 months ago

Varming73 commented 9 months ago
2024-02-05T19:07:15.402Z        DEBUG   manager Triggered hook on_library_update for 6 path(s)
2024-02-05T19:08:04.092Z        INFO    manager Periodic repair started; searching for broken torrents
2024-02-05T19:08:04.100Z        INFO    manager Finished repairing 0 broken torrents
2024/02/05 19:08:42 http: panic serving 172.17.0.1:51080: runtime error: invalid memory address or nil pointer dereference
goroutine 511707 [running]:
net/http.(*conn).serve.func1()
        /usr/local/go/src/net/http/server.go:1868 +0xb9
panic({0x92ddc0?, 0xe08e00?})
        /usr/local/go/src/runtime/panic.go:920 +0x270
github.com/debridmediamanager/zurg/pkg/http.(*HTTPClient).shouldRetry(0xc0002062d0, 0x0, 0x0, {0xa94280?, 0xc0024bd1a0?}, 0x6)
        /app/pkg/http/client.go:252 +0x1de
github.com/debridmediamanager/zurg/pkg/http.(*HTTPClient).Do(0xc0002062d0, 0xc0039bec00)
        /app/pkg/http/client.go:165 +0x3d7
github.com/debridmediamanager/zurg/internal/universal.(*Downloader).streamFileToResponse(0xc0000464b8, 0xc003df8fc0, 0xc003212420, 0xc003365560, {0xa980c8, 0xc0003322a0}, 0xc000163f00, 0xc000134ea0, {0xaa0c20, 0xc000134c60}, ...)
        /app/internal/universal/downloader.go:147 +0x314
github.com/debridmediamanager/zurg/internal/universal.(*Downloader).DownloadFile(0xc0000464b8, {0xc001f7c185, 0x5}, {0xc001f7c18b, 0x33}, {0xc001f7c1bf, 0x3a}, {0xa980c8, 0xc0003322a0}, 0xc000163f00, ...)
        /app/internal/universal/downloader.go:92 +0x845
github.com/debridmediamanager/zurg/internal/handlers.(*Handlers).handleDownloadFile(0xc00006ee80, {0xa980c8, 0xc0003322a0}, 0x4?)
        /app/internal/handlers/router.go:399 +0x189
net/http.HandlerFunc.ServeHTTP(0x927700?, {0xa980c8?, 0xc0003322a0?}, 0xc001f7c180?)
        /usr/local/go/src/net/http/server.go:2136 +0x29
github.com/go-chi/chi/v5.(*Mux).routeHTTP(0xc000070600, {0xa980c8, 0xc0003322a0}, 0xc000163f00)
        /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.11/mux.go:443 +0x2b4
net/http.HandlerFunc.ServeHTTP(0x100?, {0xa980c8?, 0xc0003322a0?}, 0x0?)
        /usr/local/go/src/net/http/server.go:2136 +0x29
github.com/debridmediamanager/zurg/internal/handlers.(*Handlers).options-fm.(*Handlers).options.func1({0xa980c8?, 0xc0003322a0?}, 0xe09701?)
        /app/internal/handlers/options.go:11 +0x66
net/http.HandlerFunc.ServeHTTP(0xa99520?, {0xa980c8?, 0xc0003322a0?}, 0xe09740?)
        /usr/local/go/src/net/http/server.go:2136 +0x29
github.com/go-chi/chi/v5.(*Mux).ServeHTTP(0xc000070600, {0xa980c8, 0xc0003322a0}, 0xc000163e00)
        /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.11/mux.go:90 +0x330
net/http.serverHandler.ServeHTTP({0xc003e8b6b0?}, {0xa980c8?, 0xc0003322a0?}, 0x6?)
        /usr/local/go/src/net/http/server.go:2938 +0x8e
net/http.(*conn).serve(0xc002a238c0, {0xa994e8, 0xc0002448d0})
        /usr/local/go/src/net/http/server.go:2009 +0x5f4
created by net/http.(*Server).Serve in goroutine 1
        /usr/local/go/src/net/http/server.go:3086 +0x5cb
yowmamasita commented 9 months ago

it should be fixed on the next hotfix that i am testing but it shouldn't affect functionality. You should increase your API timeouts instead.

Varming73 commented 9 months ago

I just reverted to hotfix7, never saw that error there with api_timeout_secs: 30

# basic functionality
host: "[::]" # do not change this if you are running it inside a docker container
port: 9999 # do not change this if you are running it inside a docker container
concurrent_workers: 32
check_for_changes_every_secs: 15

# reliability configs
api_timeout_secs: 30  # API requests timeout, changed default from 60s to 4s (increase this if you're having API timeout issues)
retries_until_failed: 5  # api failures until considered failed
rate_limit_sleep_secs: 6 # wait time after getting a 429 from Real-Debrid API
download_timeout_secs: 2 # download requests timeout, default is set to 2s

# misc configs
ignore_renames: true
enable_repair: true
expose_full_path: false # this helps plex or jellyfin or infuse identify content better. Might break *Arrs if enabled.
retain_folder_name_extension: true  # if true, zurg won't modify the filenames from real-debrid
retain_rd_torrent_name: false # if true, it will strictly follow RD API returned torrent name which should make this more compatible with rdt-client
auto_delete_rar_torrents: false
verify_download_link: false # if true, zurg will check if the link is truly streamable; only relevant if serve_from_rclone is set to true (as it already does this all the time if serve_from_rclone is false)
repair_every_mins: 60 # repair is now triggered on demand by broken torrents or by schedule as set here. Default is 60 mins.
yowmamasita commented 9 months ago

This is fixed on the next release

yowmamasita commented 9 months ago

https://github.com/debridmediamanager/zurg-testing/releases/tag/v0.9.3-hotfix.9

Varming73 commented 9 months ago

Just upgraded, will test and report back.

Varming73 commented 9 months ago

Would be very nice if you could keep the version tracker updated, @yowmamasita. It's a bit hard to be efficient in the testing if we don't know what have changed.

yowmamasita commented 9 months ago

Oops, yes will do asap

Varming73 commented 9 months ago

Haven't seen this error again on the new release.