After Update "by hand" form 1.11 to 2.0.2 get errors



after Update from 1.11.x to 2.0.2 I get the following messages:
Notice: Undefined index: log_writers in /piwik/core/Log.php on line 271 Warning: array_map(): Argument
#2 should be an array in /piwik/core/Log.php on line 273 Warning: Invalid argument supplied for foreach() in /piwik/core/Log.php on line 274

and the following:
Warning: file(/piwik/.git/HEAD): failed to open stream: No such file or directory in /piwik/core/SettingsPiwik.php on line 304

I run the update in following steps

  • download piwik via wget and run unzip
  • backup config files
  • delete all old files in the vhost directory
  • copy all new piwik files in the vhost directory
  • request piwik application (https) and see this error messages
    server is apache on debian squeeze, php 5.3.3-7 with Suhosin

What is going wrong or what I have do wrong?

Thank you for help.

(chag) #2


Same here !

Did you fix it ?




not yet I have it on tomorrow’s agenda, to try to solve this problem.
If I find a solution I’ll inform you.
Run your php as a apache modul or as cgi?


(chag) #4

to fix the first part of the error message, replace :

        // set the log writers
        $logWriters = $logConfig[self::LOG_WRITERS_CONFIG_OPTION];


        // set the log writers
$logConfig['log_writers'] = array('screen');
        $logWriters = $logConfig[self::LOG_WRITERS_CONFIG_OPTION];

in file/core/Log.php

Keep in mind this is just a temporary fix

(chag) #5

ok, second fix :


public static function getCurrentGitBranch()
    $firstLineOfGitHead = file(PIWIK_INCLUDE_PATH . '/.git/HEAD');


public static function getCurrentGitBranch()
    return '';
    $firstLineOfGitHead = file(PIWIK_INCLUDE_PATH . '/.git/HEAD');

This is just a temporary fix too. The two bugs are not fixed but this modifications let you continue with the installation.

The first bug is a variable not defined and the sencond is a missing file (.git/HEAD)

my php is running as an apache module


(chag) #6

I opened following bugs :



Thank you for this information, I’ll try it and report.



I use both fix and the update run until the end, but after login I get a lot of errors :frowning: , so rollback (backup) to the old version.
As a trial I do a new installation with 2.0.2 in a other host and everthing runs good, so I think my server and virtual host adjustments are ok.

Before I do the update, I delete all files and folders from the old piwik application, except the config folder.
I take the new piwik version via wget, unzip the package and do a request with the browser, than a run the command php /path/to/piwik/index.php – “module=CoreUpdater”.
After login I get many errors in different widgets, if there a problem with the old config file?

Other questions:
Is it possible to do a “new installation” and overtake the old database?
Is it possible to migrate the old database in the new database?

I’ll repeate the update trials after the x-mas season.

I wish you all a nice x-mas.

(chag) #9


I had a lot of errors too. problems with plugins that were not supported. I tried to uninstall them but couldn’t. There is always 2 plugins that i can’t uninstall. When I try to uninstall one, it seems to succeed. Then I try to uninstall the other. It seems to succeed but the first one is back. I try to uninstall the first, the second comes back and so on endlessly.

Doing a total fresh & clean install would probably solve the problem but it means loosing all previous datas



conclusion: something going wrong if you update from a version < 2, there are a lot of post to this topic.
It may be that some adjustments in the old config file are not compatible with the new version?!?

(chag) #11

may be but I had no time to check the configuration files.

(Matthieu Aubry) #12

What exact errors are you getting?

The original error in this post can SIMPLY be fixed by uploading the file config/global.ini.php since you didnt upload properly. Other errors I don’t know since you didnt put them here