EventStream Connection Error for EPUB

Howdy,
I’ve been trying for a few months now to make an EPUB export of a Pressbook but it keeps stalling out at chapter 19 of 65 and then the EventStream Connection Error appears.


image

Sometimes that happens as quickly as 11 seconds and as long as 40 seconds into the process. I have error log checked but I never get any notification of what happens.

I do not consistenly get the EventStream Connection Error so I do not believe it is my server, my CSS, or my use of H5p.

  • I’ve tried with a big book (A), and a small book (B). And get the same EventStream Connection Error.
  • I’ve EPUB exported on another book (C) with the same custom CSS as the big and small book and it exported just fine. The only difference of book C is that is does not contain any H5p.
  • I’ve successfully exported another very small book (D) that has 1 H5p element and no custom CSS.

What else can I try and how do I figure out what the error is that is causing the EventStream to lose connection?

Greatly appreciate any advice,
Cheers - Shar :star:

Hi Shar – can you share the URL for the book in question and copy the contents of the diagnostics page for the network you’re running this export on (will be at YOURNETWORKURL/wp-admin/options.php?page=pressbooks_diagnostics in reply to this thread? That might help folks reproduce or dig into what’s going wrong here.

Hi Steel,
“Sorry, you are not allowed to access this page.” is the message I get when trying to grab the network diagnostics info. Should I reach out to my network admin (aka librarian) for the diagnostics page info?

Here are my books:

  • Big Book A 477 pages digital PDF, web and PDF CSS. EventStream Connection error.
  • Small Book B where I test things out. Once upon a time when the book was still young I got an EPUB export from it, but no more. web and PDF CSS. EventStream Connection error.
  • Another Book C with web CSS only. successful EPUB.
  • Very Small Book D no custom CSS at all. successful EPUB.

Hope that helps y’all help me,
Cheers - Shar :star:

1 Like

Hi SharStar,

I think it’s going to be very important to talk to admin to get the network diagnostics page. I was seeing the Event Stream Error ALL THE TIME on my network, and I was trying to reproduce it well enough to get a detailed bug report for the Pressbooks team.

I had my Pressbooks network set up on PHP 8.0, when it should have been set up on PHP 7.4.

When I switched from PHP 8.0 → 7.4, all my event stream problems went away.

2 Likes

Hi Shar – what you shared was very helpful. Your books are on a network we host for the University of Washington, so this is probably going to be best handled as a premium support ticket, rather than here as a question in the forum for open source users/developers. I’ll open a support ticket for your issue and send an email to you and your network manager with our initial findings shortly. For future problems like this, we’d recommend taking them to your network manager(s) – they will have access to premium support with Pressbooks staff and you’ll be sure to get speedy, helpful support.

Yay!! Thanks much @SteelWagstaff ! :doughnut::bouquet:
cheers - Shar :star:

Hi Ed,
Oh I hope it’s the same kind of easy fix with the PHP. :crossed_fingers:
Cheers - Shar :star:

hi @SharStar I just sent you and your network manager an email. Hopefully you received it? It looks like the issue in both cases has to do with <video> elements with external src files. The EPUB export is trying to fetch the files and include them in the epub package as included assets, and I think it’s timing out because the files are too large. Video elements are currently not particularly well supported (or defined) in the EPUB specification: EPUB 3.3, and I think the preferred way to handle them would be to use embedded videos hosted on external streaming service rather than trying to package lots of video files with the EPUB.

Greetings @SteelWagstaff ,

Thanks for the diagnosis and I’ll pass on the advice to our media team about how we can stream videos with a built-in player (and use iframe embed) rather than relying on the browser’s player in the video tag.

Many thanks,
Shar :star:

1 Like