After upgrade to 0.5.2 evrything wrong

Posted by Guido 

Advanced
Guido [ # ]
December 15, 2009 09:33AM
Hi,
i've made an upgrade from 0.5.1 to 0.5.2 in the morning. Now i get on every page and every widget the same error message:

Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /path/to/piwik/plugins/Actions/Actions.php on line 380

Guido
t4b [ # ]
December 15, 2009 10:06AM
same problem here, but since the 5.1 update. 5.2 update did not fix this error.
t4b [ # ]
December 15, 2009 10:19AM
I tried: sh /path/to/piwik/misc/cron/archive.sh

Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /var/www/html/plugins/Actions/Actions.php on line 362

So the problem is not browser related.
December 15, 2009 11:05AM
I ues automatic method to update from 0.5.0 to 0.5.2 and everything is ok.



blog.rubypdf.com/2009/12/15/how-to-fix-pclzip_err_bad_format-issue-when-automatically-update-piwik/
Guido [ # ]
December 15, 2009 12:20PM
Hi,
I've also used the internal upgrade function. After the problem occurs, I've tried a completely new installation (all files in the piwik directory deleted, new files copied). Same problem.

Guido
IchBins [ # ]
December 15, 2009 01:08PM
Hi,

I afraid I don't have any kind of solution for this problem (Cannot use object of type Piwik_DataTable_Row as array in .... Actions.php), but I have some more (unanalysed) details:

- I'm faceing the same problem since a manual upgrade from 0.4.5 to 0.5 (and still face it since I've upgraded to 0.5.3 today):
after coping the new piwikfiles to a clean directory on my webserver I tried to start the upgrade procedure via browser. But this did not work, the script seemed do do nothing. So I've updated my tables manual to (took the sql from core/Updates/....)

- the problem is not browserspecific, since it can be observed within the archivescript, too:
archive.sh
PHP Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /..../id/piwik/plugins/Actions/Actions.php on line 380

Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /..../piwik/plugins/Actions/Actions.php on line 380

- since the archivescript dosen't work I could run the archive-cronjobs and my DB-tables growed massively over the last days. I had to remove the piwik-pixel from our pages. :-(

- Interesting observation: If I choose a date before the upgrade, that's look at old data, all widgets work great. Only new data is affected by this bug.

Any ideas?

bye

IchBins
IchBins [ # ]
December 15, 2009 01:36PM
Hmmm, after disableing and reenableing the action-plugin the errormessages are gone. But now I have no data in "actions/pages" and/or "actions/page title".

the archve-script runs extremely fast and produces a notice followed by an backtrace:

Notice: Array to string conversion in /..../piwik/core/Log.php on line 169

Backtrace -->#0 [...]

Not that nice....:-(

bye

IchBins
vipsoft [ # ]
December 15, 2009 09:14PM
IchBins: The second issue is now fixed in svn. http://dev.piwik.org/trac/changeset/1716

What version of PHP are you running?

I've created a ticket for this: http://dev.piwik.org/trac/ticket/1082



Buy me a beer. Show me some love.

Changes in the upcoming release: CHANGES
vipsoft [ # ]
December 16, 2009 12:53AM
Assuming you have the default settings (browser-triggered archiving), disabling the Actions plugin would have resulted in archives generated without calling the hooks in the Actions plugin. That's why you have no data.

Assuming you aren't pruning your log_visit table, to regenerate the archives, you have to activate the Actions plugin, and manually drop the archive_blob and archive_numeric tables (or delete specific rows) for the desired period.

This seems to be data-specific. Would you mind changing line 380 of plugins/Actions/Actions.php, from:
    $currentTable =& $currentTable[$actionName];

to:
    if(is_array($currentTable)) {
        $currentTable =& $currentTable[$actionName];
    }
    else
    {
        var_dump($this->actionsTablesByType[$row['type']]);
        var_dump($currentTable);
        var_dump($actionExplodedNames);
        var_dump($row['type']);
        die;
    }
and report back to us the debug output? Thanks.

(t4b: let me know if you need help making a similar change around line 362)



Buy me a beer. Show me some love.

Changes in the upcoming release: CHANGES
IchBins [ # ]
December 16, 2009 09:44AM
Hi vipsoft,

first of all, thanks for the fast fix regarding the second problem. I've applied it to my archive.sh and...there is the first problem again, fine. :-)

I'm using php 5.2.9. And yes, it seems that I've lost my enable_browser_archiving_triggering = false during the updateprocess, so the default configuration is active currently.

And last, but not least the debug output from the modified Action.php (same on dashboard and from archive.sh):

NULL NULL array(1) { [0]=> string(20) "page url not defined" } NULL

Thanks!

bye

markus


Guido [ # ]
December 16, 2009 09:47AM
Quote
vipsoft @ Dec 15 2009, 11:53 PM
and report back to us the debug output? Thanks.
array(2) 
{ 
  ["/index"]=>  object(Piwik_DataTable_Row)#190 (1) 
  { 
    ["c"]=>  array(3) 
    { 
      [0]=>  array(4) 
      { 
        ["label"]=>  string(6) "/index" 
        ["nb_visits"]=>  string(2) "67" 
        ["nb_uniq_visitors"]=>  string(2) "66" 
        ["nb_hits"]=>  string(3) "107" 
      } 
      [1]=>  array(1) 
      { 
        ["url"]=>  string(27) "http://www.domain.tld/" 
      } 
      [3]=>  NULL 
    } 
  } 
  ["kosmetik"]=>  &NULL 
} 

NULL 

array(2) 
{ 
  [0]=>  string(8) "kosmetik" 
  [1]=>  string(6) "studio" 
} 

 string(1) "1"


After an Upgrade to 0.5.3 i get no longer the error message from above. For the dates 2009-12-14 and 2009-12-15 I see for the statistic Actions > Pages the message "No data for this table.". For today (2009-12-16) I get data and statistics. So maybe the reason for the problems on 2009-12-14 and 2009-12-15 are some corrupt data in the database?

Guido
IchBins [ # ]
December 16, 2009 10:36AM
P.S.: Since I tried to regenerate the archivetables for december 2009 (with enabled action plugin) all widgets show the above errormessage.

bye

markus
t4b [ # ]
December 16, 2009 11:35AM
Just for your information: I updated from 0.5.2 to 0.5.3, the error is the same.

In the 'last visits graph' for example:

Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /var/www/html/plugins/Actions/Actions.php on line 362

Please say if I can help with any debugging.
t4b [ # ]
December 16, 2009 11:38AM
one hint: the problem exists only for the first tracked page, the statistics for the other four sites don't show this error.
Guido [ # ]
December 16, 2009 11:55PM
Quote
Guido @ Dec 16 2009, 08:47 AM
After an Upgrade to 0.5.3 i get no longer the error message from above. For the dates 2009-12-14 and 2009-12-15 I see for the statistic Actions > Pages the message "No data for this table.". For today (2009-12-16) I get data and statistics. So maybe the reason for the problems on 2009-12-14 and 2009-12-15 are some corrupt data in the database?

I've changed nothing on the system since my posting in the morning. But now i get the same error for todays statistics: "Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /homepages/26/d283610669/htdocs/app/webroot/stat/plugins/Actions/Actions.php on line 380"

Guido
matt [ # ]
December 17, 2009 07:16PM
I wasn't able to replicate but I added a sanity check, can you please apply the patch to your Piwik and see if it now works without error?

http://dev.piwik.org/trac/changeset/1721



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

Guido [ # ]
December 18, 2009 12:53PM
Hi,

Quote
matthieu @ Dec 17 2009, 06:16 PM
I wasn't able to replicate but I added a sanity check, can you please apply the patch to your Piwik and see if it now works without error?

I've made an upgrade to 0.5.4 in the morning. As I saw the patch is included in that version.

Statistics (Visitors, Refererers, Goals, ...) for everything in the past are working, except the Actions statistics for the current month (12/2009). Error message "No data for this table." (No matter if i select day, week or month as period).

If I select the day statistics for today, then i get on every statistic/widget "Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /path/to/piwik/plugins/Actions/Actions.php on line 385". If i deactivate the Actions plugin, then every other statistic for today works fine.

I have already deleted the tables piwik_archive_blob_2009_12 and piwik_archive_numeric_2009_12 to rebuild these tables, but that was not helpful.

Thank you for the support.

Guido
maxknax [ # ]
December 19, 2009 10:47AM
Actually i have the same Error with 0.5.4:

/var/www/stat/htdocs/piwik/misc/cron/archive.sh

Fatal error: Cannot use object of type Piwik_DataTable_Row as array in /var/www/stat/htdocs/piwik/plugins/Actions/Actions.php on line 385

PHP Version is: 5.2.11
matt [ # ]
December 21, 2009 10:33AM
When you updated to 0.5.4 and still experience the issue, can you please do the following.

Change line 385 of plugins/Actions/Actions.php, from:

    $currentTable =& $currentTable[$actionName];

to:
    if(!is_object($currentTable)) {
        $currentTable =& $currentTable[$actionName];
    }
    else
    {
echo 'actionsTablesByType';
        var_dump($this->actionsTablesByType[$row['type']]);
echo 'currentTable';
        var_dump($currentTable);
echo 'actionExplodedNames';
        var_dump($actionExplodedNames);
echo 'row';
        var_dump($row);
die;

    }

and report back to us the debug output, wrapped in CODE tags? Thanks.



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

maxknax [ # ]
December 21, 2009 01:10PM
The Debug Output is 1,8 GB in a Log file (via > director under Linux).
I think this is to many for this Board . . .

Link: (it is a 48 MByte bz2 Archive)

//Iam not allowed to Post Links, Site: www.maxknax.net File: /forum/archive.log.bz2

edit2: Funny is: Now i have Statistics Calculated
d--j [ # ]
December 24, 2009 01:10AM
I recently upgraded the Piwik installation from < 0.5 to 0.5.4. Now I get the same error message as the OP but on line 367 of plugins/Actions/Actions.php.

I added the following debug output to this line

                if(!is_object($currentTable)) {
                    $currentTable =& $currentTable[$actionCategory];
                }
                else
                {
                    echo '<pre>';
                    echo 'actionsTablesByType'."\n";
                    var_dump($this->actionsTablesByType[$row['type']]);
                    echo 'currentTable'."\n";
                    var_dump($currentTable);
                    echo 'actionExplodedNames'."\n";
                    var_dump($actionExplodedNames);
                    echo 'row'."\n";
                    var_dump($row);
                    echo '</pre>';
                    die;
                }

and got output like
actionsTablesByType
array(2) {
  ["countries"]=>
  array(10) {
    ["fi"]=>
    array(1) {
      ["cities"]=>
      array(1) {
        ["helsinki"]=>
        object(Piwik_DataTable_Row)#375 (1) {
          ["c"]=>
          array(3) {
            [0]=>
            array(4) {
              ["label"]=>
              string(8) "helsinki"
              ["nb_visits"]=>
              string(1) "1"
              ["nb_uniq_visitors"]=>
              string(1) "1"
              ["nb_hits"]=>
              string(1) "2"
            }
            [1]=>
            array(1) {
              ["url"]=>
              string(29) "/countries/fi/cities/helsinki"
            }
            [3]=>
            NULL
          }
        }
      }
    }
    ["nl"]=>
    array(1) {
      ["cities"]=>
      array(1) {
        ["amsterdam"]=>
        object(Piwik_DataTable_Row)#421 (1) {
          ["c"]=>
          array(3) {
            [0]=>
            array(4) {
              ["label"]=>
              string(9) "amsterdam"
              ["nb_visits"]=>
              string(1) "1"
              ["nb_uniq_visitors"]=>
              string(1) "1"
              ["nb_hits"]=>
              string(1) "1"
            }
            [1]=>
            array(1) {
              ["url"]=>
              string(30) "/countries/nl/cities/amsterdam"
            }
            [3]=>
            NULL
          }
        }
      }
    }
    ["si"]=>
    object(Piwik_DataTable_Row)#430 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "si"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/si"
        }
        [3]=>
        NULL
      }
    }
    ["no"]=>
    array(1) {
      ["cities"]=>
      array(1) {
        ["oslo"]=>
        object(Piwik_DataTable_Row)#426 (1) {
          ["c"]=>
          array(3) {
            [0]=>
            array(4) {
              ["label"]=>
              string(4) "oslo"
              ["nb_visits"]=>
              string(1) "1"
              ["nb_uniq_visitors"]=>
              string(1) "1"
              ["nb_hits"]=>
              string(1) "1"
            }
            [1]=>
            array(1) {
              ["url"]=>
              string(25) "/countries/no/cities/oslo"
            }
            [3]=>
            NULL
          }
        }
      }
    }
    ["at"]=>
    &object(Piwik_DataTable_Row)#432 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "at"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/at"
        }
        [3]=>
        NULL
      }
    }
    ["be"]=>
    object(Piwik_DataTable_Row)#433 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "be"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/be"
        }
        [3]=>
        NULL
      }
    }
    ["hr"]=>
    object(Piwik_DataTable_Row)#435 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "hr"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/hr"
        }
        [3]=>
        NULL
      }
    }
    ["fr"]=>
    object(Piwik_DataTable_Row)#436 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "fr"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/fr"
        }
        [3]=>
        NULL
      }
    }
    ["se"]=>
    object(Piwik_DataTable_Row)#437 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "se"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/se"
        }
        [3]=>
        NULL
      }
    }
    ["ie"]=>
    object(Piwik_DataTable_Row)#439 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(2) "ie"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "1"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(13) "/countries/ie"
        }
        [3]=>
        NULL
      }
    }
  }
  ["example.com"]=>
  array(1) {
    ["/countries/de"]=>
    object(Piwik_DataTable_Row)#410 (1) {
      ["c"]=>
      array(3) {
        [0]=>
        array(4) {
          ["label"]=>
          string(13) "/countries/de"
          ["nb_visits"]=>
          string(1) "1"
          ["nb_uniq_visitors"]=>
          string(1) "1"
          ["nb_hits"]=>
          string(1) "2"
        }
        [1]=>
        array(1) {
          ["url"]=>
          string(43) "http://example.com/countries/de"
        }
        [3]=>
        NULL
      }
    }
  }
}
currentTable
object(Piwik_DataTable_Row)#432 (1) {
  ["c"]=>
  array(3) {
    [0]=>
    array(4) {
      ["label"]=>
      string(2) "at"
      ["nb_visits"]=>
      string(1) "1"
      ["nb_uniq_visitors"]=>
      string(1) "1"
      ["nb_hits"]=>
      string(1) "1"
    }
    [1]=>
    array(1) {
      ["url"]=>
      string(13) "/countries/at"
    }
    [3]=>
    NULL
  }
}
actionExplodedNames
array(4) {
  [0]=>
  string(9) "countries"
  [1]=>
  string(2) "at"
  [2]=>
  string(6) "cities"
  [3]=>
  string(10) "klagenfurt"
}
row
array(5) {
  ["name"]=>
  string(31) "/countries/at/cities/klagenfurt"
  ["type"]=>
  string(1) "2"
  ["nb_visits"]=>
  string(1) "1"
  ["nb_uniq_visitors"]=>
  string(1) "1"
  ["nb_hits"]=>
  string(1) "1"
}



The error occures only on one very recently added website. A website that was added some time ago does not have this problem.
maze [ # ]
January 18, 2010 08:45AM
Since January 16th the error occured on one of my sites and the archive.sh returns the same error. Was the problem fixed?

I had used version 0.5.3 an I updated now to 0.5.4. If it is a wrong action type, can I repair the database data? Or what else can I do?
IchBins [ # ]
February 09, 2010 04:12PM
Hmmm, I just got a message from my sysadmin telling me, that my piwik archive.sh doesn't work anymore.

The errormessages are the same as stated above. Even if I found the "reverted by matt's review"-remark in your bug-log I tried the "fix" (changeset #1754) again. At least the script runs now...but I afraid I'll end up with a trashed piwik-database again. :-(

BTW: this happened on a fresh piwik 0.5.4 I installed manually from scratch to a completely empty database (ok, completely empty piwik-tables).

Any ideas?

regards

markus
AdrianC [ # ]
March 05, 2010 07:48PM
I've just started to use Piwik, and have recently installed it on three hosts for different sites. All have been working fine, but one site has just started to have this error message. This instance of Piwik only has one live site, and one (little used) test site - which is behaving fine.

For yesterday and today, I'm getting the message in place of the Last Visits Graph, and the little graphs for Vists Overview & Frequency Overview are missing, although the data is displaying fine.
For Weds this week, though, I'm getting this message in place of every single widget...
For days prior to that, though, everything's working fine.

It's PHP 5.1.6 on CentOS 5.4, if it makes much difference.
tripcart [ # ]
March 09, 2010 08:02AM
Best way is update automatically if not possible then find you sure miss any library file.
matt [ # ]
March 09, 2010 04:47PM
For users who have the issue, please do the following:
1) export your Piwik DB,
2) PM me the URL
3) also telling which dates does the archiving bug, and which website


I'll take a look, thanks



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

AdrianC [ # ]
March 10, 2010 02:40PM
Quote
matthieu @ Mar 9 2010, 03:47 PM
For users who have the issue, please do the following:
1) export your Piwik DB,
2) PM me the URL
3) also telling which dates does the archiving bug, and which website


I'll take a look, thanks

PM sent, Matthieu.
matt [ # ]
March 12, 2010 11:25AM
Thanks AdrianC! I posted the patch in: http://dev.piwik.org/trac/ticket/1082#comment:28

All, please apply the patch to your Piwik and report here if it fixes the issue for you. Thanks!



Cheers,
Matt
Piwik founder

Piwik FAQ - Piwik Help - before posting a new topic
Stay tuned on the Piwik Blog. You may follow me on twitter & on github

AdrianC [ # ]
March 12, 2010 11:59AM
Quote
matthieu @ Mar 12 2010, 10:25 AM
All, please apply the patch to your Piwik and report here if it fixes the issue for you. Thanks!

Looks to have fixed it for me.
Sorry, only registered users may post in this forum.

Click here to login

Free Forum support is provided by the Piwik Community. If you require any urgent or professional help, contact Piwik Professional Services team!