Archive.php: Got invalid response from API request (The response was empty)

Found this cron reference to running cron in an older hosting format than expeected. Maybe check your hosting does not run cron in an older format?

hightechguy [ # ] [ PM ]
new May 05, 2014 11:58PM Registered: 3 years ago
Posts: 12
Bingo!

As it figured out, it was PHP version issue with the hosting, cron run with old PHP 5.2 and as a result archiving was not done properly.
Now runs just fine and I can get monthly reports during 15-20sec.

@lesjokolat, I run my own servers and i’m sure the cron is using php 5.3.28. I can update but that may have impact on everything else on that server. There was no problem with cron with piwik before the update so I don’t think we need look for problems with php.

I just updated to 2.2.2, no luck with the cron job

@matt, I sorry but I can’t give you SSH to this machine

This server wouldnt happen to use suhosin memory would it?

If so try upping susohin.memory_limit to 512M

Adding date.timezone = “Europe/Rome” to php.ini has worked for me. Anyway, if you executed cron command line by root and then by user you need also to remove temp folder tmp/climulti.
I hope this help someone.

Adding date.timezone = “Europe/Rome” to php.ini has worked for me.

If you use 2.2.2 this should not be required as we should have fixed in that version the original root cause of the bug

Anyway, if you executed cron command line by root and then by user you need also to remove temp folder tmp/climulti.

Running Piwik 2.2.3-b1 as Super User …
ERROR CoreConsole[2014-05-13 08:06:00] [a7988] The Piwik URL
… does not seem to be pointing to a Piwik server.
Response was ‘’.

Still no luck, considering to switch back to analytics.

I was just thinking; can I downgrade the files needed for the cron (archive.sh console etc etc) from an earlier version in which it still worked?

@buggah please create a new ticket in our issue tracker: http://dev.piwik.org/

Also could you PM me the SSH access to your piwik? we would need access to your server to reproduce and find solution. thanks!

Please fix it in the next update.

hey,

thanks for sharing answer

If you run archive.sh with a lot of empty sites, it takes 200ms per request on average.

Why should this make a difference? As said, the bug does not occur when run from command line. It only occurs when executed via cron.

I am using 2.2.2 and I have also deleted /usr/local/www/piwik/tmp/climulti directory. However, the error is still present. The http error log is empty, so I see know way of debugging it. (And sorry, as said earlies, I am really not allowed to give ssh access)

I think would be good to create a new forum thread for your problem as this one is getting too long…

so try to use latest beta: I would like to test early beta and RC releases, how do I enable automatic updates to use these development versions? - Analytics Platform - Matomo
and if you still have issue create new forum thread, with information, or create ticket on our issue tracker

Today I updated to 2.2.3-b6.
Cronjob still not running BUT webcron wasn’t working in de previous versions with the same error as cronjob and is now working in 2.2.3-b6

webcron 2.2.2

INFO [2014-05-20 13:35:26] [7060f] ---------------------------
INFO [2014-05-20 13:35:26] [7060f] INIT
INFO [2014-05-20 13:35:26] [7060f] Piwik is installed at: http://…com/tellert/index.php
INFO [2014-05-20 13:35:26] [7060f] Running Piwik 2.2.2 as Super User
ERROR [2014-05-20 13:35:27] [7060f] Got invalid response from API request: http://…com/tellert/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&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.
ERROR [2014-05-20 13:35:27] [7060f] The Piwik URL http://…com/tellert/index.php does not seem to be pointing to a Piwik server. Response was ‘’.

Now I can run webcrons:

INFO [2014-05-20 13:40:23] [7a39d] ---------------------------
INFO [2014-05-20 13:40:23] [7a39d] INIT
INFO [2014-05-20 13:40:23] [7a39d] Piwik is installed at: http://…coml/tellert/index.php
INFO [2014-05-20 13:40:23] [7a39d] Running Piwik 2.2.3-b6 as Super User
INFO [2014-05-20 13:40:23] [7a39d] ---------------------------
INFO [2014-05-20 13:40:23] [7a39d] NOTES
INFO [2014-05-20 13:40:23] [7a39d] - Reports for today will be processed at most every 600 seconds. You can change this value in Piwik UI > Settings > General Settings.
INFO [2014-05-20 13:40:23] [7a39d] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
INFO [2014-05-20 13:40:23] [7a39d] - Archiving was last executed without error 52 min 21s ago
INFO [2014-05-20 13:40:24] [7a39d] - Will process 39 websites with new visits since 52 min 21s , IDs: 1, 2, 5, 6, 7, 11, 14, 16, 20, 26, 29, 32, 36, 37, 40, 49, 55, 58, 65, 66, 70, 77, 78, 79, 82, 84, 99, 104, 106, 110, 115, 119, 123, 134, 145, 165, 172, 181, 191
INFO [2014-05-20 13:40:24] [7a39d] ---------------------------
INFO [2014-05-20 13:40:24] [7a39d] START
INFO [2014-05-20 13:40:24] [7a39d] Starting Piwik reports archiving…

@buggah do you think you could send us SSH or FTP access to your server ? we would like to understand why the normal cron is not working for you and for this it would really help to reproduce on your server

hi, i have the sampe problem.
Freebsd 10

piwik archiver works if called via commandline.

Same command via cron fails with:
ERROR CoreConsole[2014-07-11 10:24:00] [16c27] Got invalid response from API request: http://XXXmysiteXXX/analytics/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&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.

i can give you root access to the server if necessary to solve.
Just let me know how.

regards,

Hi @cisi, do you have logging enabled on your Piwik instance? If you don’t, can you enable logging by adding the following to your config.ini.php:


[log]
log_writers[] = file
log_level = DEBUG

? Then when the archiver runs via cron, can you send me the log contents via private message? After the cron run is done, you can disable logging.

Also, after the cron run can you look at your webserver error logs and see if there’s anything related to Piwik in there?

ok, pm sent.

regards,

for all that are experiencing a similar problem on freebsd, there are now two workarounds until 2.5 comes out:

This problem is fixed in git (see issue: Piwik’s asynchronous command line execution module does not properly detect currently running processes on some systems · Issue #5842 · matomo-org/matomo · GitHub) and will be in 2.5.0. @cisi’s post above describes how you can fix it yourself.

Here are two related issues created to help deal w/ problems like this:

Both should be in 2.5.0.