DVR Server suddenly showing invalid memory errors

Suddenly started seeing these appear in my logs.. Any ideas? Everything is going super slow and my apple TV isn't letting me watch tv from the channels dvr server anymore.

2024/09/29 12:24:24 [Recovery] 2024/09/29 - 12:24:24 panic recovered:
runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:261 (0x455097)
runtime/signal_unix.go:861 (0x455065)
github.com/fancybits/channels-server/dvr/recorder.go:622 (0x161aa81)
github.com/fancybits/channels-server/dvr/recorder.go:696 (0x161bb44)
github.com/fancybits/channels-server/http_dvr_guide.go:277 (0x1c7ed98)
github.com/gin-gonic/[email protected]/context.go:185 (0x1c1dad2)
github.com/fancybits/channels-server/http.go:411 (0x1c1d7d9)
github.com/gin-gonic/[email protected]/context.go:185 (0x1c1d746)
github.com/fancybits/channels-server/http.go:388 (0x1c1d734)
github.com/gin-gonic/[email protected]/context.go:185 (0xbc80ca)
github.com/fancybits/channels-server/http.go:363 (0x1c1d40b)
github.com/gin-gonic/[email protected]/context.go:185 (0x1c1cff7)
github.com/fancybits/channels-server/http.go:325 (0x1c1c692)
github.com/gin-gonic/[email protected]/context.go:185 (0xbd59b9)
github.com/gin-gonic/[email protected]/recovery.go:109 (0xbd59a7)
github.com/gin-gonic/[email protected]/context.go:185 (0xbd4b45)
github.com/gin-gonic/[email protected]/logger.go:249 (0xbd4b08)
github.com/gin-gonic/[email protected]/context.go:185 (0xbc80ca)
github.com/gin-contrib/[email protected]/sessions.go:54 (0x1c2053c)
github.com/gin-gonic/[email protected]/context.go:185 (0xbc80ca)
github.com/gin-contrib/[email protected]/gzip.go:47 (0x1c207c4)
github.com/gin-gonic/[email protected]/context.go:185 (0x1cb53e2)
github.com/fancybits/channels-server/http.go:587 (0x1cb53d0)
github.com/gin-gonic/[email protected]/context.go:185 (0xbd3af1)
github.com/gin-gonic/[email protected]/gin.go:633 (0xbd3560)
github.com/gin-gonic/[email protected]/gin.go:589 (0xbd307c)
net/http/server.go:2943 (0x727b4d)
net/http/server.go:2014 (0x723573)
runtime/asm_amd64.s:1650 (0x474540)

Went through the logs and it appears that an incorrect character in one of my EPG XML's that gets downloaded caused the whole system to grind to a halt..

024/09/29 11:54:22.176156 [ERR] No stations available in lineup XMLTV-Plex after guide data download: XML syntax error on line 55106: illegal character code U+0008

Once I removed the EPG URL from that source everything came back instantly.

Strange that it would cause the whole system to crash like that. Happy to help in some way to stop this bug occurring again?

What are you using for your Plex custom m3u channel source?
Whatever it is, it isn't filtering out invalid backspace characters in its XMLTV.
Not too sure that's the cause of your panic error though.

DM us the URL, or dump it to text and send us a text file, and we'll check it out.

Unfortunately that snippet from the logs without the full diagnostics from the DVR doesn't give us enough to go on to really understand what is going on here.

The best I can see, it looks like while this HTTP request was being processed, the DVR was shut down.

Apologies all, I can be called out to work at a moments notice so haven't been near the computer.

@maddox and @eric Will DM the file.

@chDVRuser - Its a custom XML I grab and generate that I've put together.. Not a very ideal one and has bugs like this it seems haha.

EDIT: I did a bit more checking and it seems I am not sanitizing entries properly when I generate the XML file.. so there is some sort of character that channelsdvr doesn't like I am guessing and causes it to act out. I've fixed my code so I sanitize all my xml entries properly now.

So are things working properly now?

Yes, all good now thanks. Thanks to the logging in Channels I was able to identify exactly where the problem lay in my XML file so it is appreciative you have that functionality in the software.
Hope the XML file I sent to you guys helps in some way though as it was a bizzare behaviour with the system crashing and bugging out because of the illegal characters.