@Victorsueca opened this Issue on June 4th 2017

Recently updated to Piwik 3.0.4 on Windows. I have a programmed task to execute the following at regular intervals:
C:\xampp\php\php.exe "C:\xampp\htdocs\stats\console" core:archive --url=https://myurl.com/piwik/
This has been working until now, but it recently started giving the following error:

Error: Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"
error";s:7:"message";s:86:"You can't access this resource as it requires an 'view' access for the website id = 1.";}'
INFO [2017-06-04 14:53:17] Error: Empty or invalid response '' for website id 1, Time elapsed: 1.045s, skipping
ERROR [2017-06-04 14:53:17] 2 total errors during this script execution, please investigate and try and fix these errors.

Other than updating piwik, the only change I made recently was removing some files that the piwik system check said where unnecesary and should be removed to prevent errors.

Any clues on what's going on?

@mattab commented on June 21st 2017 Owner

Hi @Victorsueca
We haven't seen this problem before. Could you send us some SSH access to your Piwik + the link to this issue at http://piwik.org/contact/ ?

@Victorsueca commented on June 23rd 2017

@mattab SSH to a production server with a person I do not know sounds a bit of an overkill. I propose hanging on some IRC (or other chat of your preference) to follow your instructions on debugging this.

@mattab commented on June 23rd 2017 Owner

would it maybe help if you just temporary access to only piwik to me at matt at piwik.org ?

@Victorsueca commented on June 25th 2017

Sounds more reasonable, is FTP ok instead of SSH?

@mattab commented on June 25th 2017 Owner

unfortunately ssh is needed as we need to run the command and see what happens
(FTP is less secure than SSH unless you use SFTP)

@Victorsueca commented on June 26th 2017

The thing is I have never used SSH before since I access all my servers physically, that's why I wanted to avoid using it, because i'd like to not use a feature that allows remote access to my server before fully understanding it. So at the moment it's easier for me to follow a set of instructions and provide the output as necessary.

@zypri commented on July 5th 2017

Hey. I am experiencing the same error, when I try to start archiveing with Web Cron (there is no Cron Jobs/SSH available at my shared hosting). As far as I know I did not do any updates. It was a fresh installation of Piwik 3.0.4, that run for a few weeks before i tried to activate Web Cron.

Has anyone an idea?

INFO CoreAdminHome[2017-07-05 12:50:36] [592f1] SUMMARY OF ERRORS INFO CoreAdminHome[2017-07-05 12:50:36] [592f1] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:86:"You can't access this resource as it requires an 'view' access for the website id = 1.";}' INFO CoreAdminHome[2017-07-05 12:50:36] [592f1] Error: Empty or invalid response '' for website id 1, Time elapsed: 0.858s, skipping ERROR CoreAdminHome[2017-07-05 12:50:36] [592f1] 2 total errors during this script execution, please investigate and try and fix these errors. Error: 2 total errors during this script execution, please investigate and try and fix these errors.

@matfax commented on October 31st 2017

Having the same issue:

  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] ---------------------------
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] INIT
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] Running Piwik 3.2.0 as Super User
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] ---------------------------
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] NOTES
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] - Reports for today will be processed at most every 150 seconds. You can change this value in Piwik UI > Settings > General Settings.
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] - Reports for the current week/month/year will be requested at most every 3600 seconds.
  • [10/31/2017 00:01:05 > 74b74f: INFO] INFO [2017-10-31 00:01:05] - Archiving was last executed without error 16 days 6 hours ago
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] - Will process 1 other websites because the last time they were archived was on a different day (in the website's timezone) , IDs: 1
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] ---------------------------
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] START
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] Starting Piwik reports archiving...
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] Day has finished for website id 1 since last run
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] Will pre-process for website id = 1, period = day, date = last18
  • [10/31/2017 00:01:06 > 74b74f: INFO] INFO [2017-10-31 00:01:06] - pre-processing all visits
  • [10/31/2017 00:01:07 > 74b74f: ERR ] ERROR [2017-10-31 00:01:07] Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last18&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:83:"You can't access this resource as it requires 'view' access for the website id = 1.";}'
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Done archiving!
  • [10/31/2017 00:01:07 > 74b74f: ERR ] ERROR [2017-10-31 00:01:07] Empty or invalid response '' for website id 1, Time elapsed: 1.490s, skipping
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] ---------------------------
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] SUMMARY
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Total visits for today across archived websites: 0
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Archived today's reports for 0 websites
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Archived week/month/year for 0 websites
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Skipped 1 websites
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] - 0 skipped because no new visit since the last script execution
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] - 0 skipped because existing daily reports are less than 150 seconds old
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] - 0 skipped because existing week/month/year periods reports are less than 3600 seconds old
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] - 1 skipped because got an error while querying reporting API
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Total API requests: 0
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] done: 0/1 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 1492 ms, 2 errors.
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] Time elapsed: 1.492s
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] ---------------------------
  • [10/31/2017 00:01:07 > 74b74f: INFO] INFO [2017-10-31 00:01:07] SCHEDULED TASKS
  • [10/31/2017 00:01:08 > 74b74f: INFO] INFO [2017-10-31 00:01:08] Starting Scheduled tasks...
  • [10/31/2017 00:01:08 > 74b74f: INFO] INFO [2017-10-31 00:01:08] Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.purgeOutdatedArchives...
  • [10/31/2017 00:01:08 > 74b74f: INFO] INFO [2017-10-31 00:01:08] Purging archives in 8 archive tables.
  • [10/31/2017 00:01:09 > 74b74f: INFO] INFO [2017-10-31 00:01:09] Deleted 9 rows in archive tables (numeric + blob) for 2017-10-15.
  • [10/31/2017 00:01:09 > 74b74f: INFO] INFO [2017-10-31 00:01:09] Scheduler: finished. Time elapsed: 1.290s
  • [10/31/2017 00:01:10 > 74b74f: INFO] INFO [2017-10-31 00:01:10] Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTask...
  • [10/31/2017 00:01:10 > 74b74f: INFO] INFO [2017-10-31 00:01:10] Scheduler: finished. Time elapsed: 0.000s
  • [10/31/2017 00:01:10 > 74b74f: INFO] INFO [2017-10-31 00:01:10] Scheduler: executing task Piwik\Plugins\UsersManager\Tasks.setUserDefaultReportPreference...
  • [10/31/2017 00:01:10 > 74b74f: INFO] INFO [2017-10-31 00:01:10] Scheduler: finished. Time elapsed: 0.152s
  • [10/31/2017 00:01:10 > 74b74f: INFO] INFO [2017-10-31 00:01:10] Scheduler: executing task Piwik\Plugins\CustomPiwikJs\Tasks.updateTracker...
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:10] Scheduler: finished. Time elapsed: 0.231s
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.purgeInvalidatedArchives...
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: finished. Time elapsed: 0.016s
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.deleteReportData...
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: finished. Time elapsed: 0.071s
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.deleteLogData...
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: finished. Time elapsed: 0.061s
  • [10/31/2017 00:01:11 > 74b74f: INFO] INFO [2017-10-31 00:01:11] Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.optimizeArchiveTable...
  • [10/31/2017 00:01:19 > 74b74f: INFO] INFO [2017-10-31 00:01:19] Scheduler: finished. Time elapsed: 7.990s
  • [10/31/2017 00:01:19 > 74b74f: INFO] INFO [2017-10-31 00:01:19] Scheduler: executing task Piwik\Plugins\CoreUpdater\Tasks.sendNotificationIfUpdateAvailable...
  • [10/31/2017 00:01:19 > 74b74f: INFO] INFO [2017-10-31 00:01:19] Scheduler: finished. Time elapsed: 0.030s
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] Scheduler: executing task Piwik\Plugins\Marketplace\Tasks.clearAllCacheEntries...
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] Scheduler: finished. Time elapsed: 0.003s
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] Scheduler: executing task Piwik\Plugins\Marketplace\Tasks.sendNotificationIfUpdatesAvailable...
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] Scheduler: finished. Time elapsed: 0.496s
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] done
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] ---------------------------
  • [10/31/2017 00:01:20 > 74b74f: ERR ] ERROR [2017-10-31 00:01:20] 2 total errors during this script execution, please investigate and try and fix these errors.
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] ---------------------------
  • [10/31/2017 00:01:20 > 74b74f: INFO] INFO [2017-10-31 00:01:20] SUMMARY OF ERRORS
  • [10/31/2017 00:01:21 > 74b74f: INFO] INFO [2017-10-31 00:01:20] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last18&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:83:"You can't access this resource as it requires 'view' access for the website id = 1.";}'
  • [10/31/2017 00:01:21 > 74b74f: INFO] INFO [2017-10-31 00:01:20] Error: Empty or invalid response '' for website id 1, Time elapsed: 1.490s, skipping
Powered by GitHub Issue Mirror