Create a Joomla 5.0.2 site. Go to admin interface. Select component Banners. Exact result may vary. On Debian 12 with PHP 8.2 the site crashes and records an error "AH01067: Failed to read FastCGI header".
Displays banners information
Site crashes
Debian 12 PHP-FPM 8.2 Joomla 5.0.2
This can also affect third party software that calls the relevant method.
Line 42 sets $date:
$date = Factory::getDate();
This is then used in a bind to a SQL statement. But it is an object. It works if changed to:
$date = (string) Factory::getDate();
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Sorry, forgot to mention that the file referred to that contains the error is .../administrator/components/com_banners/src/Helper/BannersHelper.php
Labels |
Added:
PHP 8.x
|
unable to replicate with php 8.2.16
I cannot reproduce either. Please enable debug mode and set error reporting to maximum to get a stack trace.
Labels |
Added:
Information Required
|
from my old memories could help
https://serverpilot.io/docs/error-failed-to-read-fastcgi-header/
I have set the error reporting to maximum and enabled the debug mode, but no stack trace shows up. The issue disappeared when I commented out this line in mod_banners.php: BannersComponentHelper::updateReset();
The results of (string) and ->toSql() are exactly the same (so either works):
var_dump(get_class($date), (string) $date, $date->toSql());
string(20) "Joomla\CMS\Date\Date" string(19) "2024-02-23 11:32:48" string(19) "2024-02-23 11:32:48"
On 23/02/2024 01:49, Tuan Pham Ngoc wrote:
I cannot reproduce the issue, too. However, I can see that the code is wrong. @webchun https://github.com/webchun @counterpoint https://github.com/counterpoint Could you please modify this line of code https://github.com/joomla/joomla-cms/blob/4.4-dev/administrator/components/com_banners/src/Helper/BannersHelper.php#L42 to:
$date =Factory::getDate()->toSql();
Then check it again to see if the error is gon?
—
Reply to this email directly, view it on GitHub #42841 (comment), or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJG5RKXQT6OILSDGMKT6A3YU7YQ5AVCNFSM6AAAAABDRHM4LOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGYZDOMJXG4.
You are receiving this because you were mentioned.Message ID: @.***>
-- Black Sheep Research icon
MartinBrampton
Director
Black Sheep Research
Phone icon
+44 1653 487048 <tel:+44 1653 487048> | +44 7771 787010 <tel:+44 7771 787010>
Email icon
***@***.*** ***@***.***>
Website link icon
https://black-sheep-research.com <https://black-sheep-research.com>
Address icon
4 York Road, Malton, YO17 6AX, UK
Debug and error reporting maximum were already enabled. But since the problem causes PHP to crash, diagnostics of that kind are not feasible. That made the problem difficult to track, since the only initial information was that there was a problem somewhere - probably in PHP code. PHP crashes may well be specific to a precise environnment. But Debian 12 is pretty mainstream. This link provides similar information to the link provided by @alikon but is not specific to Wordpress and indicates that a PHP error is the most common of the possible causes - https://bobcares.com/blog/apache-error-failed-to-read-fastcgi-header/
@counterpoint You are right. I just checked the code more and see that (string) $date and $date->toSql() result in same value. However, I would use $date->toSql() to make it consistent with other places in Joomla. For example https://github.com/joomla/joomla-cms/blob/4.4-dev/components/com_content/src/Model/ArticleModel.php#L184 and https://github.com/joomla/joomla-cms/blob/4.4-dev/components/com_content/src/Model/ArticleModel.php#L202 (Who knows if we use a DB driver using a date format different with Y-m-d H:i:s)
Do you want to make PR with the suggested change?
That makes sense @joomdonation, although (string) is a lot more efficient. What is PR?
@counterpoint In short, you make code change to to fix the issue. Please try to follow instructions here https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests to make the PR
The file you need to make change is https://github.com/joomla/joomla-cms/blob/4.4-dev/administrator/components/com_banners/src/Helper/BannersHelper.php (for 4.4-dev branch and later it will be up-merge to 5.1)
Thanks @joomdonation. Sorry, but I'm not familiar with making git pull requests and do not have time to find out. I've precisely identified the fault, that should be enough.
No worry @counterpoint . For the time being, you can make the propose change to your site to have the issue fixed. I will make the pull request on tomorrow to fix this issue so that it won't happen again when you update to future releases of Joomla
Thanks @joomdonation that's great.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-02-24 07:38:14 |
Closed_By | ⇒ | joomdonation |
I experience the same issue. When I publish a banner module or even access this page : administrator/index.php?option=com_banners&view=banners with Joomla installed on PHP 8.2.4, it crashes the website. Not only with Joomla 5, but I also experience the issue with Joomla 4.4.0.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42841.