Jump to content

Roku app never finishes Loading or Retrieving when behind reverse proxy


benklop

Recommended Posts

benklop

Recently the Roku app has stopped working correctly for my family. Whenever we try to play a video, it either never finishes retrieving, or after a few seconds of play it start loading again, and does not ever finish. Videos play fine from a laptop.

 

After some troubleshooting I have discovered that everything works properly when connecting directly to emby, but fails as above when using an nginx reverse proxy. I've been using the reverse proxy ever sice i started using emby, so it's new behavior that it does not work now.

 

As the roku sits in retrieving, I see this repeatedly in the nginx logs:
 

192.168.6.59 - - [15/Jun/2019:23:52:10 -0600] "GET /emby/Sessions?deviceId=75e55a13-af5d-51a2-88de-19f691b4b6f7 HTTP/1.1" 200 1618 "-" "Roku/DVP-9.10 (519.10E04111A)"
192.168.6.59 - - [15/Jun/2019:23:52:12 -0600] "GET /emby/videos/109728/hls1/main/1.ts?DeviceId=75e55a13-af5d-51a2-88de-19f691b4b6f7&MediaSourceId=6527a5714674becb83efd40b33208476&PlaySessionId=ad317233652b4344a750d808e026e4cb&api_key=b21ddb589d2a41ffaba61fad7ea51476&VideoCodec=h264,mpeg1video,mpeg2video&AudioCodec=aac,mp2,mp3,flac,opus,vorbis,lpcm&VideoBitrate=109808000&AudioBitrate=192000&MaxFramerate=61&MaxWidth=1280&MaxHeight=720&AudioStreamIndex=1&TranscodingMaxAudioChannels=2&SegmentContainer=ts&SegmentLength=3&MinSegments=1&BreakOnNonKeyFrames=True&h264-maxrefframes=16&h264-videobitdepth=8&h264-profile=high,main,baseline,constrainedbaseline&h264-level=41&aac-audiochannels=2&flac-audiochannels=2&lpcm-audiochannels=2&mp3-audiochannels=2&mp2-audiochannels=2&vorbis-audiochannels=2&opus-audiochannels=2&TranscodeReasons=AudioCodecNotSupported HTTP/1.1" 206 146234 "-" "Roku/DVP-9.10 (519.10E04111A)"

I'm honestly not sure what to try next. there are no errors in the nginx error log, so i don't know how it could be breaking things.

Link to comment
Share on other sites

Please try with the Emby beta of the Roku app. This may provide a better experience. I recently included fixes in areas to address issues where the app was attempting to recover unrecoverable streams. There is an underlying issue and the beta app should be able to give a proper error message what that is. Please let us know if it does not. Thanks.

 

We are working on more upgrades/improvements to the Roku app every day and playback issues are priority number one. Please bear with us and work with us to address your problem. We may need server logs and ffmpeg logs from you if the beta does not address your issues. We apologize and we will keep in contact with you in this thread. If you have any further issues with the beta please follow up in this thread. Thanks. ^_^

Edited by speechles
Link to comment
Share on other sites

benklop

I forgot to mention that I already did load and try the emby beta app - unfortunately the issue seems to be present there as well.

 

I did NOT let the emby beta app run long enough to time out retrieve, so I did not see any error messages. I'll do that soon, when i have a moment.

 

I had a hunch this morning, and I modified my nginx configuration to allow http connections, instead of automatically redirecting http to https. After doing that, using both http://emby.servername.com:80 (through the nginx proxy), and https://emby.servername.com:443 work properly - so I suspect that some part of the emby app is trying to connect to http://<name> even when the server is configured for access via https, and that part of the app does not work properly with redirects. I'm attempting to verify this suspicion.

Link to comment
Share on other sites

benklop

The server dashboard displays this:

 

Remote (WAN) access: https://emby.klopnet.com:443

however, these connections are from the LAN though I am connecting to that address.

 

To add a further wrinkle, I have a roku TV in addition to the roku express i have done all of this testing on. I didn't consider that the two devices might act differently, but it appears that the roku TV is not exhibiting the problem, but the roku express is. I need to further test the http vs https factor on the roku express, because I only tested that on the roku TV.

Link to comment
Share on other sites

Right once the apps establish connection, they will then get address info from the server in order to stay updated, and as part of that, they will always attempt connection on the local address first.

Link to comment
Share on other sites

benklop

first - with redirect totally disabled, the roku express does experience this issue when connecting via HTTPS or HTTP. So, whether there's a redirect on HTTP or not, and whether SSL or not, the issue does occur on the roku express as long as I am proxying through nginx.

 

playback appears to work perfectly well n each of these scenarios using a TCL roku TV.

 

Second - the beta app does not behave differently than the stable app, even if i let it sit in 'retrieving' for like 10 minutes, so it doesn't seem like timeout changes have made a difference here.

 

Because the behavior occurs with HTTP, later today I will try sniffing the traffic to see exactly what requests are being made and if the nginx proxy configuration (very close to the configuration pinned on this forum) is perhaps mangling something.

Link to comment
Share on other sites

snodrog742

I've been beating my head against a wall thinking it was me.  We recently started experiencing this too but no issues in the log that I can find.  Seems to only be Roku related and using both Beta & Stable.

 

Logs attached.

 

 

Log-13.txt

Link to comment
Share on other sites

benklop

I would not be surprised if I did recently get a firmware update, but I'm not the primary user of this roku and I don't think I would probably notice.

 

current details:

3900X - Roku Express

9.1.0 - Build 4111-51

Link to comment
Share on other sites

benklop

It appears this is pretty recent firmware - https://support.roku.com/article/228844467-roku-os-software-release-notes

It looks like it came out on or around May 14 (according to google metadata - it doesn't seem to be listed on that page), and says it wil roll out "in the coming weeks", which just about fits when my family started telling me emby wasn't working on the roku.

 

My Roku TV (Model 7101X / TCL 43" 43S405) that does NOT experience the issue is on "9.0.0 - build 4151-30" - so it's entirely possible this broke with firmware 9.1.0. The article linked above claims all roku TVs will get 9.1.0, so I guess when that happens I'll find out for sure if the roku TV can no longer use emby through the reverse proxy.

Link to comment
Share on other sites

snodrog742

I would not be surprised if I did recently get a firmware update, but I'm not the primary user of this roku and I don't think I would probably notice.

 

I echo this.  I'd have to check firmware but really wouldn't be surprised.

Link to comment
Share on other sites

benklop

I have a Roku Streaming Stick 3600X which hasn't been plugged in since march. It was on 9.0.0 when I plugged it in, and emby works correctly through the proxy. I then updated it to "9.1.0 - 4111-24". After doing that, emby STILL works correctly through the proxy. Now, this is not the exact same build as the Roku Express, so it's possible the difference there accounts for it. I now have two devices on 9.1.0 (different builds however), one of which works through the proxy, the other which does not.

Link to comment
Share on other sites

  • 4 weeks later...
jeffsand121

Is there a solution to this Roku issue?  I am having the same problem with several different Roku models that are used remotely and have all been updated to version 9.1.0.  These have been tested from multiple remote locations and different wifi connections, all with the same result.  I have tested using a Windows browser, Android Emby app, Windows Emby app, and iOS Emby app and there are no issues with any of these devices playing TV shows or movies from the emby server, just the Roku Emby app is not working properly.  All the Roku Emby apps were working properly prior to the updated firmware.

Link to comment
Share on other sites

HI there, have you tried the new Roku app update that was released today?

Link to comment
Share on other sites

Ok so this is reverse proxy related. Most likely it's related to your nginx configuration that might be tampering with the original requests or responses.

 

I would suggest comparing your nginx config to here:

https://emby.media/community/index.php?/topic/48236-setting-up-emby-behind-a-reverse-proxy-nginx/?p=457670

 

Please let us know if this helps. Thanks.

Link to comment
Share on other sites

jeffsand121

Thank you, I will check it. I am using the Emby docker and the linuxserver/letsencrypt docker with the sample configs to handle the SSL and reverse proxy. It is just odd that my Roku TV with the older firmware still works with no problem, but the Streaming Stick, Express, and 4 older models all stopped playing media after the update.

Link to comment
Share on other sites

The newer firmwares have changes to local domain policy. Changes also to the SSL security policy for cross domains. All of this was done to prevent hijack of the Roku ECP port and intercepting DIAL from outside of the network by spoofing internal IP addresses. With these changes it breaks those spoofs. It also breaks reverse proxies that before were allowed and were not forwarding headers correctly. Those are seen as cross domain now rather than in domain. It causes the Roku to abort and reject the connection. That is entirely the reason.

Edited by speechles
Link to comment
Share on other sites

jeffsand121

Thank you for the information. I will keep working with my config and hopefully find the right combination.

Link to comment
Share on other sites

jeffsand121

Yes I did, thank you. I have used the same settings in my nginx config as the one you posted, but still having the same issue.

Link to comment
Share on other sites

pir8radio

Thank you for the information. I will keep working with my config and hopefully find the right combination.

 

I have roku users that have been playing fine with the config that luke posted earlier. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...