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.
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?
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.
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.
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.
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.
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.
hi @marbaque I don’t think it’s a PHP 8 issue. We run all our hosted instances on PHP 8.1 and don’t see this error when we run exports. Not sure what the issue is as I don’t see it in our logs, but maybe others from the open source community have seen it and can advise?
Thank you @SteelWagstaff, we had an older version of pressbooks runnign on PHP 8… we updated pressbooks to 6.8.0, and now I don’t see the errors anymore. However, the PDF export keeps failing and the only message is “The export failed. Check the log for more details”, but the log shows no details.
@marbaque If you can’t find the error reports in your logs, you should be able to turn on email notifications for export errors. To do this, go to Settings->Export in your book dashboard and turn ‘Email Validation Logs’ on. A notification will be sent to the email address of the person who created the export with the errors.
Thank you, @SteelWagstaff but as strange as it sounds there are no errors in the log, and it is not sending any email notifications when trying to export to PDF.
I do get the email notification with errors and warnings when exporting to other formats.