Jump to content

No Streams Available Error


thomasjcf21
 Share

Go to solution Solved by thomasjcf21,

Recommended Posts

thomasjcf21

Hey Guys,

So I have an unusual error with Emby on a couple of iOS Devices, please note that this does not affect all iOS Devices and my testing table is below:

iPhone Type iOS Version Emby Version Affected?
iPhone X V14 iOS 2.0.9 Yes
iPhone XS V14 iOS 2.0.9 No

The setup of the Emby Server is that there is a HAProxy Reverse Proxy sat in front which handles the HTTPs communication, as far as I can tell this is working correctly, and this is proven by all the none iOS devices which work perfectly, and some of the iOS devices that also work (as well as the ones that do not work in the iOS App working on Safari on the same device). It should also be noted that on the devices which do not work, they are able to play moves fine on Safari just not on the iOS App. They are presented with an image similar to below...

Snapchat-1680011040.thumb.jpg.04138e0e630a6eb45cd8520fee10b90b.jpg

I placed HAProxy into Debug Mode so that it will log the actual URLs being requested, and it looks like the app is requesting an invalid HOST HEADER which results in the backend not being matched, and therefore a 503 being returned. As seen below:

Oct  4 21:47:07 hap00001.hmnetworks.ss haproxy[29532]: 95.148.163.<REDATCED>:64245 [04/Oct/2021:21:47:07.726] https_entry~ https_entry/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 4/2/0/0/0 0/0 "GET /emby/videos/4895/stream.mkv?DeviceId=3A8831D3-<REDATCED>&MediaSourceId=156e75<REDATCED>&Static=true&PlaySessionId=b7741<REDATCED>&api_key=a1a7e<REDATCED>&SubtitleCodec=subrip HTTP/1.1"
Oct  4 21:43:10 hap00001.hmnetworks.ss haproxy[29429]: 95.148.163.<REDATCED>:64039 [04/Oct/2021:21:43:10.069] https_entry~ https_entry/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 5/2/0/0/0 0/0 "GET /emby/videos/4895/master.m3u8?DeviceId=3A8831D3-<REDATCED>&MediaSourceId=156e75<REDATCED>&PlaySessionId=f58e15b<REDATCED>&api_key=a1a7e<REDATCED>&VideoCodec=h264,hevc,mpeg2video&AudioCodec=ac3,mp3,aac&VideoBitrate=419680000&AudioBitrate=320000&AudioStreamIndex=1&TranscodingMaxAudioChannels=6&SegmentContainer=ts&SegmentLength=3&MinSegments=1&BreakOnNonKeyFrames=True&hevc-profile=Main,Main10&TranscodeReasons=DirectPlayError&allowVideoStreamCopy=false HTTP/1.1"
Oct  4 21:43:10 hap00001.hmnetworks.ss haproxy[29429]: 95.148.163.<REDATCED>:64040 [04/Oct/2021:21:43:10.660] https_entry~ https_entry/<NOSRV> -1/-1/-1/-1/0 503 212 - - SC-- 5/2/0/0/0 0/0 "GET /emby/videos/4895/master.m3u8?DeviceId=3A8831D3-<REDATCED>&MediaSourceId=156e75<REDATCED>&PlaySessionId=6015ca<REDATCED>&api_key=a1a7e<REDATCED>&VideoCodec=h264,hevc,mpeg2video&AudioCodec=ac3,mp3,aac&VideoBitrate=419680000&AudioBitrate=320000&AudioStreamIndex=1&TranscodingMaxAudioChannels=6&SegmentContainer=ts&SegmentLength=3&MinSegments=1&BreakOnNonKeyFrames=True&hevc-profile=Main,Main10&TranscodeReasons=DirectPlayError&allowVideoStreamCopy=false&allowAudioStreamCopy=false HTTP/1.1"

This is a different device, which is working fine:

Oct  4 22:04:10 hap00001.hmnetworks.ss haproxy[29838]: 92.233.136.<REDACTED>:59109 [04/Oct/2021:22:04:07.084] https_entry~ emby/mms00001.hmnetworks.ss 0/0/1/18/3489 206 16945152 - - CD-- 6/4/1/1/0 0/0 "GET /emby/videos/2491/stream.mkv?DeviceId=89455AFA-<REDACTED>&MediaSourceId=3a8b8<REDACTED>&Static=true&PlaySessionId=f9e12b3a5<REDACTED>&api_key=4f59b4<REDACTED>&SubtitleCodec=subrip HTTP/1.1"
Oct  4 22:04:20 hap00001.hmnetworks.ss haproxy[29838]: 92.233.136.<REDACTED>:59119 [04/Oct/2021:22:04:19.978] https_entry~ emby/mms00001.hmnetworks.ss 0/0/1/70/345 206 802816 - - CD-- 10/8/4/4/0 0/0 "GET /emby/videos/4895/stream.mkv?DeviceId=89455AFA-<REDACTED>&MediaSourceId=156e75<REDACTED>&Static=true&PlaySessionId=5e57c6<REDACTED>&api_key=4f59b45e<REDACTED>&SubtitleCodec=subrip HTTP/1.1"
Oct  4 22:04:20 hap00001.hmnetworks.ss haproxy[29838]: 92.233.136.<REDACTED>:59120 [04/Oct/2021:22:04:20.264] https_entry~ emby/mms00001.hmnetworks.ss 0/0/1/24/671 206 2317482 - - ---- 4/2/1/1/0 0/0 "GET /emby/videos/4895/stream.mkv?DeviceId=89455AFA-<REDACTED>&MediaSourceId=156e75<REDACTED>&Static=true&PlaySessionId=5e57c68<REDACTED>&api_key=4f59b45e<REDACTED>&SubtitleCodec=subrip HTTP/1.1"

I'm stumped as if my understanding is correct, it looks like the iOS app gets confused what the server hostname is (frankflix.thomasfranklin.co.uk) ommits it and then HAProxy returns a 503 as it cannot match the host name to the correct endpoint. I've also attached the server logs (in debug), below:

embyserver (2).txt

The network configuration for this server is below:

screenshot-2021-10-04-23-29-03.png.1a836b399e8ad17811d54c93b919966d.png

I'm not sure how relevant this would be, but this is the shorted HAProxy configuration for the external emby SSL:

frontend https_entry
    bind *:443 ssl crt /etc/haproxy/thomasfranklin.pem
    
    option httpclose
    option forwardfor

    # ACL for external access to each service
    acl host_frankflix hdr(host) -i frankflix.thomasfranklin.co.uk

    # Protects the internal range from people externally manipulating host headers
    acl host_internal hdr_end(host) -i hmnetworks.ss
    acl internal_range src 10.0.0.0/8
    http-request deny if host_internal !internal_range

    # Define external backend rules
    use_backend emby if host_frankflix

Any help would be much appreciated as only a couple of iOS Devices (not all of them) are doing this, and the same movie on different iOS devices are working where some are failing. On some devices it requests an .mkv and others master.m3u8, this i guess is whether it needs to be transcoded or not. In the case of the phone which fails it fails with the same ommiting hostname on either a master.m3u8 or .mkv request.

Many Thanks,

Tom.

Link to comment
Share on other sites

thomasjcf21

In addition to the phone listed above that is not working, this version is also not working:

iPhone 11 Pro Max, iOS 14.7.1, Emby version iOS 2.0.9

Link to comment
Share on other sites

  • Solution
thomasjcf21

Update, I've added additional logging to HAProxy and identified the issue and have been able to fix it. The issue is that the Emby iOS App makes the requests with the correct HTTP Header, as seen below:

Host: frankflix.thomasfranklin.co.uk

But when making segment / manifest requests it was changing the host request to include the port, as seen below:

Host: frankflix.thomasfranklin.co.uk:443

This was obviously not matching the HAProxy requirements, and as such it was rejecting it. Not sure why the host header is different on certain devices, and if this is a bug or an iOS thing, @Luke I guess that decision would sit with you?! I've updated my HAProxy config to below and can confirm it is working:

frontend https_entry
    bind *:443 ssl crt /etc/haproxy/thomasfranklin.pem
 
    option httpclose
    option forwardfor

    # ACL for external access to each service
    acl host_frankflix hdr(host) -i frankflix.thomasfranklin.co.uk or hdr(host) -i frankflix.thomasfranklin.co.uk:443

    # Protects the internal range from people externally manipulating host headers
    acl host_internal hdr_end(host) -i hmnetworks.ss
    acl internal_range src 10.0.0.0/8
    http-request deny if host_internal !internal_range

    # Define external backend rules
    use_backend emby if host_frankflix

The log capture which shows the header changing is below:

Oct  5 00:20:50 hap00001.hmnetworks.ss haproxy[31280]: 95.148.163.<REDACTED>:58050 [05/Oct/2021:00:20:49.481] https_entry~ emby/mms00001.hmnetworks.ss 0/0/3/4/976 200 314064 - - ---- 4/4/3/3/0 0/0 {frankflix.thomasfranklin.co.uk} "GET /emby/Items/4895/Images/Primary?maxHeight=1800&maxWidth=1200&tag=b59f5222668e786c8fb249965d464217&quality=90 HTTP/1.1"
Oct  5 00:20:51 hap00001.hmnetworks.ss haproxy[31280]: 95.148.163.<REDACTED>:53271 [05/Oct/2021:00:20:49.408] https_entry~ emby/mms00001.hmnetworks.ss 0/0/1/20/2046 206 2317482 - - ---- 3/3/2/2/0 0/0 {frankflix.thomasfranklin.co.uk:443} "GET /emby/videos/4895/stream.mkv?DeviceId=3A8831D3-4B0F-43A0-B2BA-8B24257FEBEA&MediaSourceId=156e7501ba07e47c61b688a72bd49c67&Static=true&PlaySessionId=e70b36c1b96b4fd2a9b241c670f0086a&api_key=e0c1f13788d94d69b50d4ea73dc5b5da&SubtitleCodec=subrip HTTP/1.1"
Oct  5 00:20:59 hap00001.hmnetworks.ss haproxy[31280]: 95.148.163.<REDACTED>:58057 [05/Oct/2021:00:20:59.246] https_entry~ emby/mms00001.hmnetworks.ss 0/0/1/2/3 200 439 - - ---- 4/4/3/3/0 0/0 {frankflix.thomasfranklin.co.uk} "OPTIONS /emby/Sessions/Playing/Progress?X-Emby-Client=Emby%20for%20iOS&X-Emby-Device-Name=Jacks%20iPhone%20X&X-Emby-Device-Id=3A8831D3-4B0F-43A0-B2BA-8B24257FEBEA&X-Emby-Client-Version=2.0.9&X-Emby-Token=e0c1f13788d94d69b50d4ea73dc5b5da HTTP/1.1"
Oct  5 00:20:59 hap00001.hmnetworks.ss haproxy[31280]: 95.148.163.<REDACTED>:58058 [05/Oct/2021:00:20:59.310] https_entry~ emby/mms00001.hmnetworks.ss 0/0/1/2/3 200 439 - - ---- 4/4/3/3/0 0/0 {frankflix.thomasfranklin.co.uk} "OPTIONS /emby/Sessions/Playing/Progress?X-Emby-Client=Emby%20for%20iOS&X-Emby-Device-Name=Jacks%20iPhone%20X&X-Emby-Device-Id=3A8831D3-4B0F-43A0-B2BA-8B24257FEBEA&X-Emby-Client-Version=2.0.9&X-Emby-Token=e0c1f13788d94d69b50d4ea73dc5b5da HTTP/1.1"

The relevant information is inbetween the {}.

Many Thanks,

Tom.

Link to comment
Share on other sites

Thanks for the feedback. It's just a matter of the user interface and the video player having their own http layers.

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
 Share

×
×
  • Create New...