Apache 2.2 502 bad gateway + segfault



on a fresh and default install of the latest version (2.2.2) with apache (2.2.22) on centos 5.10 im having random but frequent 502 bad gateway errros on almost every page with apache segfaults:

[Fri May 09 13:13:49 2014] [notice] child pid 21411 exit signal Segmentation fault (11)
[Fri May 09 13:13:49 2014] [notice] child pid 22306 exit signal Segmentation fault (11)
[Fri May 09 13:13:49 2014] [notice] child pid 22578 exit signal Segmentation fault (11)


[Fri May 09 13:13:48 2014] [notice] child pid 22531 exit signal Segmentation fault (11)
[Fri May 09 13:13:48 2014] [notice] child pid 22580 exit signal Segmentation fault (11)
[Fri May 09 13:13:48 2014] [notice] child pid 23515 exit signal Segmentation fault (11)

in firebug i see:

every 502 is with the following post:
token_auth fc2eea9f0a1e7917d516bc37c7ed6109


502 Bad Gateway

The server returned an invalid or incomplete response.

debug information:

There is an error. Please report the message (Piwik 2.2.2) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).

Strict Notice: Non-static method Piwik\Plugin::install() should not be called statically, assuming $this from incompatible context in /home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/DataTable.php on line 315

Backtrace -->

#0 Piwik\Error::errorHandler(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/DataTable.php:315]
#1 Piwik\DataTable->__construct(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive/DataTableFactory.php:205]
#2 Piwik\Archive\DataTableFactory->makeDataTableFromSingleBlob(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive/DataTableFactory.php:181]
#3 Piwik\Archive\DataTableFactory->makeFromBlobRow(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive/DataTableFactory.php:286]
#4 Piwik\Archive\DataTableFactory->createDataTable(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive/DataTableFactory.php:151]
#5 Piwik\Archive\DataTableFactory->make(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive/DataCollection.php:211]
#6 Piwik\Archive\DataCollection->getDataTable(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive.php:371]
#7 Piwik\Archive->getDataTable(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Archive.php:461]
#8 Piwik\Archive::getDataTableFromArchive(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/plugins/Referrers/API.php:45]
#9 Piwik\Plugins\Referrers\API->getDataTable(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/plugins/Referrers/API.php:138]
#10 Piwik\Plugins\Referrers\API->getKeywords(…) called at [:]
#11 call_user_func_array(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/API/Proxy.php:209]
#12 Piwik\API\Proxy->call(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/API/Request.php:215]
#13 Piwik\API\Request->process(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/ViewDataTable/Request.php:48]
#14 Piwik\ViewDataTable\Request->loadDataTableFromAPI(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Plugin/ViewDataTable.php:288]
#15 Piwik\Plugin\ViewDataTable->loadDataTableFromAPI(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Plugin/Visualization.php:166]
#16 Piwik\Plugin\Visualization->buildView(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Plugin/ViewDataTable.php:375]
#17 Piwik\Plugin\ViewDataTable->render(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/Plugin/Controller.php:281]
#18 Piwik\Plugin\Controller->renderReport(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/plugins/Referrers/Controller.php:156]
#19 Piwik\Plugins\Referrers\Controller->getKeywords(…) called at [:]
#20 call_user_func_array(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/FrontController.php:500]
#21 Piwik\FrontController->doDispatch(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/FrontController.php:85]
#22 Piwik\FrontController->dispatch(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/core/dispatch.php:34]
#23 require_once(…) called at [/home/web/barna.virtual.hasznaltauto.hu/piwik_tibyke/index.php:47]

system check is fine though: "Huzzah! There are no problems with your Piwik setup. Give yourself a pat on the back. "

any idea please?

best regards,


what php version are you running? What are your php.ini settings?


php is 5.4.23
php settings are the recommended production settings, nothing special.

i really have no idea, this debug message is pretty weird ::o


I would try and upgrade php to 5.4.28 or higher


i managed to solve the problem with one of the following:

  • php upped to 5.4.28
  • apc disabled for that directory with LocationMatch

the funny thing is that I had two instances of piwik installed (for testing) on the same box, and after upping php one of the instances stop giving 502 and worked fined, yet the other instance (the one which was installed last week - presumably 2.2.1, and was upped to 2.2.2 today) started working just fine.

then i did some deeper and more specific googleing and it gave out apc, so i tried disabling apc and now both instances are fine and working 100%.

thanks for your help and ideas, lesjokolat !


Hi, new to PIWIK and my 1st install has failed. On first run of the installer it returned all tick marks for System Check, so good to go. On step 2 Database Setup I entered a bad value for database server and ended up with: 502 Bad Gateway, The server returned an invalid or incomplete response.

That’s all I can get now, 502 Bad Gateway, even after deleting everything and starting over. The installer can take 3 or 4 tries before it will load the Welcome screen, but the System Check only 502s.

Latest PIWIK version (2.11.1) with PHP (5.3.29). Maybe I have to pressure my service provider to upgrade the PHP?

I’ve looked in FAQS and forum but don’t see this exact problem, seems like something is too slow. Tagged onto this topic as it’s the closest match. All help appreciated.

(Matthieu Aubry) #7

Hi there,

do you see a better error messages in the server error log?