Can't get archiving to work either by command line, cron, or web-cron

Hi. I can’t get archiving to work. No matter I try, I get an error message that says:

Error: Empty or invalid response ’ 403 Forbidden

Forbidden

You don’t have permission to access /piwik/ on this server.

’ for website id 1, Time elapsed: 0.148s, skipping

The same is true from the command line or by entering the web-cron url in my browser.

I have the --url switch set to the exact url that I use to view piwik.

When I add the - v switch to the command, I get and the following additional info:

Exception trace:
() at /my_path/piwik/core/CronArchive.php:410
Piwik\CronArchive->logFatalError() at /my_path/piwik/core/CronArchive.php:403
Piwik\CronArchive->end() at /my_path/piwik/core/CronArchive.php:262
Piwik\CronArchive->Piwik{closure}() at /my_path/piwik/core/Access.php:456
Piwik\Access::doAsSuperUser() at /my_path/piwik/core/CronArchive.php:263
Piwik\CronArchive->main() at /my_path/piwik/plugins/CoreConsole/Commands/CoreArchiver.php:27
Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute() at /my_path/piwik/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at /my_path/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /my_path/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at n/a:n/a
call_user_func() at /my_path/piwik/core/Console.php:79
Piwik\Console->Piwik{closure}() at /my_path/piwik/core/Access.php:456
Piwik\Access::doAsSuperUser() at /my_path/piwik/core/Console.php:80
Piwik\Console->doRun() at /my_path/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /my_path/piwik/console:27

There is nothing related to piwik in in my server’s error log. I’m running piwik version 2.14.1 and piwik’s system check shows no issues.

Any suggestions on how to solve this? Thank you!

Hi there,

it looks like we introduced a regression, at least this will be fixed in a few weeks/months: URL parameter for core:archive console command is ignored · Issue #8316 · matomo-org/piwik · GitHub

In the meantime, what is the 403 error you see in your server error log? is Piwik using the wrong URL to connect to itself?

Hi. Thanks for the reply. Here’s what I’m finding in my logs:

[23/Jul/2015:09:59:24 -0400] “GET /piwik/?module=API&method=API.get&idSite=1&period=day&date=last9&format=php&trigger=archivephp&token_auth=xxxxx HTTP/1.1” 403 208 “-” “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.125 Safari/537.36”

Just to be clear, I replaced my actual token with xxxxx.

Is there anything I could change in the code as a temporary fix until this gets resolved?