Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#1974 closed Bug (fixed)

Archiving doesn't work anymore on 1.1.x with the cron script

Reported by: Neurones67 Owned by:
Priority: critical Milestone: Piwik 1.2
Component: Core Keywords: archive cron
Cc: Sensitive: no

Description

Hello,

I'm using piwik with the option (in french) "Autoriser l'archivage de Piwik à se déclencher lorsque les rapports sont visionnés depuis le navigateur" set to "no", I'm using so a cron to execute the "archive.sh" every hours, but since my update to 1.1.1 this morning my piwik doesn't show any new data today.
So I tried to execute the script manually :

root@Apollo:~# su -c '/home/piwik/public_html/misc/cron/archive.sh' piwik
Starting Piwik reports archiving...

root@Apollo:~#

As you can see it doesn't do anything.
I setted back the option to "Yes" and the new data are shown, so I suppose that the script doesn't work anymore.

Ask if you want more details :)

Change History (8)

comment:1 Changed 3 years ago by vipsoft (robocoder)

  • Milestone changed from 1.x - Piwik 1.x to 1.2 Piwik 1.2

What do you get when you execute these from the shell?

php5 -v
php -v

comment:2 Changed 3 years ago by Neurones67

I got this : (Debian Squeeze)

root@Apollo:~# php -v
PHP 5.3.3-6 with Suhosin-Patch (cli) (built: Dec  7 2010 12:47:03) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

comment:3 Changed 3 years ago by matt (mattab)

Maybe related, see forum post: http://forum.piwik.org/read.php?2,70783

Error Message

Notice: Undefined index:  SCRIPT_NAME in /homepages/16/dxxx/htdocs/piwik/core/Url.php on line 123


Backtrace -->#0  Piwik_ErrorHandler(8, Undefined index:  SCRIPT_NAME, /homepages/16/dxxx/htdocs/piwik/core/Url.php, 123, Array (http:// => )) called at [/homepages/16/dxxx/htdocs/piwik/core/Url.php:123]#1  Piwik_Url::getCurrentScriptName() called at [/homepages/16/dxxx/htdocs/piwik/core/Url.php:45]#2  Piwik_Url::getCurrentUrlWithoutQueryString() called at [/homepages/16/dxxx/htdocs/piwik/core/UpdateCheck.php:41]#3  Piwik_UpdateCheck::check() called at [/homepages/16/dxxx/htdocs/piwik/plugins/CoreUpdater/CoreUpdater.php:75]#4  Piwik_CoreUpdater->updateCheck(Piwik_Event_Notification Object ([_notificationName] => FrontController.checkForUpdates,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0))#5  call_user_func_array(Array ([0] => Piwik_CoreUpdater Object (),[1] => updateCheck), Array ([0] => Piwik_Event_Notification Object ([_notificationName] => FrontController.checkForUpdates,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0))) called at [/homepages/16/dxxx/htdocs/piwik/libs/Event/Dispatcher.php:284]#6  Event_Dispatcher->postNotification(Piwik_Event_Notification Object ([_notificationName] => FrontController.checkForUpdates,[_notificationObject] => ,[_notificationInfo] => Array (),[_notificationState] => 0,[_notificationCount] => 0), 1, ) called at [/homepages/16/dxxx/htdocs/piwik/core/PluginsManager.php:531]#7  Piwik_PostEvent(FrontController.checkForUpdates) called at [/homepages/16/dxxx/htdocs/piwik/core/FrontController.php:251]#8  Piwik_FrontController->init() called at [/homepages/16/dxxx/htdocs/piwik/index.php:59]

comment:4 Changed 3 years ago by matt (mattab)

  • Priority changed from normal to critical

MANY users have this issue: http://forum.piwik.org/read.php?2,70638

comment:5 Changed 3 years ago by vipsoft (robocoder)

(In [3649]) refs #1974 - Notice: Undefined index: SCRIPT_NAME (occurs when using php-cgi)

comment:6 Changed 3 years ago by Neurones67

Fixed, sorry, It was a problem of permissions, with the -x option of sh, I saw the script said "Coudn't write on ....' I changed the permissions and now it works.

Sorry for the inconveniance.

comment:7 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [3652]) fixes #1974 - force the execute bit (if needed)

comment:8 Changed 3 years ago by Neurones67

No, the problem of permissions wasn't here, it was because some directories of my piwik installation weren't writable by the user with who I started the script.

It's because I had to change the user of my "/home/piwik/public_html" to www-data (user used by Apache on Debian) to do the update via the website because I didn't install suPHP or other tools to make the script be executed by its owner (piwik in my case). I forgot after that to restore the original permissions that made fail the archive script.

It would be useful that the archive.sh verify that it can write in the diretories it needs, the administrator would see immediatly where is the problem. :)

Note: See TracTickets for help on using tickets.