Live Stream Error Logs: What causes 'Cannot get sha256 segments'?

I’ve been having an awesome time with PeerTube these past few weeks, getting things set-up, correcting configuration issues on my server, asking many of my friends to help diagnose issues. All of my viewers agree that PeerTube is great, and we’ve squashed most of the issues we’ve had along the way.

Diagnosing issues is sometimes difficult because my logs fill up with these errors, which repeat constantly and for every viewer of my live streams:

error[8/8/2024, 1:04:10 AM] Client log: Cannot get sha256 segments

{
« tags »: [
« client »
],
« userAgent »: « Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 »,
« stackTrace »: « Failed to fetch\nTypeError: Failed to fetch\n at https://tube.vencabot.com/client/en-US/polyfills-DKLCR6XS.js:2:3231\n at Me.r. (https://tube.vencabot.com/client/en-US/polyfills-DKLCR6XS.js:1:126604)\n at ml.fetchSha256Segments (https://tube.vencabot.com/client/en-US/chunk-M7F7KOTR.js:110:25382)\n at ml.loadSha256SegmentsPromise (https://tube.vencabot.com/client/en-US/chunk-M7F7KOTR.js:110:25083)\n at ml. (https://tube.vencabot.com/client/en-US/chunk-M7F7KOTR.js:110:24495)\n at Generator.next ()\n at o (https://tube.vencabot.com/client/en-US/chunk-ODKBFOSP.js:1:1257)\n at o.invoke (https://tube.vencabot.com/client/en-US/polyfills-DKLCR6XS.js:1:119357)\n at D.run (https://tube.vencabot.com/client/en-US/polyfills-DKLCR6XS.js:1:114647)\n at https://tube.vencabot.com/client/en-US/polyfills-DKLCR6XS.js:2:560 »,
« url »: « Stream Ended: Retroarch Netplay Experiments - Gauntlet (NES) and More! Let's get netplay working for future events! - tube.Vencabot.com »
}

error[8/8/2024, 1:04:23 AM] Client log: Cannot get sha256 segments

{
« tags »: [
« client »
],
« username »: « vencabot »,
« userAgent »: « Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0 »,
« stackTrace »: « JSON.parse: unterminated string literal at line 1 column 3648 of the JSON data\n »,
« url »: « Stream Ended: Retroarch Netplay Experiments - Gauntlet (NES) and More! Let's get netplay working for future events! - tube.Vencabot.com »
}

error[8/8/2024, 1:05:14 AM] Client log: Cannot get sha256 segments

{
« tags »: [
« client »
],
« username »: « vencabot »,
« userAgent »: « Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0 »,
« stackTrace »: « NetworkError when attempting to fetch resource.\n »,
« url »: « Stream Ended: Retroarch Netplay Experiments - Gauntlet (NES) and More! Let's get netplay working for future events! - tube.Vencabot.com »
}

error[8/8/2024, 1:05:21 AM] Client log: Cannot get sha256 segments

{
« tags »: [
« client »
],
« userAgent »: « Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 »,
« stackTrace »: « Unterminated string in JSON at position 3728 (line 1 column 3729)\nSyntaxError: Unterminated string in JSON at position 3728 (line 1 column 3729) »,
« url »: « Stream Ended: Retroarch Netplay Experiments - Gauntlet (NES) and More! Let's get netplay working for future events! - tube.Vencabot.com »
}

Most of my viewers are not very tech-literate, but they mostly report no problems. « A few seconds of buffering, very rarely, usually at the start of the stream. » In the rare case that I get to watch my own streams, I have a similar experience. Still, I’m surprised that I experience buffering at all (which never happens for me when watching my stream on Twitch, for example), and if it’s due to a problem that I can solve, I’d like to investigate and solve it.

It would seem that, based on reports from my viewers about how smooth their experience is, these constant errors in the log don’t reflect anything wrong that they can notice. Still, I’d like to ask: what causes these errors? I don’t know anything about HLS and I know very little about video streaming, but from the wordings of the errors it seems like it’s caused by a.) not being able to access (fetch) a particular file from the server that it wants, or b.) some transmission gets interrupted (?) causing a JSON file to never terminate.

One of my viewers was even receiving 429 ‹ Too Many Requests › from my server while trying to watch a livestream, and I believe that it was because he hit the API limit by trying to send all of his client error logs.

I’ve searched for this error on the PeerTube GitHub and on other search engines, and it comes up once-in-a-while (including on this forum), but I’ve never found a solid explanation of what causes these errors. If anyone here could enlighten me, I’d be very appreciative!

Hi,

To confirm: do you use object storage? If your server uses the classic filesystem to store and distribute lives?

1 « J'aime »

My server uses the classic filesystem. I don’t use any external object storage; everything is saved to the same server that PeerTube is running on.

If there’s any other information I can provide, I’d be happy to.

[EDIT] Also, to be clear, I use PeerTube almost exclusively for live-streaming, and these are errors encountered during live streams.

Yes, I confirm, I get the same error from time to time, I also have a classic server.

Thanks, we’ve made some improvements in the logging system to have less client errors, that will be available in next peertube minor version.

1 « J'aime »

Thank you! I still wonder what causes this bug, though, and if it really is entirely benign as it seems to be, and if there’s anything I can do to prevent it.

The « Cannot get sha256 segments » error likely indicates problems with fetching video segments. It might be due to network issues, server configuration, or HLS stream problems. Since viewers experience minimal buffering, it could be a logging issue or intermittent connectivity. Reviewing server logs and HLS settings may help resolve it.

I had deduced that much, but it happens so constantly for every client (including me watching my own stream, wired on desktop) that I do not believe it could be due to network issues on either the server or client side. That’s why I’m asking about what server configuration or HLS issues could be causing it.