@anonymous-matomo-user opened this Issue on January 7th 2011


I'm using piwik with the option (in french) "Autoriser l'archivage de Piwik se dclencher lorsque les rapports sont visionns 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<a class='mention' href='https://github.com/Apollo'>@Apollo</a>:~# su -c '/home/piwik/public_html/misc/cron/archive.sh' piwik
Starting Piwik reports archiving...

root<a class='mention' href='https://github.com/Apollo'>@Apollo</a>:~#

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 :)

Keywords: archive cron

@robocoder commented on January 7th 2011 Contributor

What do you get when you execute these from the shell?
```php5 -v
php -v

@anonymous-matomo-user commented on January 7th 2011

I got this : (Debian Squeeze)

root<a class='mention' href='https://github.com/Apollo'>@Apollo</a>:~# 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
@mattab commented on January 7th 2011 Member

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 --&gt;<a href='/0'>#0</a>  Piwik_ErrorHandler(8, Undefined index:  SCRIPT_NAME, /homepages/16/dxxx/htdocs/piwik/core/Url.php, 123, Array (http:// =&gt; )) called at [/homepages/16/dxxx/htdocs/piwik/core/Url.php:123]<a href='/1'>#1</a>  Piwik_Url::getCurrentScriptName() called at [/homepages/16/dxxx/htdocs/piwik/core/Url.php:45]<a href='/2'>#2</a>  Piwik_Url::getCurrentUrlWithoutQueryString() called at [/homepages/16/dxxx/htdocs/piwik/core/UpdateCheck.php:41]<a href='/3'>#3</a>  Piwik_UpdateCheck::check() called at [/homepages/16/dxxx/htdocs/piwik/plugins/CoreUpdater/CoreUpdater.php:75]<a href='/4'>#4</a>  Piwik_CoreUpdater-&gt;updateCheck(Piwik_Event_Notification Object ([_notificationName] =&gt; FrontController.checkForUpdates,[_notificationObject] =&gt; ,[_notificationInfo] =&gt; Array (),[_notificationState] =&gt; 0,[_notificationCount] =&gt; 0))<a href='/5'>#5</a>  call_user_func_array(Array ([0] =&gt; Piwik_CoreUpdater Object (),[1] =&gt; updateCheck), Array ([0] =&gt; Piwik_Event_Notification Object ([_notificationName] =&gt; FrontController.checkForUpdates,[_notificationObject] =&gt; ,[_notificationInfo] =&gt; Array (),[_notificationState] =&gt; 0,[_notificationCount] =&gt; 0))) called at [/homepages/16/dxxx/htdocs/piwik/libs/Event/Dispatcher.php:284]<a href='/6'>#6</a>  Event_Dispatcher-&gt;postNotification(Piwik_Event_Notification Object ([_notificationName] =&gt; FrontController.checkForUpdates,[_notificationObject] =&gt; ,[_notificationInfo] =&gt; Array (),[_notificationState] =&gt; 0,[_notificationCount] =&gt; 0), 1, ) called at [/homepages/16/dxxx/htdocs/piwik/core/PluginsManager.php:531]<a href='/7'>#7</a>  Piwik_PostEvent(FrontController.checkForUpdates) called at [/homepages/16/dxxx/htdocs/piwik/core/FrontController.php:251]<a href='/8'>#8</a>  Piwik_FrontController-&gt;init() called at [/homepages/16/dxxx/htdocs/piwik/index.php:59]
@mattab commented on January 7th 2011 Member

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

@robocoder commented on January 7th 2011 Contributor

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

@anonymous-matomo-user commented on January 7th 2011

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.

@robocoder commented on January 7th 2011 Contributor

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

@anonymous-matomo-user commented on January 7th 2011

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

This Issue was closed on January 7th 2011
Powered by GitHub Issue Mirror