@flying-squirrel opened this Issue on February 25th 2016

Dear Developers,

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.

@tsteur commented on February 25th 2016 Owner

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 config/config.ini.php.

Hope this helps. Feel free to comment if not and we can reopen the issue

@flying-squirrel commented on March 4th 2016

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'.

@tsteur commented on March 6th 2016 Owner

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

@flying-squirrel commented on March 7th 2016

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:

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 ...

@tsteur commented on March 7th 2016 Owner

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.

@tsteur commented on March 9th 2016 Owner

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.

@flying-squirrel commented on April 7th 2016

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.

@tsteur commented on April 7th 2016 Owner

No worries, I'm glad it works :+1:

Powered by GitHub Issue Mirror