Memory during archive

Hello,

Running Piwik on my own VPS, and have full access to whatever i need to change.

The issue:

ERROR: Got invalid response from API request: http://s1.netstat.no/index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=year&date=last52&format=php&token_auth=XXXXXX&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. Please check your Web server Error Log file for more details.

Full phpinfo;
http://s1.netstat.no/phpinfo.php

Just changed from 64M to 128M to 256M to 512M to now 1024M - this is not the issue I suppose?

Please help - i don’t get any statistics :frowning:

I don’t know what has happened - its startet for a few days ago. Updatet to last version today, but that didn’ help either.

Best regards,
John

I have even set up max_execution_time to 360 temporary - still the same error message.

Holy smoke…

Set the memory_limit to 2048… and it now archived OK.

This cant be right?

Checking again tomorrow at this time, so I can se if there is changes.

Check your web server error logs. Do you get any error there?

How many visits or Pages URLs do you track per day? how many websites?

40 websites, but only ca 1200 pageviews totally pr day.

Google has indexed 4,7 million pages, if thats what you ment by “Page Urls do you track” ?

And its the same error in error.log;

1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: http://s1.netstat.no/misc/cron/../../index.php?module=API&method=VisitsSummary.getVisits&idSite=1&period=year&date=last52&format=php&token_auth=XXX&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.

(anonymized the token_auth.)

What type of site are you tracking? wordpress, joomla etc? Can i ask which VPS provider?

This has worked fine for a year now.

I have now set up deleting all log files.

VPS-provider; host1.no in Norway - reliable people.

Sites is WP-based mostly. The biggest, with nearly 5 mill indexed pages (i guess its on 6-7 mill pages) is based on 200 WP.

Hope to find out more tomorrow (its late here in Norway). Reducing the memory_limit now to 512 and see what will happen on my nightly cron to archive the stats.

Cool… snakker du norsk eller?

Ok the reason I asked was different hosting environments could help clue into the problem.

When you say you changed the memory limit where did you change it? there are a couple spots.

Is this a cpanel type of VPS?

For the heck of it I recently encountered a post similar to your issue see the following:

http://forum.piwik.org/read.php?2,96122

Lykke til!

Yepp, norsk til beinet :wink:

I changed the values in /etc/php5/apache2/php.ini

I have now tried to set the values in misc/cron/archive.php AND index.php now;


<?php
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', 60);

And put the memory_limit to 512 in php.ini (and restarted Apache).

Reason for this, is to not let the extreme settings above count for all the other sites on this VPS.

Veldig bra!!! hyg a øve snakker lit…

Ok is the error exactly the same?

There isnt any .htaccess files in the piwik folder is there? What php version you running?

nopes, no .htaccess. i have linked to the phpinfo for the server in the first post :wink: PHP Version 5.3.2-1ubuntu4.14

yes - the error is the same.

On some ubuntu builds unless the php is configured a certain way the

/usr/local/lib/php.ini

gets referenced even though you have it(/etc/php5/apache2/php.ini ) could this be the case?

no, no other php.ini

look - this has recently became a problem, so … i don’t know…

Found this that may help check it out

Most likely your sushosin updated, which changed the default of suhosin.memory_limit from disabled to 0 (which won’t allow any updates to memory_limit).

On Debian, change /etc/php5/conf.d/suhosin.ini

;suhosin.memory_limit = 0

to

suhosin.memory_limit = 2G

Or whichever value you are comfortable with. You can find the changelog of Sushosin at Hardened-PHP Project - PHP Security - Changelog, which says:

Changed the way the memory_limit protection is implemented

Maybe since you have hit the gig limit the G vs M suffix might help? Be interesting if you tried 999M then 2G to see if those help

I can update det memory limit, så thats not the problem.

It works when setting memory_limit to 2048M, but thats a ridiculous size.

I got no suhosin.ini, and i have not updatet det VPS in a while.

Hmm well this is a tricky one...

found this

SUMMARY OF ERRORS
Error: Got invalid response from API request: h t t p : / /www.xxx.yy/piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=11&period=day&date=last2&format=php&token_auth=6862472f689dfbae97a714f8bf274219&trigger=archivephp. Response was 'curl_exec: Empty reply from server'
1 total errors during this script execution, please investigate and try and fix these errors
ERROR: 1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: h t t p : / /www.xxx.yy/piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=11&period=day&date=last2&format=php&token_auth=6862472f689dfbae97a714f8bf274219&trigger=archivephp. Response was 'curl_exec: Empty reply from server'
PHP Fatal error: 1 total errors during this script execution, please investigate and try and fix these errors. First error was: Got invalid response from API request: h t t p : / /www.xxx.yy/piwik/index.php?module=API&method=VisitsSummary.getVisits&idSite=11&period=day&date=last2&format=php&token_auth=6862472f689dfbae97a714f8bf274219&trigger=archivephp. Response was 'curl_exec: Empty reply from server' in /var/wwwc/piwik/misc/cron/archive.php on line 519

So then found this i know you dont use godaddy but reminded me of your error

Well... FINALLY got it to work... here's how:

Don't...
Rely on GD support or their help, forums or any other of their 'documentation'
Use their default PHP or PHP5 cron job strings ie: /web/cgi-bin/php or /web/cgi-bin/php5
Wrap the URL in quotes (take note below)
Bother wasting time trying to hack Piwik

Do...
Ensure you set archive.php to 755 permissions
Insert following into cron job 'browse' line:
/usr/bin/curl http(s)://www.mysite.com/path/to/piwik/misc/cron/archive.php?token_auth=[insert-token]
Replace [insert-token] with your token_auth key

Special thanks to - http://eckstein.id.au/1274/internet/tutorial-godaddy-wordpress-wpomatic-cron/

Thanks for your kindness trying to find a soloution.

Still no go.

It WORKS when i put up 2048MB in memory_limit but that is insane.

@Matt: I’m willing to pay to get this straightened out.

You re welcome

services@piwik.org

they I beleive can look at the request you have.

Lykk til og haper di fin ut av det for deg.