[Solved] Memory error with archiving

Hello guys

I have about 2000 visitors in one day.
Piwik worked correctly for one week.
But now, I get the following error, when my crontab tries to launch the update :

Error in the last Piwik archive.php run:
2 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://www.mywebsite.fr/analytics/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=month&date=last2&format=php&token_auth=1c99eca7c6be7c9d5388f09bb9eb2996&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of ‘memory_limit’ in your php.ini file.

So, i have increased the following parameters :

On /etc/php5/cli/php.ini
I have changed :


memory_limit = -1

to


memory_limit = 512

But now, i have this error :

PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 523800 bytes) in Unknown on line 0

In my piwik config file (global.ini.php), i have :


; Minimum adviced memory limit in php.ini file (see memory_limit value)
minimum_memory_limit = 128
; Minimum memory limit enforced when archived via misc/cron/archive.php
minimum_memory_limit_when_archiving = 512

What should i do please ?

Could you temporarily try to bump up memory to 1024? remember to restart apache once the changes are made. Im curious to see if this helps.

Hi
which parameter should i increase please?

memory_limit in the php.ini file
or
minimum_memory_limit_when_archiving = 512 in global.ini.php file

I restart apache2 in each update.
I have already tried minimum_memory_limit_when_archiving = 1024 but i still had the first error.

try both but in steps 1st then 2nd to see if that helps.

Still the same error :


PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 523800 bytes) in Unknown on line 0

On the memory limit

On /etc/php5/cli/php.ini

to
memory_limit = 512(or what ever you have now)

can you try to make the change define like below

memory_limit = 512M

Yes you right
512M is the correct syntax.
However, i still get the first error now :


Error in the last Piwik archive.php run:
2 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://www.mywebsite.fr/analytics/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=month&date=last2&format=php&token_auth=1c99eca7c6be7c9d5388f09bb9eb2996&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file.

I set at 1024M now.
I will check if everything is ok.

There is also a global.ini.php in the piwik folder if your other test fails try to see if upping that to 512 helps(assuming its lower than 512 now)

Same issue
So i have set

; Minimum adviced memory limit in php.ini file (see memory_limit value)
minimum_memory_limit = 128

to

; Minimum adviced memory limit in php.ini file (see memory_limit value)
minimum_memory_limit = 512

Wait and see

To change the memory limit in PHP edit your php.ini file and restart the server. Set to 512M

the error message says 262144 bytes: your PHP memory limit is 256Kb… too small indicating an error

Still the same error …

You wouldnt happen to have a .htaccess file in the same folder as the piwik php.ini? If so it might be what is limiting the error?

Is there any error logs being generated in your apache web logs? That could point out the issue?

Hi

I have solved the issue i think
I have increased the susohin.memory_limit to 512M

ok great to hear! Can you change the topic to solved? Is this site a wordpress site?

This is a prestashop website
thanks for your help !
You are great :wink: