Cronjob: You don't have permission to access

Hallo,

die Archivierung wird bei mir mittels Cronjob über die archive.php erledigt. Seit dem heutigen Update auf 2.14.0 funktioniert die Archivierung nicht mehr. Rufe ich die archive.php direkt über den Browser auf, erhalte ich folgende Fehlermeldung:


NFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] INIT INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] Running Piwik 2.14.0 as Super User INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] NOTES INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] - Reports for today will be processed at most every 900 seconds. You can change this value in Piwik UI > Settings > General Settings. INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] - Reports for the current week/month/year will be refreshed at most every 3600 seconds. INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] - Archiving was last executed without error 6 Stunden 21 Minuten ago INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] - Will process 1 websites with new visits since 6 Stunden 21 Minuten , IDs: 2 INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] START INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] Starting Piwik reports archiving... INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] Will pre-process for website id = 2, period = day, date = last52 INFO CoreAdminHome[2015-07-09 15:06:50] [02cd3] - pre-processing all visits ERROR CoreAdminHome[2015-07-09 15:06:51] [02cd3] Empty or invalid response '
Forbidden

You don't have permission to access /misc/cron/ on this server.
' for website id 2, Time elapsed: 0.121s, skipping INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Done archiving! INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] SUMMARY INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Total visits for today across archived websites: 0 INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Archived today's reports for 0 websites INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Archived week/month/year for 0 websites INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Skipped 1 websites: no new visit since the last script execution INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Skipped 0 websites day archiving: existing daily reports are less than 900 seconds old INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Skipped 0 websites week/month/year archiving: existing periods reports are less than 3600 seconds old INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Total API requests: 0 INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] done: 0/1 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 130 ms, 1 errors. INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Time elapsed: 0.131s INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] SCHEDULED TASKS INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Starting Scheduled tasks... INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] done INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] --------------------------- INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] SUMMARY OF ERRORS INFO CoreAdminHome[2015-07-09 15:06:51] [02cd3] Error: Empty or invalid response '
Forbidden

You don't have permission to access /misc/cron/ on this server.
' for website id 2, Time elapsed: 0.121s, skipping ERROR CoreAdminHome[2015-07-09 15:06:51] [02cd3] 1 total errors during this script execution, please investigate and try and fix these errors.

Am Server bzw. Webspace wurde nichts verändert. PHP läuft Version 5.6.10 (CGI). Die archive.php hat CHMOD 0644. Besitzer ist FTP-User.
Auth-Token habe ich auch überprüft. Memory_Limit ist mit 512 MB auch genug.

Hat jemand eine Idee? Bin für jede Hilfe dankbar! :slight_smile:

Das gleiche Problem habe ich auch seit dem Update auf 2.14.0. Gezählt wird alles toll, nur im Dashboard wird nichts mehr angezeigt.

Die Datei archive.php wird denke ich schon ausgeführt. Die .htaccess Datei im Ordner hat ja auch folgenden Inhalt:


# Allow direct web access to Web cron
<Files "archive.php">
	Order Allow,Deny
	Allow from all
</Files>

Danach scheint der Zugriff gesperrt zu sein :frowning:

/Edit:
Mein Fehlercode ist doch ein anderer:


INFO CoreAdminHome[2015-07-11 08:42:15] [15266] --------------------------- INFO CoreAdminHome[2015-07-11 08:42:15] [15266] INIT INFO CoreAdminHome[2015-07-11 08:42:15] [15266] Running Piwik 2.14.0 as Super User INFO CoreAdminHome[2015-07-11 08:42:15] [15266] --------------------------- INFO CoreAdminHome[2015-07-11 08:42:15] [15266] NOTES INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - Reports for today will be processed at most every 10 seconds. You can change this value in Piwik UI > Settings > General Settings. INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - Reports for the current week/month/year will be refreshed at most every 3600 seconds. INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - Archiving was last executed without error 2 Tage 1 Stunden ago INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - Will process 5 websites with new visits since 2 Tage 1 Stunden , IDs: 1, 8, 9, 10, 11 INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - Will process 1 other websites because some old data reports have been invalidated (eg. using the Log Import script) , IDs: 11 INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - Will process 2 other websites because the last time they were archived was on a different day (in the website's timezone) , IDs: 3, 7 INFO CoreAdminHome[2015-07-11 08:42:15] [15266] --------------------------- INFO CoreAdminHome[2015-07-11 08:42:15] [15266] START INFO CoreAdminHome[2015-07-11 08:42:15] [15266] Starting Piwik reports archiving... INFO CoreAdminHome[2015-07-11 08:42:15] [15266] Will pre-process for website id = 1, period = day, date = last52 INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - pre-processing all visits ERROR CoreAdminHome[2015-07-11 08:42:15] [15266] Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&trigger=archivephp. Response was '
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
piwik.domain.com
Sat Jul 11 10:42:15 2015
Apache
' ERROR CoreAdminHome[2015-07-11 08:42:15] [15266] Empty or invalid response '' for website id 1, Time elapsed: 0.150s, skipping INFO CoreAdminHome[2015-07-11 08:42:15] [15266] Will pre-process for website id = 8, period = day, date = last52 INFO CoreAdminHome[2015-07-11 08:42:15] [15266] - pre-processing all visits ERROR CoreAdminHome[2015-07-11 08:42:15] [15266] Got invalid response from API request: ?module=API&method=API.get&idSite=8&period=day&date=last52&format=php&trigger=archivephp. Response was '
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403

So wiederholt sich der Text mehrmals

/Edit:
Ich habe weiter geforscht. Der Zugriff auf http://piwik.domain.com/misc/cron/archive.php?token_auth=xxx geht nicht. Die Antwort vom Server:


Zugriff verweigert!

Der Zugriff auf das angeforderte Verzeichnis ist nicht möglich. Entweder ist kein Index-Dokument vorhanden oder das Verzeichnis ist zugriffsgeschützt.

Sofern Sie dies für eine Fehlfunktion des Servers halten, informieren Sie bitte den Webmaster hierüber.
Error 403
piwik.domain.com
Sat Jul 11 10:58:22 2015
Apache 

Liegt wahrscheinlich daran, dass es bei mir unter misc/cron keine index-Datei gibt. Sollte es die geben?
Denn auch mit


# Allow direct web access to Web cron
<Files *.*>
	Order Allow,Deny
	Allow from all
</Files>

habe ich keinen Zugriff.

Hab exakt das gleiche Problem. Gezählt wird es nur nicht mehr angezeigt. Der Cronjob versagt seinen Dienst. Hat da wer ne Lösung gefunden?

Ich habe kurzerhand auf die Standard-Einstellung zur Archivierung umgestellt, damit ich mit Piwik weiter arbeiten kann. Ist ja sonst kein Zustand! :frowning:

Das mit der htaccess hatte ich auch getestet, jedoch kein Erfolg. Auch hatte ich es mit der alten archive.php aus dem letzten Backup versucht, funktioniert aber auch nicht.

Ebenso habe ich den Ordnern und auch der Datei testweise CHMOD 777 gegeben, was in meinem Fall jedoch überflüssig ist, da PHP über CGI ausgeführt wird, so dass Dateien auch ohne CHMOD 777 ausgeführt werden können.

Über die Konsole habe ich mal das Shellscript ausgeführt. Das funktioniert auch nicht.

Ich fürchte wir müssen warten, bis es ein Update gibt…

Gleiches Problem bei mir. Der Cronjob kann “archive.php” aufrufen, diese spukt allerdings nur folgende Fehlermeldung für jede Website ID aus:


INFO CoreAdminHome[2015-07-13 08:06:36] [440f0] START
INFO CoreAdminHome[2015-07-13 08:06:36] [440f0] Starting Piwik reports archiving...
INFO CoreAdminHome[2015-07-13 08:06:36] [440f0] Will pre-process for website id = 1, period = day, date = last52
INFO CoreAdminHome[2015-07-13 08:06:36] [440f0] - pre-processing all visits
ERROR CoreAdminHome[2015-07-13 08:06:36] [440f0] Empty or invalid response '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access /misc/cron/ on this server.</p> </body></html>' for website id 1, Time elapsed: 0.125s, skipping

Habe auch genau dasselbe Problem und auch keine Lösung gefunden… Gibt es evtl. schon Neuigkeiten?

Ist ein bekanntes Problem und wird mit 2.14.1 gefixt. Siehe hier: https://github.com/piwik/piwik/issues/8312

Als temporäre Lösung, einfach die Codezeile aus diesem Commit an entsprechender Stelle in core/SettingsPiwik.php einfügen. Danach sollte das Cronjob-Skript wieder laufen.

den Fehler gabs schonmal nach einem Update. Damals musste ich auf ein Folgeupdate warten…

Hallo an alle,

habe nun die aktuelle Beta Version (2.14.1-b1) installiert und das Problem ist behoben.

Hier der Link zum Thread web-cron fails after Update to 2.14.

Danke für die Info mit dem Fix in der Beta! (tu)