Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live streaming is stuck, get lots of 403 (forbidden) #3786

Closed
3 of 5 tasks
papan01 opened this issue Apr 16, 2021 · 5 comments · Fixed by #3787
Closed
3 of 5 tasks

Live streaming is stuck, get lots of 403 (forbidden) #3786

papan01 opened this issue Apr 16, 2021 · 5 comments · Fixed by #3787
Labels
Bug Regression A bug introduced in a recent release
Milestone

Comments

@papan01
Copy link

papan01 commented Apr 16, 2021

What version of Hls.js are you using?

v1.0.0 and v1.0.1

What browser and OS (including versions) are you using?

Chrome 89.0.4389.114, Windows 10 Pro

Test stream:

None. Sorry, our streaming URL will expire when get the URL after 30 second and not public.

Configuration:

Default

Checklist

  • The stream has correct Access-Control-Allow-Origin headers (CORS)
  • There are no network errors such as 404s in the browser console when trying to play the stream

Steps to reproduce

  1. The URL must have more query string in manifest.
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,URI="https://744444.fake.domain.net/hls/live/717684/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/audio-very_low_audio-264/audio.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16",GROUP-ID="aac",LANGUAGE="audio-very_low_audio-264",NAME="audio-very_low_audio-264",DEFAULT=YES,AUTOSELECT=YES
#EXT-X-MEDIA:TYPE=AUDIO,URI="https://744444.fake.domain.net:443/hls/live/717684-b/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/audio-very_low_audio-264/audio.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16",GROUP-ID="aac",LANGUAGE="audio-very_low_audio-264",NAME="audio-very_low_audio-264",DEFAULT=NO,AUTOSELECT=YES
#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="avc1.4d0015,mp4a.40.2",BANDWIDTH=112000,RESOLUTION=190x108,AUDIO="aac",NAME="video-m1_video"
https://744444.fake.domain.net/hls/live/717684/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/video-m1_video/video.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16
#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="avc1.4d0015,mp4a.40.2",BANDWIDTH=112000,RESOLUTION=190x108,AUDIO="aac",NAME="video-m1_video"
https://744444.fake.domain.net:443/hls/live/717684-b/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/video-m1_video/video.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16
#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="avc1.4d0015,mp4a.40.2",BANDWIDTH=288000,RESOLUTION=384x216,AUDIO="aac",NAME="video-m2_video"
https://744444.fake.domain.net/hls/live/717684/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/video-m2_video/video.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16
#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="avc1.4d0015,mp4a.40.2",BANDWIDTH=288000,RESOLUTION=384x216,AUDIO="aac",NAME="video-m2_video"
https://744444.fake.domain.net:443/hls/live/717684-b/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/video-m2_video/video.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16
#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="avc1.4d0015,mp4a.40.2",BANDWIDTH=450000,RESOLUTION=512x288,AUDIO="aac",NAME="video-m3_video"
https://744444.fake.domain.net/hls/live/717684/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/video-m3_video/video.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16
#EXT-X-STREAM-INF:PROGRAM-ID=1,CODECS="avc1.4d0015,mp4a.40.2",BANDWIDTH=450000,RESOLUTION=512x288,AUDIO="aac",NAME="video-m3_video"
https://744444.fake.domain.net:443/hls/live/717684-b/ch01/f0ad4677dca7f44533ab8eb9fd68208922fb2a31/video-m3_video/video.m3u8?hdntl=exp=1618569277~acl=%2f*%2f717684*~hmac=f55b4c3dfc7d441d4aa6483ff680da787a9da30103afdd202599881e92c890d2&unique_id=f0b9bc763c4741df97bc2462d0b37e16

Expected behavior

No network error and doesn't stuck.

Actual behavior

Get lots of 403 (forbidden) that will cause the streaming stuck

Console output

image

@phillipseamore
Copy link
Contributor

We'll the URI's in the console output seem to have similar query parameters to the once in the playlist.

I'd guess it's the extremely short validity of your signed URI's that's the problem.

@papan01
Copy link
Author

papan01 commented Apr 16, 2021

We'll the URI's in the console output seem to have similar query parameters to the once in the playlist.

I'd guess it's the extremely short validity of your signed URI's that's the problem.

I've checked the query parameters that are inconsistent:

  • origin:
    cid=988&mid=26902912&ecid=1129079&pid=2&dtid=1&sid=105749709018&label=1&hdnts=ip=60.248.88.1~exp=1618639549~acl=%2F988%2F1129079%2Fmobile-vienna%2F%2A~hmac=3cf5e7031f7a1a32c998d125c07c41a6f642b81bd1a827833b20d0af5ee728f3
  • 403(Forbidden): cid=988&dtid=1&ecid=1129079&hdnts=ip%3D60.248.88.1%7Eexp%3D1618639549%7Eacl%3D%2F988%2F1129079%2Fmobile-vienna%2F*%7Ehmac%3D3cf5e7031f7a1a32c998d125c07c41a6f642b81bd1a827833b20d0af5ee728f3&label=1&mid=26902912&pid=2&sid=105749709018

The sorted is different and some sign are encoded.

@phillipseamore
Copy link
Contributor

Those both parse to the same output except for the order. Ordering of query parameters should not matter as it's quite common for caching/CDN infrastructure to sort query parameters to increase hit ratios. No RFC requires parameter order to be preserved and I've never encountered a system that needed it.

original parsed:

'cid': | 988
'mid': | 26902912
'ecid': | 1129079
'pid': | 2
'dtid': | 1
'sid': | 105749709018
'label': | 1
'hdnts': | ip=60.248.88.1~exp=1618639549~acl=/988/1129079/mobile-vienna/*~hmac=3cf5e7031f7a1a32c998d125c07c41a6f642b81bd1a827833b20d0af5ee728f3

403 parsed:

'cid': | 988
'dtid': | 1
'ecid': | 1129079
'hdnts': | ip=60.248.88.1~exp=1618639549~acl=/988/1129079/mobile-vienna/*~hmac=3cf5e7031f7a1a32c998d125c07c41a6f642b81bd1a827833b20d0af5ee728f3
'label': | 1
'mid': | 26902912
'pid': | 2
'sid': | 105749709018

Have you checked one of those URLs directly after they 403?

@papan01
Copy link
Author

papan01 commented Apr 16, 2021

No RFC requires parameter order to be preserved and I've never encountered a system that needed it.

Sure.

Have you checked one of those URLs directly after they 403?

Yes, the server side isn't own, so I just request again and get same response(403). I have some provider give me the live streaming URL(m3u8), one of provider URL that doesn't have any query parameters, that is no any issue, but the others have query parameters their URLs will cause 403.

This issue can't reproduce on v0.14.17. The PR is just using origin URL and doesn't get 403.

@robwalch robwalch linked a pull request Apr 16, 2021 that will close this issue
@robwalch robwalch added Bug Regression A bug introduced in a recent release labels Apr 16, 2021
@robwalch robwalch added this to the 1.0.2 milestone Apr 16, 2021
@robwalch
Copy link
Collaborator

The handling of URL Directives for LL-HLS has impacted how playlists with unsorted or unencoded query params are requested. I've reviewed the fix in #3787 submitted by @papan01 and am happy to include it in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Regression A bug introduced in a recent release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants