8

I keep receiving the following error:

Wed Mar 30 01:22:43.780576 2016] [fastcgi:error] [pid 12345:tid 1234567890] [client 123.459.78.123:12345] FastCGI: incomplete headers (0 bytes) received from server "/path/to/php5-fcgi", referer: http://example.com/some/file.php

Which only occurs when i visit a specific page (controllers). What confuses me even more, this error appears to be in random. Meaning that sometime i can access the page just fine, other times i keep getting that error.

The page i am talking about is the backoffice of Prestashop 1.5.4, specifically the order page (Backoffice > Orders > Order).

That page does send a query to MySQL (how ever it took less than a sec). Here's the full query (debugged):

SELECT SQL_CALC_FOUND_ROWS
a.`id_order`,`reference`,`total_paid_tax_incl`,`payment`,a.date_add as date_add, 
a.id_currency,
a.id_order AS id_pdf,
CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) AS `customer`,
osl.`name` AS `osname`,
os.`color`,
IF((SELECT COUNT(so.id_order) FROM `ps_orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new
FROM `ps_orders` a
LEFT JOIN `ps_customer` c ON (c.`id_customer` = a.`id_customer`)
LEFT JOIN `ps_order_state` os ON (os.`id_order_state` = a.`current_state`)
LEFT JOIN `ps_order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 1) 
WHERE 1 
ORDER BY a.id_order DESC LIMIT 0,50;

My biggest suspicious is that there is something wrong with the query, because when i ran that query using MySQL Workbench, the initial run took about 2 secs. When i ran the query again (immediately after the first one) it took ~0.059 (could be cache).

Can anyone help me with this?

I am using Ubuntu 14.04 PHP 5.5.9 Apache 2.4.7 (with PHP5-FPM)

** EDIT **

When i ran:

sudo tail -f /var/log/upstart/php5-fpm.log

This is what i get:

[04-Apr-2016 10:55:54] WARNING: [pool www] child 37686 exited on signal 11 (SIGSEGV - core dumped) after 111.726966 seconds from start
[04-Apr-2016 10:55:54] NOTICE: [pool www] child 38128 started
[04-Apr-2016 10:55:54] WARNING: [pool www] child 37774 exited on signal 11 (SIGSEGV - core dumped) after 81.831809 seconds from start
[04-Apr-2016 10:55:54] NOTICE: [pool www] child 38129 started
[04-Apr-2016 10:55:54] WARNING: [pool www] child 37798 exited on signal 11 (SIGSEGV - core dumped) after 76.299913 seconds from start
[04-Apr-2016 10:55:54] NOTICE: [pool www] child 38130 started
[04-Apr-2016 10:55:54] WARNING: [pool www] child 37768 exited on signal 11 (SIGSEGV - core dumped) after 83.162501 seconds from start
[04-Apr-2016 10:55:54] NOTICE: [pool www] child 38131 started
[04-Apr-2016 10:55:57] WARNING: [pool www] child 37859 exited on signal 11 (SIGSEGV - core dumped) after 65.427848 seconds from start
[04-Apr-2016 10:55:57] NOTICE: [pool www] child 38133 started

There is now new warning/notice/error that show up when i execute the problematic page.

** EDIT 2 ** I think i narrow down the problem after turning on slow_log on my fpm config. This is what i get:

script_filename = /path/to/some/script.php
[0x00007f55bb18afd8] query() /path/to/some/script/DbPDO.php:80
[0x00007f55bb18aef8] _query() /path/to/some/script/Db.php:305
[0x00007f55bb18ad88] query() /path/to/some/script/Db.php:482
[0x00007f55bb18ab68] executeS() /path/to/some/script/AdminController.php:2198
[0x00007f55bb18a9e8] getList() /path/to/some/script/AdminController.php:1531
[0x00007f55bb18a8d0] renderList() /path/to/some/script/AdminController.php:1440
[0x00007f55bb18a788] initContent() /path/to/some/script/Controller.php:167
[0x00007f55bb18a5d0] run() /path/to/some/script/Dispatcher.php:349
[0x00007f55bb18a480] dispatch() /path/to/some/script/index.php:50

More best guess would be because of this function :

[0x00007f55bb18ab68] executeS() /path/to/some/script/AdminController.php:2198

Where it basically send a query i mentioned earlier. Changing this would mean i have to change the core engine of Prestashop. I do not wish to do that, since it may have some dependencies to other functions/modules.

I wonder if there is a way where i can slightly increase the timeout on my php-fpm or Apache. I know such solution exist, i just don't know where to look/begin.

hakre
  • 193,403
  • 52
  • 435
  • 836
Jeremy
  • 2,516
  • 8
  • 46
  • 80
  • You should investigate where the error actually originates and why it happens, currently you need to take a look at the error log of php-fcgi. – Charlotte Dunois Mar 29 '16 at 18:41
  • 1
    It is unlikely that a slow query generates an invalid fastcgi response header. – Charlotte Dunois Mar 29 '16 at 18:42
  • I would guess that you get the error whenever your script takes a long time to run (e.g. if the query takes long). _Apache_ only waits a certain amount of time for a response of _php-fpm_, so most likely the timeout value you have chosen is lower then the time the script needs to run. – t.niese Apr 04 '16 at 04:39
  • @t.niese where or how can i modify this value ? – Jeremy Apr 04 '16 at 04:49
  • X-Ref: Another [Ubuntu 14.04 PHP 5.5.9 Mysql Database SIGSEGV](https://stackoverflow.com/q/24510633/367456) – hakre Aug 11 '23 at 09:58

0 Answers0