Runtime error: invalid memory address or nil pointer dereference

Log is below. This morning I deleted a bunch of files from trash while commercial detection on a recording was happening, then I was streaming a TVE recording from the browser (remotely) with no transcoding. DVR crashed during playback.

2020/02/10 09:23:47.122063 [DVR] Commercial detection finished with 28 markers.
2020/02/10 09:23:47.508990 [DVR] Processing file-3957: TV/Morning Joe/Morning Joe 2020-02-10-0600.mpg
2020/02/10 09:23:48.436290 [DVR] Running commercial detection on file 3957 (TV/Morning Joe/Morning Joe 2020-02-10-0600.mpg)
2020/02/10 10:20:58.402316 [DVR] Deleting /volume1/dvr/TV/Post-Debate Analysis Decision 2020/Post-Debate Analysis Decision 2020 2020-02-07-2300.mpg
2020/02/10 10:21:00.559691 [DVR] Deleting /volume1/dvr/TV/College Basketball/College Basketball Cincinnati at Connecticut 2020-02-09-1200.mpg
2020/02/10 10:21:02.693670 [DVR] Deleting /volume1/dvr/TV/Morning Joe/Morning Joe 2020-02-07-0600.mpg
2020/02/10 10:21:04.809939 [DVR] Deleting /volume1/dvr/TV/New Day With Alisyn Camerota and John Berman/New Day With Alisyn Camerota and John Berman 2018-06-03 2020-02-07-0600.mpg
2020/02/10 10:21:06.903465 [DVR] Deleting /volume1/dvr/TV/Good Morning America/Good Morning America 2020-02-07-0700.mpg
2020/02/10 10:21:09.063577 [DVR] Deleting /volume1/dvr/TV/CBS This Morning/CBS This Morning 2020-02-07-0700.mpg
2020/02/10 10:21:10.444323 [DVR] Deleting /volume1/dvr/TV/Today/Today 2020-02-08-0700.mpg
2020/02/10 10:21:12.365687 [DVR] Deleting /volume1/dvr/TV/60 Minutes/60 Minutes S52E17 2020-01-12-1900.mpg
2020/02/10 10:21:13.825366 [DVR] Deleting /volume1/dvr/TV/NBC Nightly News With Lester Holt/NBC Nightly News With Lester Holt 2020-02-08-1830.mpg
2020/02/10 10:21:14.951207 [DVR] Deleting /volume1/dvr/TV/Face the Nation/Face the Nation 2020-02-02-1030.mpg
2020/02/10 10:21:15.943910 [DVR] Deleting /volume1/dvr/TV/State of the Union With Jake Tapper/State of the Union With Jake Tapper 2014-12-28 2020-02-02-0900.mpg
2020/02/10 10:21:16.938391 [DVR] Deleting /volume1/dvr/TV/Meet the Press/Meet the Press 2020-02-02-1000.mpg
2020/02/10 10:21:18.549436 [DVR] Deleting /volume1/dvr/TV/This Week With George Stephanopoulos/This Week With George Stephanopoulos 2020-02-02-1000.mpg
2020/02/10 10:21:20.233768 [DVR] Deleting /volume1/dvr/TV/Station 19/Station 19 S03E01 I Know This Bar 2020-01-23-2000.mpg
2020/02/10 10:21:21.920593 [DVR] Deleting /volume1/dvr/TV/NBC Nightly News With Lester Holt/NBC Nightly News With Lester Holt 2020-02-07-1830.mpg
2020/02/10 10:21:25.206654 [DVR] Deleting /volume1/dvr/TV/Cuomo Prime Time/Cuomo Prime Time 2020-01-31-2100.mpg
2020/02/10 10:21:26.773852 [DVR] Deleting /volume1/dvr/TV/The Late Show With Stephen Colbert/The Late Show With Stephen Colbert S05E81 Edie Falco Fortune Feimster 2020-01-31-2335.mpg
2020/02/10 10:21:27.907456 [DVR] Deleting /volume1/dvr/TV/College Basketball/College Basketball Pittsburgh at Notre Dame 2020-02-05-1830.mpg
2020/02/10 10:21:29.707193 [DVR] Deleting /volume1/dvr/TV/Conan/Conan S10E12 Drew and Jonathan Scott 2020-01-30-2300.mpg
2020/02/10 10:21:31.102389 [DVR] Deleting /volume1/dvr/TV/College Basketball/College Basketball Miami at Pittsburgh 2020-02-02-1200.mpg
2020/02/10 10:21:32.258505 [DVR] Deleting /volume1/dvr/TV/NBC Nightly News With Lester Holt/NBC Nightly News With Lester Holt 2020-02-04-1830.mpg
2020/02/10 10:21:33.936151 [DVR] Deleting /volume1/dvr/TV/CBS Evening News With Norah O'Donnell/CBS Evening News With Norah O'Donnell S2020E25 2020-02-04-1900.mpg
2020/02/10 10:21:35.181328 [DVR] Deleting /volume1/dvr/TV/The View/The View S23E94 2020-01-31-1100.mpg
2020/02/10 10:21:36.773039 [DVR] Deleting /volume1/dvr/TV/Kasie DC/Kasie DC 2020-02-02-1400.mpg
2020/02/10 10:21:37.994018 [DVR] Deleting /volume1/dvr/TV/Morning Joe/Morning Joe 2020-02-04-0600.mpg
2020/02/10 10:21:42.630536 [DVR] Deleting /volume1/dvr/TV/New Day With Alisyn Camerota and John Berman/New Day With Alisyn Camerota and John Berman 2018-06-03 2020-02-04-0600.mpg
2020/02/10 10:21:45.391886 [DVR] Deleting /volume1/dvr/TV/Today/Today 2020-02-04-0700.mpg
2020/02/10 10:21:47.198677 [DVR] Deleting /volume1/dvr/TV/Good Morning America/Good Morning America 2020-02-04-0700.mpg
2020/02/10 10:21:50.003777 [DVR] Deleting /volume1/dvr/TV/CBS This Morning/CBS This Morning 2020-02-04-0700.mpg
2020/02/10 10:24:34.498670 [DVR] Commercial detection finished with 20 markers.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc67a28]

Please include all of the messages after the panic line at the end.

That similar to my issue this weekend.

I have a question. Why did the Channels DVR shutdown. Error is fine but while I was watching Live TV my Fire TV just froze up and when I reopen Channels DVR it asked for IP address to DVR. When I checked my NAS, Channels DVR had stopped. Why didn't it restart automatically. I can't find anywhere on my Synology NAS to auto restart if Channels DVR package on NAS fails.

Sorry, didn't see this reply until now but it happened again this morning as I was trying to force update to the latest pre-release.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc69796]

goroutine 3291782 [running]:
github.com/fancybits/channels-server/dvr.(*Recorder).MkdirSafe(0x0, 0xc001e96500, 0x71, 0xc001e96580, 0x7e)
	github.com/fancybits/channels-server@/dvr/recorder.go:612 +0x26
github.com/fancybits/channels-server/streaming.(*abrSegmentCache).Complete(0xc001b5cac0, 0xc000f96521, 0x4, 0xc000f963d8, 0x3, 0xbb8, 0x80, 0xc000f96417, 0x3, 0x0, ...)
	github.com/fancybits/channels-server@/streaming/abr_segment_cache.go:122 +0x223
github.com/fancybits/channels-server/streaming.(*abrSegment).Complete(...)
	github.com/fancybits/channels-server@/streaming/abr_segment.go:83
github.com/fancybits/channels-server/streaming.(*abrTranscoderSession).writeSegment(0xc001593180, 0x34a, 0x400004189374bc6a, 0xc001b09b80, 0xc001363a30, 0x1, 0xba, 0xc000f96417, 0x3)
	github.com/fancybits/channels-server@/streaming/abr_transcoder_session.go:415 +0x10a0
github.com/fancybits/channels-server/streaming.(*abrTranscoderSession).Refresh(0xc001593180, 0x0, 0x0)
	github.com/fancybits/channels-server@/streaming/abr_transcoder_session.go:347 +0x6ca
github.com/fancybits/channels-server/streaming.(*abrTranscoderSession).start(0xc001593180)
	github.com/fancybits/channels-server@/streaming/abr_transcoder_session.go:114 +0x97
created by github.com/fancybits/channels-server/streaming.NewAbrTranscoderSession
	github.com/fancybits/channels-server@/streaming/abr_transcoder_session.go:102 +0x191
2020/02/11 10:38:12.242670 [SYS] Starting Channels DVR v2020.02.11.1348 (linux-x86_64 pid:31875) in /volume1/@appstore/ChannelsDVR/channels-dvr/data
2020/02/11 10:38:12.720461 [HDR] Found 1 devices
2020/02/11 10:38:13.652857 [SYS] Started HTTP Server


2020/02/11 10:38:14 [Recovery] 2020/02/11 - 10:38:14 panic recovered:
runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:199 (0x446bfb)
runtime/signal_unix.go:394 (0x446a38)
github.com/fancybits/channels-server@/dvr/recorder.go:612 (0xc69795)
github.com/fancybits/channels-server@/streaming/abr_segment_cache.go:37 (0xcb8742)
github.com/fancybits/channels-server@/streaming/abr_live_stream.go:67 (0xcb4169)
github.com/fancybits/channels-server@/streaming/streaming.go:117 (0xcd219b)
github.com/fancybits/channels-server@/streaming/streams.go:54 (0xcd5b36)
github.com/fancybits/channels-server@/streaming/streams.go:124 (0xcd2cf4)
github.com/fancybits/channels-server@/streaming/streams.go:56 (0xcd270b)
github.com/fancybits/channels-server@/http_device.go:454 (0x10793a5)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http_device.go:35 (0x105c481)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:229 (0x10595ae)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:209 (0x1059192)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:152 (0x105869a)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-gonic/[email protected]/recovery.go:83 (0x9fb543)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:284 (0x106fe0b)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-contrib/[email protected]/sessions.go:65 (0xfd8de6)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-contrib/[email protected]/gzip.go:47 (0xfd1e06)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:264 (0x106fbd1)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-gonic/[email protected]/gin.go:403 (0x9f1ad9)
github.com/gin-gonic/[email protected]/gin.go:364 (0x9f11cd)
net/http/server.go:2802 (0x716813)
net/http/server.go:1890 (0x7120b4)
runtime/asm_amd64.s:1357 (0x461220)



2020/02/11 10:38:14 [Recovery] 2020/02/11 - 10:38:14 panic recovered:
runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:199 (0x446bfb)
runtime/signal_unix.go:394 (0x446a38)
github.com/fancybits/channels-server@/dvr/recorder.go:612 (0xc69795)
github.com/fancybits/channels-server@/streaming/abr_segment_cache.go:37 (0xcb8742)
github.com/fancybits/channels-server@/streaming/abr_live_stream.go:67 (0xcb4169)
github.com/fancybits/channels-server@/streaming/streaming.go:117 (0xcd219b)
github.com/fancybits/channels-server@/streaming/streams.go:54 (0xcd5b36)
github.com/fancybits/channels-server@/streaming/streams.go:124 (0xcd2cf4)
github.com/fancybits/channels-server@/streaming/streams.go:56 (0xcd270b)
github.com/fancybits/channels-server@/http_device.go:454 (0x10793a5)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http_device.go:35 (0x105c481)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:229 (0x10595ae)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:209 (0x1059192)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:152 (0x105869a)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-gonic/[email protected]/recovery.go:83 (0x9fb543)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:284 (0x106fe0b)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-contrib/[email protected]/sessions.go:65 (0xfd8de6)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-contrib/[email protected]/gzip.go:47 (0xfd1e06)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/fancybits/channels-server@/http.go:264 (0x106fbd1)
github.com/gin-gonic/[email protected]/context.go:147 (0x9e7dda)
github.com/gin-gonic/[email protected]/gin.go:403 (0x9f1ad9)
github.com/gin-gonic/[email protected]/gin.go:364 (0x9f11cd)
net/http/server.go:2802 (0x716813)
net/http/server.go:1890 (0x7120b4)
runtime/asm_amd64.s:1357 (0x461220)

2020/02/11 10:38:15.049435 [DVR] Recording engine started in /volume1/dvr
2020/02/11 10:38:15.051117 [SYS] Bonjour service running for dvr-carnegie718.local. [192.168.1.154 169.254.251.64]
2020/02/11 10:38:15.052152 [SYS] Removing old update 2020.01.31.1830

I know this is an old thread, but this started happening to me on Synology NAS. Last 2 days I got home and had to restart the package a couple times in the package center. Any ideas here? Below is the log, please don't judge me for the Dr Phil stuff, thats my wife.

2021/01/13 09:37:54.361723 [DVR] Deleting job with expired serial: 1611630000-12 Evil Lives Here (EP023241770082)

2021/01/13 09:37:54.594665 [DVR] Waiting 6h22m5.40535549s until next job 1610578800-19 Dr. Phil
2021/01/13 09:37:58.066395 [DVR] Waiting 6h22m1.933616926s until next job 1610578800-19 Dr. Phil
2021/01/13 12:04:10.857055 [TNR] Opened connection to TVE-DTV for ch6057 EP
2021/01/13 12:05:25.080376 [TNR] Closed connection to TVE-DTV for ch6057 EP
2021/01/13 12:05:47.891786 [TVE] stream timestamps: own: start_at=2021-01-13T12:04:47-07:00 current_at=2021-01-13T12:05:08-07:00 end_at=2021-01-13T12:05:16-07:00
2021/01/13 12:05:47.891836 [TNR] Opened connection to TVE-DTV for ch6100 OWN
2021/01/13 12:23:58.134057 [TNR] Closed connection to TVE-DTV for ch6100 OWN
2021/01/13 12:24:10.209515 [TVE] stream timestamps: ngwild: start_at=2021-01-13T12:23:09-07:00 current_at=2021-01-13T12:23:30-07:00 end_at=2021-01-13T12:23:38-07:00
2021/01/13 12:24:10.209565 [TNR] Opened connection to TVE-DTV for ch6072 NGWILD
2021/01/13 15:06:32.790230 [TNR] Closed connection to TVE-DTV for ch6072 NGWILD
2021/01/13 16:00:00.003014 [DVR] Starting job 1610578800-19 Dr. Phil on ch=[4.1]
2021/01/13 16:00:00.003100 [DVR] Waiting 1h59m59.996908038s until next job 1610586000-8 The Incredible Dr. Pol
2021/01/13 16:00:00.440744 [TNR] Opened connection to 1061D714/0 for ch4.1 KCNC-TV
2021/01/13 16:00:00.458323 [DVR] Recording for job 1610578800-19 from 1061D714 ch4.1 into "TV/Dr. Phil/Dr. Phil S19E76 How Do I Raise a Child That Is a Monster 2021-01-13-1600.mpg" for 59m59.996846801s
2021/01/13 16:00:01.202820 [IDX] Generating video index for job 1610578800-19
2021/01/13 17:00:00.438977 [TNR] Closed connection to 1061D714/0 for ch4.1 KCNC-TV
2021/01/13 17:00:00.635779 [SNR] Statistics for "TV/Dr. Phil/Dr. Phil S19E76 How Do I Raise a Child That Is a Monster 2021-01-13-1600.mpg": ss=83%,0%-88% snq=95%,0%-100% seq=100% bps=11220122,186496-15722816 pps=1065,18-1494
2021/01/13 17:00:00.659340 [DVR] Finished job 1610578800-19 Dr. Phil
2021/01/13 17:00:01.205775 [DVR] Processing file-752: TV/Dr. Phil/Dr. Phil S19E76 How Do I Raise a Child That Is a Monster 2021-01-13-1600.mpg
2021/01/13 17:00:01.209886 [DVR] Waiting 59m58.790136399s until next job 1610586000-8 The Incredible Dr. Pol
2021/01/13 17:00:02.561231 [DVR] Running commercial detection on file 752 (TV/Dr. Phil/Dr. Phil S19E76 How Do I Raise a Child That Is a Monster 2021-01-13-1600.mpg)
2021/01/13 17:09:15.618666 [DVR] Commercial detection for Dr. Phil S19E76 How Do I Raise a Child That Is a Monster 2021-01-13-1600.mpg finished with 14 markers.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x124f4b7]

goroutine 89 [running]:
github.com/fancybits/channels-server/dvr.(*File).ReprocessTimestampsIfNeeded(0xc001823180)
github.com/fancybits/channels-server/dvr/file.go:552 +0x57
github.com/fancybits/channels-server/dvr.(*File).Process(0xc001823180)
github.com/fancybits/channels-server/dvr/file.go:1060 +0xe5
github.com/fancybits/channels-server/dvr.(*Recorder).RunProcessor(0xc00000cd20)
github.com/fancybits/channels-server/dvr/recorder.go:402 +0xd3b
created by github.com/fancybits/channels-server/dvr.(*Recorder).Run
github.com/fancybits/channels-server/dvr/recorder.go:183 +0xab
2021/01/13 20:24:42.104808 [SYS] Starting Channels DVR v2021.01.12.0156 (linux-x86_64 pid:8559) in /volume1/@appstore/ChannelsDVR/channels-dvr/data
2021/01/13 20:24:42.133296 [SYS] Started HTTP Server
2021/01/13 20:24:42.587847 [HDR] Found 1 devices
2021/01/13 20:24:47.489327 [DVR] Recording engine started in /volume1/dvr
2021/01/13 20:24:47.490283 [SYS] Bonjour service running for dvr-superawesomenas.local. [192.168.0.6]
2021/01/13 20:24:47.727815 [DVR] Marking expired job 1610586000-8 The Incredible Dr. Pol
2021/01/13 20:24:48.143198 [DVR] Waiting 19h35m11.856822063s until next job 1610665200-19 Dr. Phil
2021/01/13 20:24:50.307077 [SYS] Created database snapshot: backup-20210113.202448
2021/01/13 20:24:50.311851 [SYS] Removing old backup backup-20201215.142838
2021/01/13 20:24:57.696840 [IDX] Pruned 1029 expired airings from USA-OTA80504 in 194.502886ms.
2021/01/13 20:24:58.028080 [IDX] Pruned 1740 expired airings from X-TVE in 331.138824ms.

You need to update to latest pre-release.

Thanks.. just updated and will let you guys know if I run into any issues