I already posted this on the Piwik Forum but was asked to post it on GitHub as well.
Due to a shared server I have to run Auto-Archiving via Webcron. I followed the instructions provided by Piwik to implement the Auto-Archiving via Webcron. But when I paste the URL (https://subdomain.domain.com/misc/cron/archive.php?token_auth=correct-token) into my browser, I get the following message:
Error: Die Methode 'runCronArchiving' existiert nicht oder ist im Modul '\Piwik\Plugins\CoreAdminHome\API' nicht verfügbar.
Which translates to: Error: The method 'runCronArchiving' does not exist or is not available in the module '\Piwik\Plugins\CoreAdminHome\API'.
Does anybody have a clue what I may be doing wrong?
I do have an old install of Piwik with Auto-Archiving enabled (also with Webcron) and this installation runs without any problem.
Thanks in advance for your help! It is very appreciated.
Most likely the auth token you are using is not the token of a super user.
If the token is from a valid super user, please consider to do a manual update and don't forget to backup
Hope this helps. Feel free to comment if not and we can reopen the issue
Thanks Thomas, but unfortunately this didn't help. The error is still:
Error: The method 'runCronArchiving' does not exist or is not available in the module '\Piwik\Plugins\CoreAdminHome\API'.
I tried to reproduce but works fine for me. Have you tried the token of a super user? Are you sure you are using a token of a user that has super user access? I get the same error message when using an invalid token or a token of a user that is not super user
I used the token of a super user. But for testing, I created another super user and used it's token: now it worked. BUT: I get a new error message:
START INFO CoreAdminHome[2016-03-07 11:30:58] Starting Piwik reports archiving... INFO CoreAdminHome[2016-03-07 11:30:58] - tracking data found for website id 1 (between 2016-03-06 23:00:00 and 2016-03-07 12:30:58) INFO CoreAdminHome[2016-03-07 11:30:58] Will pre-process for website id = 1, period = day, date = last3 INFO CoreAdminHome[2016-03-07 11:30:58] - pre-processing all visits ERROR CoreAdminHome[2016-03-07 11:30:58] Empty or invalid response 'Got invalid response from API request: https://subdomain.domain.org/?module=API&method=API.get&idSite=1&period=day&date=last3&format=php&trigger=archivephp&token_auth=removed. Response was 'curl_exec: SSL certificate problem: self signed certificate. Hostname requested was: subdomain.domain.org'' for website id 1, Time elapsed: 0.191s, skipping INFO CoreAdminHome[2016-03-07 11:30:58] Done archiving!
I don't know what I can do here ...
Can you try it via
http? I know it's not really a solution but maybe give it a try. It might be an option in case you are triggering the cron archiver from the same server and https is not as much needed.
It's almost like we need some kind of option to ignore SSL certificate errors for archiving only. I will reopen the issue and change the title.
I just noticed there is already a setting
accept-invalid-ssl-certificate for the
core:archive command. So all we need to do is to expose a
GET parameter to this script that sets
$archiver->acceptInvalidSSLCertificate=true here https://github.com/piwik/piwik/blob/2.16.0/plugins/CoreAdminHome/API.php#L124
I'm adding an easy-pick label.
Thanks Thomas, I returned for the next try to fix the problem. I just pasted the URL (see my opening post) with a super user token in my browser and hit return. And it just worked. I didn't update Piwik or anything. It simply worked ... I don't know why and it is strange, but I'm ok with it ;)
To set up the cronjob with my hosting company I have to use http because there is an error message regarding the certificate. But for now it's ok.
Thank you all for your patience and your work! I really appreciate it.
No worries, I'm glad it works :+1: