Loading.... for a long time

I have four Apple TVs running the Channels app, with the DVR running on a MyCloud EX2 Ultra.

I notice that frequently (but not all the time) it will take a long time for the app to load (with loading… displayed on the screen). It can sometimes take over a minute to load.

I haven’t figured out if there’s a pattern here. It doesn’t seem limited to one Apple TV.

Any ideas? It’s frustrating, because (with the new DVR) the Channels app has finally reached (and surpassed) the functionality of our old cable boxes. However, the long loading time is leading to complaints from the less patient members of the family :slight_smile:

Weird. Are there any errors in the Log?

Sorry - remind me where to find the logs? (I presume you mean the DVR logs?)

On the Log tab of the web ui

The following error appears repeatedly in the logs. Not sure if it occurs as I start up the ATV app. I’m going to try a few times and see if it’s repeatable:

NOTE: Time zone is EST, this occurred a couple of minutes ago

2017/02/26 19:43:30 [Recovery] panic recovered:
GET /devices/132251E8/guide?time=1488156071&duration=10800 HTTP/1.1
Host: 10.0.1.19:8089
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Authorization: 1488156071-1ZDUTG/jbn3ckd8JDfzv4HCxmerHm7OuxMebL+TPcAQ=
Connection: keep-alive
User-Agent: Channels/2.26.48 CFNetwork/810.2.9 Darwin/16.3.0

write tcp 10.0.1.19:8089->10.0.1.11:49262: write: broken pipe
/home/vagrant/go/src/runtime/panic.go:458 (0x69f50)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:420 (0xff28c)
/home/vagrant/channels-server-armv7l/http.go:2184 (0x333ac)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:2145 (0x32da0)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:206 (0x15a90)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:186 (0x15720)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/recovery.go:45 (0x10c8c4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/contrib/sessions/sessions.go:65 (0x277e38)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/fancybits/gzip/gzip.go:46 (0x276818)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:248 (0x1df10)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/gin.go:284 (0x1032fc)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/gin.go:265 (0x103008)
/home/vagrant/go/src/net/http/server.go:2202 (0x1fd944)
/home/vagrant/go/src/net/http/server.go:1579 (0x1faae4)
/home/vagrant/go/src/runtime/asm_arm.s:998 (0xa4920)

Ok, just quit the ATV app and restarted it, and triggered the same errors again (twice):

2017/02/26 19:49:56 [Recovery] panic recovered:
GET /devices/132251E8/guide?time=1488156520&duration=10800 HTTP/1.1
Host: 10.0.1.19:8089
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Authorization: 1488156520-ZMWKkN94B67Kjyp+fMMdU3h4MoRfoTP+Svu1cAzpRFk=
Connection: keep-alive
User-Agent: Channels/2.26.48 CFNetwork/810.2.9 Darwin/16.3.0

write tcp 10.0.1.19:8089->10.0.1.11:49303: write: broken pipe
/home/vagrant/go/src/runtime/panic.go:458 (0x69f50)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:420 (0xff28c)
/home/vagrant/channels-server-armv7l/http.go:2184 (0x333ac)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:2145 (0x32da0)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:206 (0x15a90)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:186 (0x15720)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/recovery.go:45 (0x10c8c4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/contrib/sessions/sessions.go:65 (0x277e38)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/fancybits/gzip/gzip.go:46 (0x276818)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:248 (0x1df10)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/gin.go:284 (0x1032fc)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/gin.go:265 (0x103008)
/home/vagrant/go/src/net/http/server.go:2202 (0x1fd944)
/home/vagrant/go/src/net/http/server.go:1579 (0x1faae4)
/home/vagrant/go/src/runtime/asm_arm.s:998 (0xa4920)

2017/02/26 19:49:56 [Recovery] panic recovered:
GET /devices/132238AD/guide?time=1488156520&duration=10800 HTTP/1.1
Host: 10.0.1.19:8089
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: en-us
Authorization: 1488156520-AICmPUWgqIdpLx8HoiNpUFOBTTxiooyusiHkNn2+BUA=
Connection: keep-alive
User-Agent: Channels/2.26.48 CFNetwork/810.2.9 Darwin/16.3.0

write tcp 10.0.1.19:8089->10.0.1.11:49307: write: broken pipe
/home/vagrant/go/src/runtime/panic.go:458 (0x69f50)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:420 (0xff28c)
/home/vagrant/channels-server-armv7l/http.go:2184 (0x333ac)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:2145 (0x32da0)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:206 (0x15a90)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:186 (0x15720)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/recovery.go:45 (0x10c8c4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/contrib/sessions/sessions.go:65 (0x277e38)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/fancybits/gzip/gzip.go:46 (0x276818)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/http.go:248 (0x1df10)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/context.go:97 (0xfd8b4)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/gin.go:284 (0x1032fc)
/home/vagrant/channels-server-armv7l/.go/src/github.com/gin-gonic/gin/gin.go:265 (0x103008)
/home/vagrant/go/src/net/http/server.go:2202 (0x1fd944)
/home/vagrant/go/src/net/http/server.go:1579 (0x1faae4)
/home/vagrant/go/src/runtime/asm_arm.s:998 (0xa4920)

Ok, the problem seems to be that it takes a long time for the guide data to transfer from the DVR to the ATV.

I tried hitting this URL from my laptop:

http://10.0.1.19:8089/devices/132251E8/guide?time=1488156071&duration=10800

It look about 60 seconds for the JSON file to return in the browser. The JSON file is about 2.1 MB.

Cool thanks.

Can you SSH in and run these commands:

cd /mnt/HD/HD_a2/Nas_Prog/ChannelsDVR/channels-dvr/data
du -sh *.airings

4.5G USA-VA65087-X.airings

Yikes, okay.

I was working on some improvements to the guide database last week, which should be ready this week sometime. Should reduce the size of the database on disk which will in turn make fetching guide data a lot faster.

1 Like

Thanks. Is there anything I can do in the meantime to mitigate this?

When I look int the folder ‘USA-VA65087-X.airings/store’, there are hundreds of 2MB files (i.e. 142424.ldb).

Many of them are timestamped from today, although they go back a week or so.

You can try this:

  • Turn off the DVR (from WD app manager)
  • Delete the airings directory (rm -rf USA-VA65087-X.airings)
  • Start DVR again

It will re-download the guide data on start. When the guide is done downloading, check the size on disk again and see how long that guide request takes.

Yay! After taking those steps, the JSON file takes only 5 seconds to retrieve via the browser (and the app loads much faster).

Thanks again! Looking forward to the fix…

I’m having the same issue with long load times. I have QNAP-451. I trired following steps above but didn’t find the airings directory.

Appreciate any help.

On the QNAP, the files live under:

/share/CACHEDEV1_DATA/.qpkg/ChannelsDVR/channels-dvr/data

OK. I stopped service on qnap. Removed the file. Started the service. Now I get a page cannot be found error when I try to go back to web viewer. What did I mess up?

Hard to say without knowing what commands you ran…

Sounds like maybe the service isn’t starting up correctly. You could check the channels-dvr.log to see if there’s an error message.

2017/02/28 16:08:40 [SYS] Starting Channels DVR v2017.01.20.0217 (linux-x86_64) in /share/CACHEDEV1_DATA/.qpkg/ChannelsDVR/channels-dvr/data
2017/02/28 16:08:40 [HDR] Found 1 devices
2017/02/28 16:08:41 [ERR] bonjour: Failed to bind to udp6 port: listen udp6 [ff02::]:5353: socket: address family not supported by protocol
2017/02/28 16:08:41 [SYS] Bonjour service running for dvr-inganas.local. [10.0.1.9]
2017/02/28 16:08:42 [SYS] Started HTTP Server
panic: invalid page type: 3: 10

goroutine 1 [running]:
panic(0xad4e60, 0xc4204bfb80)
/home/vagrant/go/src/runtime/panic.go:500 +0x1a1
github.com/boltdb/bolt.(*Cursor).search(0xc42038fb18, 0xc4204bfb40, 0x4, 0x8, 0x3)
/home/vagrant/channels-server-x86_64/.go/src/github.com/boltdb/bolt/cursor.go:256 +0x429
github.com/boltdb/bolt.(*Cursor).seek(0xc42038fb18, 0xc4204bfb40, 0x4, 0x8, 0x0, 0x0, 0xc4204b73e0, 0x0, 0x0, 0x0, …)
/home/vagrant/channels-server-x86_64/.go/src/github.com/boltdb/bolt/cursor.go:159 +0xb1
github.com/boltdb/bolt.(*Bucket).CreateBucket(0xc42042b358, 0xc4204bfb40, 0x4, 0x8, 0xc42038fc00, 0xc42038fc00, 0x6708d9)
/home/vagrant/channels-server-x86_64/.go/src/github.com/boltdb/bolt/bucket.go:172 +0x124
github.com/boltdb/bolt.(*Bucket).CreateBucketIfNotExists(0xc42042b358, 0xc4204bfb40, 0x4, 0x8, 0xc42038fc60, 0x4528d3, 0xc42038fc30)

rm -rf USA-MN55419-X.airings

This is what I ran.

Not sure what happened, but your database has become corrupted.

Try this:

cd /share/CACHEDEV1_DATA/.qpkg/ChannelsDVR/channels-dvr/data
mv recorder.db recorder.db.old
mv settings.db settings.db.old

Then start the DVR, and visit http://x.x.x.x:8089/restore to find and restore a recent backup.