nicknsy / jellyscrub

Smooth mouse-over video scrubbing previews for Jellyfin.
MIT License
668 stars 27 forks source link

Random errors when trying to playback #63

Closed JPVenson closed 1 year ago

JPVenson commented 1 year ago

Hey,

Since yesterday i get random errors when trying to start a playback in browser:

POST http://*.de/Items/e73d62421395e5c470fe04ce56370434/PlaybackInfo?UserId=*&StartTimeTicks=2435210470&IsPlayback=true&AutoOpenLiveStream=true&MaxStreamingBitrate=2400000000 400 (Bad Request)
window.fetch @ ClientScript:213
b @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
value @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
value @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
value @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
V @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
ue @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
se @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
ee @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
q @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
(anonymous) @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
Promise.then (async)
l.play @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
h @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
g @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
bt @ main.jellyfin.bundle.js?b4c4a9d9e3722a0dbc33:2
index.html#!/home.html:1 

       Uncaught (in promise) Response {type: 'basic', url: 'http:/*.de/Items/e73d62421395e5c470f…penLiveStream=true&MaxStreamingBitrate=2400000000', redirected: false, status: 400, ok: false, …}
ClientScript:226 

       Uncaught (in promise) TypeError: data.MediaSources is not iterable
    at ClientScript:226:39

That crashes the UI and makes it unresponsive to inputs and stuck at the loading screen. It happens 10 out of 12 times when trying to start a playback from Homescreen and 3-7 times when already in the video player and playing the next episode.

Version: 10.8.4 Operating System: Linux Architecture: X64 Jellyscrub: 1.0.0.7

nicknsy commented 1 year ago

Have you changed anything since yesterday?

In any case, please use the latest jellyfin version 10.8.8.

JPVenson commented 1 year ago

Nope out of the blue. I was in the middle of Season 2 of my series when it started. Will update and check again.

nicknsy commented 1 year ago

Alright, could be a bug with the plugin but it is odd that it would happen out of nowhere. Does it only happen when trying to play specific media or for everything?

I'd still update, but a refresh of the page should generally be enough to fix most small issues (obviously if it's a single piece of media jellyscrub is mishandling it wont fix that though).

JPVenson commented 1 year ago

Yea i know, did not expect that. I for now only had it on all episodes of Battlestar Galactica since yesterday, that is around 30 episodes or so. I have to refresh the whole Home page sometimes 3-5 times in a row. I had most success with the dev console open then it happens only in 10% of the time or so.

I could not find any exceptions thrown in the log.

nicknsy commented 1 year ago

Can you try on a different browser, device, or in an incognito windows? Does the issue remain?

You're using the latest version of jellyscrub too right

JPVenson commented 1 year ago

I will try on different browsers, yes the latest Jellyscrub: 1.0.0.7

JPVenson commented 1 year ago

It is reproduceable on

JPVenson commented 1 year ago

just updated to 10.8.8 and happend again on 3rd try with edge.

nicknsy commented 1 year ago

Does this happen with all media or just Battlestar Galactica? For instance, can you get trickplay previews on all media except the one series or is everything broken?

This is definitely a fixable issue as the whole code dealing with requests should really be in a try/finally block so the original request always goes through, but I'm really not sure what would cause this as any media you can play on your server should respond with a list of MediaSources.

The only thing I can see is that it says "400 (Bad Request)" in your original stack trace which could maybe mean there are issues with the server (unless that's just caused by jellyscrub throwing an exception during the fetch). Could you open the "Network" tab in Developer Tools when you try to play something and paste the response for "PlaybackInfo?UserId=......" requests? It should look something like this -- {"MediaSources":[{"Protocol":"File","Id":---}],"PlaySessionId":"----"}. No need to paste the whole thing in case there is any sensitive info.

nicknsy commented 1 year ago

Yeah in the stack trace it says {...redirected: false, status: 400, ok: false, …} so it's possible the server itself is returning 400. If you remove jellyscrub does video playback return to normal?