akhilrex / podgrab

A self-hosted podcast manager/downloader/archiver tool to download podcast episodes as soon as they become live with an integrated player.
GNU General Public License v3.0
1.67k stars 93 forks source link

Instance crashes to invalid pointer #265

Open jtagcat opened 1 year ago

jtagcat commented 1 year ago

Please complete the following information

2023/01/30 02:36:01 /api/db/dbfunctions.go:216
[730.942ms] [rows:1883] SELECT * FROM `podcast_items` WHERE download_status="0"
Processing episodes:  1883
{"level":"dpanic","ts":1675046161.1386578,"caller":"zap@v1.16.0/sugar.go:191","msg":"Ignored key without a value.","ignored":"parse \"  https://media.d
evchat.tv/adventures-in-devops/Finding_Your_Dream_Job.mp3\": first path segment in URL cannot contain colon","stacktrace":"go.uber.org/zap.(*SugaredLog
ger).Errorw\n\t/go/pkg/mod/go.uber.org/zap@v1.16.0/sugar.go:191\ngithub.com/akhilrex/podgrab/service.Download\n\t/api/service/fileService.go:33\ngithub
.com/akhilrex/podgrab/service.DownloadMissingEpisodes.func1\n\t/api/service/podcastService.go:536"}
{"level":"error","ts":1675046161.1377428,"caller":"service/fileService.go:33","msg":"Error creating request:   https://media.devchat.tv/adventures-in-d
evops/Finding_Your_Dream_Job.mp3","stacktrace":"github.com/akhilrex/podgrab/service.Download\n\t/api/service/fileService.go:33\ngithub.com/akhilrex/pod
grab/service.DownloadMissingEpisodes.func1\n\t/api/service/podcastService.go:536"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x6fc8ee]

goroutine 1062 [running]:
net/http.(*Client).do(0xc0004824e0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/http/client.go:595 +0xae
net/http.(*Client).Do(...)
        /usr/local/go/src/net/http/client.go:586
github.com/akhilrex/podgrab/service.Download(0xc002ab7680, 0x4a, 0xc00190ac80, 0x37, 0xc003acde70, 0x5, 0x0, 0x0, 0x0, 0x0, ...)
        /api/service/fileService.go:36 +0xcc
github.com/akhilrex/podgrab/service.DownloadMissingEpisodes.func1(0xc0006aa990, 0xc00061a4e0, 0x24, 0x2da4c1e5, 0xed8d5c101, 0x0, 0x9c2e144, 0xedb3db3c
2, 0x0, 0x0, ...)
        /api/service/podcastService.go:536 +0xd0
created by github.com/akhilrex/podgrab/service.DownloadMissingEpisodes
        /api/service/podcastService.go:534 +0x3d8

About once in a month reproducibility.

pmcfernandes commented 1 year ago

I got same issue and because not fixed after more than 6 months I fixed myself and launched a new docker version fixed it pmcfernandes/prodgrab the fix is here https://github.com/pmcfernandes/podgrab/commit/b94c5b848fca40d922061e61cf6021a34bd6a156