Closed DeathCamel58 closed 3 years ago
Until this is fixed, can you set up log file rotation to prevent the disk from filling up? Or change the warning/logging settings in PHP temporarily?
Please check that the root directory of your wordpress installation is writable by the WebServer process, as is the temp directory (if necessary, set it in wp-config) and bread's directory (wp-content/plugins/bread).
@DeathCamel58 the error message indicates that a stream resource is invalid. The FPDI library for some reason continues to the to iterate an invalid resource (probably a file, perhaps memory, but probably a file), thus filling the log file with warnings. What @otrok7 is suggesting is that you make sure the paths it could be attempting to access are writable, which could resolve the error. It would be helpful if you could determine what path it's attempting to access, as we've never seen this particular error before.
This issue is also reported for mPDF here. There's also a link to a SO question with information how to bypass this issue (harden the references to the file-handles used by the stream reader class). The root problem is in the TOC functionality of mPDF.
@DeathCamel58, please export your settings (you do this from the "Configuation" Tab) and post them here. Assuming it really is as Jan suggests, then I want to figure out why it is affecting you and not other people using Bread, and so, maybe find a workaround until Mpdf is fixed.
When diagnosing the issues on our site initially, I saw it was bread, disabled and reenabled it, and saw the issue persist. Going back to the affected site and enabling it isn't causing the issue to re-appear currently.
I'm closing this issue until I notice it happen again (multiple sites on our server had this issue, many have not been affected by this issue).
The problem is that it is only triggered if PHPs garbage collector is triggered and frees "unused" objects. This requires that there's a huge amount of data in memory.
Reopened, as Minnesota is also seeing this issue.
Please send me the JSON export file, let me see if I can reproduce the problem. Or maybe a stack trace. Minnestota has been using bread for a while...are they doing something new (eg., are they moving from flyer to booklet format)?
I asked them on the Facebook group to send the json export to one of us.
This is the message they originally posted:
We are having issues with space and discovered our debug log is HUGE! We have also noticed that it has many items related to bread,
[11-Jan-2021 20:03:20 UTC] PHP Warning: fread(): supplied resource is not a valid stream resource in /home/customer/www/naminnesota.org/public_html/wp-content/plugins/bread/mpdf/vendor/setasign/fpdi/src/PdfParser/StreamReader.php on line 465 This is one thing we are seeing. We have had a n issue with bread for several months. The only way we can get the PDF to generate is using tomato.
So it sounds like they are having this issue among others.
Fixed in 2.5.8
Bread is causing a massive log file on some of our sites. This log file grows with repeating lines until disk is used.
Apache Server version: Apache/2.4.46 (cPanel) phpinfo() html file: PHP 7.3.26 - phpinfo().zip Wordpress 5.6 Wordpress Plugins
Here's a small excerpt of the log below.
170,000 lines later (1 second later)
These same log lines repeat until disk is filled.