Archive cron failing, all stats showing zero on dashboard

I noticed recently that my website dashboard shows zero visits on all sites (we have nearly 100 sites we are tracking), this seems to have happened after upgrading.

The piwik-archive.log shows the following error

Parse error: syntax error, unexpected T_STRING in /home/path/to/piwik//misc/cron/archive.php on line 12

Line 12 in the archive.php is

namespace Piwik;

What do I need to do ?

Upgrade to more recent PHP version ?

I encounter the same error message, even when I reload files.
I’m running the update script with PHP5.4

With PHP5.5.7 I now have this error (if someone could help me) :
ERROR: The Piwik URL http://website/piwik/misc/cron/../../index.php does not seem to be pointing to a Piwik server. Response was ‘sh: /usr/local/php5.5.7/sbin/php-fpm: Permission denied’.
Thanks in advance

I am already running the latest stable version that my host allows. Any other suggestions?

My original problem shown below is still occurring, I have PHP 5.4 running.

I noticed recently that my website dashboard shows zero visits on all sites (we have nearly 100 sites we are tracking), this seems to have happened after upgrading.

The piwik-archive.log shows the following error

Parse error: syntax error, unexpected T_STRING in /home/path/to/piwik//misc/cron/archive.php on line 12

Line 12 in the archive.php is

namespace Piwik;

What do I need to do ?

Hey guys, we fixed a bug in the code, and released 2.1.1-b10
http://piwik.org/faq/how-to-update/faq_159/
can you please try this beta version and see if it works better?

Hi

I have updated to the Beta version as directed. I now get the following error and there are still ZERO visits showing in all reports etc

Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in /home/path/to/piwik/misc/cron/archive.php on line 44
Parse error: syntax error, unexpected T_STRING in /home/path/to/piwik//misc/cron/archive.php on line 44

Your urgent assistance with this would be appreciated.

Hi

I have done some digging (and a little bit of trial and error) and found that changing the cron to the following makes the script work fine

/usr/local/php54/bin/php /home/path/to/piwik/console core:archive – url=http://url/of/piwik

By forcing the script to run on my host as php5.4 and not ‘assuming’ it’s already running it, it appears to work, the standard /usr/local/php calls php5.2 is seems and THAT is why the script was failing (even after you fixed the bugs in the code)

To confirm PHP5.4 works a dream with V2.1.1.1-b10 beta release

The archives are now working, meaning (when they finish) they will show the stats in the dashboard

(it’s been 82 days since the archive ran properly, so I guess it may take a while !!!)

Thanks for finally fixing this !

:slight_smile:

Sorry

Further to my last changing the cron job to run as

/usr/local/php54/bin/php /home/path/to/piwik/console core:archive --url=“http://url/of/piwik

Does not archive all my sites, I am finding it is skipping sites and showing zero visits on the dashboard, looking at the all websites view it looks like 50% of the sites I have running Piwik tracking code do not get any visits at all.

I played around with this last night and found that the only way I can get this to work fully is to run the cron as

/usr/local/php54/bin/php /home/path/to/piwik/console core:archive --force-all-websites --url=“http://url/of/piwik

utilising the force all command. This seems to work but obviously takes a little longer.

Is it ok to leave the cron set to run force all websites all of the time, so it runs like this every hour?

I am running version 2.2.0-b15

Thanks in advance

It’s Ok to leave it all the time.

Hi,

I’m facing to that 2 errors when I’m trying to update Piwik with archive.php.
My problem is that my website is on a shared hosting and I can’t manage cron as I would like.

INFO ERROR: Got invalid response from API request: http://your-server.org/path/to/piwik/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. Response was ‘
Warning: Unexpected character in input: ‘’ (ASCII=92) state=1 in http://your-server.org/path/to/piwik/console on line 20

Parse error: syntax error, unexpected T_STRING in http://your-server.org/path/to/piwik/console on line 20

INFO Piwik\CronArchiveFatalException ERROR: The Piwik URL http://your-server.org/path/to/piwik/index.php does not seem to be pointing to a Piwik server. Response was ‘’.

Hope someone can help me, I encounter this problem since 2.1.0 update of Piwik, the same with 2.2.0.

Thanks in advance.

Your PHP CLI is not using at least PHP 5.3 but is a older PHP