Ticket #146 (closed Bug: fixed)

Opened 8 months ago

Last modified 8 months ago

Column nb_visits already in the array

Reported by: droidmcse Assigned to:
Priority: major Milestone: DVNO
Component: Core Version:
Keywords: Cc:

Description

I found ticket #140 and I have the same error. I didn't modify the database. However, this should probably be logged under a different ticket, but there isn't a create tables script for those of us who don't have permissions to create tables.

I am using: Linux uawww.domain.com 2.6.18-53.1.4.el5 #1 SMP Fri Nov 30 00:45:16 EST 2007 i686 athlon i386 GNU/Linux

php -v PHP 5.1.6 (cli) (built: Sep 20 2007 10:16:10) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

mysql --help mysql Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (i686) using readline 5.0

#0 /var/www/html/piwik/plugins/Actions/Actions.php(265): Piwik_DataTable_Row->addColumn('nb_visits', '1') #1 /var/www/html/piwik/plugins/Actions/Actions.php(111): Piwik_Actions->updateActionsTableWithRowQuery(Object(Zend_Db_Statement_Pdo)) #2 [internal function]: Piwik_Actions->archiveDay(Object(Event_Notification)) #3 /var/www/html/piwik/libs/Event/Dispatcher.php(280): call_user_func_array(Array, Array) #4 /var/www/html/piwik/libs/Event/Dispatcher.php(250): Event_Dispatcher->postNotification(Object(Event_Notification), true, false) #5 /var/www/html/piwik/modules/PluginsManager.php(422): Event_Dispatcher->post(Object(Piwik_ArchiveProcessing_Day), 'ArchiveProcessi...', Array, true, false) #6 /var/www/html/piwik/modules/ArchiveProcessing/Day.php(69): Piwik_PostEvent('ArchiveProcessi...', Object(Piwik_ArchiveProcessing_Day)) #7 /var/www/html/piwik/modules/ArchiveProcessing.php(237): Piwik_ArchiveProcessing_Day->compute() #8 /var/www/html/piwik/modules/Archive/Single.php(80): Piwik_ArchiveProcessing->loadArchive() #9 /var/www/html/piwik/modules/Archive/Single.php(117): Piwik_Archive_Single->prepareArchive() #10 /var/www/html/piwik/modules/Archive/Single.php(306): Piwik_Archive_Single->get('UserSettings_pl...', 'blob') #11 /var/www/html/piwik/plugins/UserSettings/API.php(108): Piwik_Archive_Single->getDataTable('UserSettings_pl...') #12 [internal function]: Piwik_UserSettings_API->getPlugin('1', 'day', '2008-03-15') #13 /var/www/html/piwik/modules/API/Proxy.php(462): call_user_func_array(Array, Array) #14 [internal function]: Piwik_API_Proxy->call('getPlugin', Array) #15 [internal function]: Piwik_API_Proxy->getPlugin('1', 'day', '2008-03-15') #16 /var/www/html/piwik/modules/API/Request.php(140): call_user_func_array(Array, Array) #17 /var/www/html/piwik/modules/ViewDataTable.php(352): Piwik_API_Request->process() #18 /var/www/html/piwik/modules/ViewDataTable/Html.php(45): Piwik_ViewDataTable->loadDataTableFromAPI() #19 /var/www/html/piwik/modules/Controller.php(43): Piwik_ViewDataTable_Html->main() #20 /var/www/html/piwik/plugins/UserSettings/Controller.php(114): Piwik_Controller->renderView(Object(Piwik_ViewDataTable_Html), true) #21 /var/www/html/piwik/plugins/UserSettings/Controller.php(11): Piwik_UserSettings_Controller->getPlugin(true) #22 [internal function]: Piwik_UserSettings_Controller->index() #23 /var/www/html/piwik/modules/FrontController.php(119): call_user_func_array(Array, Array) #24 /var/www/html/piwik/index.php(62): Piwik_FrontController->dispatch() #25 {main}

Change History

03/17/08 09:37:42 changed by matt

  • milestone set to DVNO.

does it happen when you select every day? can you give me access to this webserver so I can try to find the bug?

03/17/08 16:25:55 changed by davidw

I get the same error a couple of hours after installing. Please contact me if you like access to our server.

03/17/08 16:26:58 changed by davidw

Sorry... Perhaps an emailadress would make it easier to contact me: david@newsdesk.se

(follow-up: ↓ 5 ) 03/17/08 16:56:14 changed by droidmcse

I had to take piwik offline. After 1 full day of traffic, pulling up any reports took over 5 minutes.

I'm anxious to use it, but the site I'm trying to put it in gets over 5k uniques per day. I had similar luck with phpOpenTracker - just an exorbanant amount of data to track.

(in reply to: ↑ 4 ) 03/17/08 23:15:49 changed by davidw

There are currently no indexes on the log tables. I tried to add a few and that made all the difference for me:

CREATE INDEX index_idvisit ON log_link_visit_action (idvisit);
CREATE INDEX index_idaction ON log_action (idaction);
CREATE INDEX index_idsite ON log_visit (idsite);
CREATE INDEX index_visit_server_date ON log_visit (visit_server_date);

Replying to droidmcse:

I had to take piwik offline. After 1 full day of traffic, pulling up any reports took over 5 minutes. I'm anxious to use it, but the site I'm trying to put it in gets over 5k uniques per day. I had similar luck with phpOpenTracker - just an exorbanant amount of data to track.

03/18/08 00:39:30 changed by droidmcse

Ok - I put it back online since I got the indexes. I realize that it's a separate issue.

Ok so I am not 100% positive that this won't bite me in the rear, but my site is: www.toolsource.com/piwik username: piwik password: P1w1k1

03/18/08 13:26:20 changed by matt

droidmcse, you should not give passwords to everybody!

I will study the index strategy add add them before the beta

03/19/08 13:33:19 changed by matt

  • status changed from new to closed.
  • resolution set to fixed.

It seems the bug is fixed in the last version. I tried on david box and it works well.

03/19/08 14:04:59 changed by mjbe

  • status changed from closed to reopened.
  • resolution deleted.

Using r391.

When accessing index.php without parameters, all widgets except "Last visits graph" display data (no crash, last visits is just empty, probably because Piwik hasn't been able to record anything).

However, if I change to a specific day/week/year, I get this:

Uncaught exception: 'Column nb_visits already in the array!'
More information

In /home/.yana/mikael/mikael.jansson.be/piwik/modules/DataTable/Row.php on line 270
Backtrace:

#0 /home/.yana/mikael/mikael.jansson.be/piwik/plugins/Actions/Actions.php(293): Piwik_DataTable_Row->addColumn('nb_visits', '1')
#1 /home/.yana/mikael/mikael.jansson.be/piwik/plugins/Actions/Actions.php(121): Piwik_Actions->updateActionsTableWithRowQuery(Object(Zend_Db_Statement_Pdo))
#2 /home/.yana/mikael/mikael.jansson.be/piwik/libs/Event/Dispatcher.php(280): Piwik_Actions->archiveDay(Object(Event_Notification))
#3 /home/.yana/mikael/mikael.jansson.be/piwik/libs/Event/Dispatcher.php(250): Event_Dispatcher->postNotification(Array, Array)
#4 /home/.yana/mikael/mikael.jansson.be/piwik/modules/PluginsManager.php(445): Event_Dispatcher->post(Object(Event_Notification), true, false)
#5 /home/.yana/mikael/mikael.jansson.be/piwik/modules/ArchiveProcessing/Day.php(69): Piwik_PostEvent()
#6 /home/.yana/mikael/mikael.jansson.be/piwik/modules/ArchiveProcessing.php(237): Piwik_ArchiveProcessing_Day->compute(Object(Piwik_ArchiveProcessing_Day), 'ArchiveProcessi...', Array, true, false)
#7 /home/.yana/mikael/mikael.jansson.be/piwik/modules/Archive/Single.php(80): Piwik_ArchiveProcessing->loadArchive('ArchiveProcessi...', Object(Piwik_ArchiveProcessing_Day))
#8 /home/.yana/mikael/mikael.jansson.be/piwik/modules/ArchiveProcessing.php(387): Piwik_Archive_Single->prepareArchive()
#9 /home/.yana/mikael/mikael.jansson.be/piwik/modules/ArchiveProcessing.php(233): Piwik_ArchiveProcessing->loadSubperiodsArchive()
#10 /home/.yana/mikael/mikael.jansson.be/piwik/modules/Archive/Single.php(80): Piwik_ArchiveProcessing->loadArchive()
#11 /home/.yana/mikael/mikael.jansson.be/piwik/modules/Archive/Single.php(117): Piwik_Archive_Single->prepareArchive()
#12 /home/.yana/mikael/mikael.jansson.be/piwik/modules/Archive/Single.php(306): Piwik_Archive_Single->get()
#13 /home/.yana/mikael/mikael.jansson.be/piwik/plugins/VisitorInterest/API.php(40): Piwik_Archive_Single->getDataTable()
#14 /home/.yana/mikael/mikael.jansson.be/piwik/modules/API/Proxy.php(462): Piwik_VisitorInterest_API->getNumberOfVisitsPerVisitDuration('VisitorInterest...', 'blob')
#15 [internal function]: Piwik_API_Proxy->__call('VisitorInterest...')
#16 /home/.yana/mikael/mikael.jansson.be/piwik/modules/API/Request.php(140): Piwik_API_Proxy->getNumberOfVisitsPerVisitDuration('1', 'month', '2008-03-18')
#17 /home/.yana/mikael/mikael.jansson.be/piwik/modules/ViewDataTable.php(365): Piwik_API_Request->process(Array, Array)
#18 /home/.yana/mikael/mikael.jansson.be/piwik/modules/ViewDataTable/Cloud.php(44): Piwik_ViewDataTable->loadDataTableFromAPI('getNumberOfVisi...', Array)
#19 /home/.yana/mikael/mikael.jansson.be/piwik/modules/Controller.php(43): Piwik_ViewDataTable_Cloud->main('1', 'month', '2008-03-18')
#20 /home/.yana/mikael/mikael.jansson.be/piwik/plugins/VisitorInterest/Controller.php(32): Piwik_Controller->renderView(Array, Array)
#21 /home/.yana/mikael/mikael.jansson.be/piwik/modules/FrontController.php(122): Piwik_VisitorInterest_Controller->getNumberOfVisitsPerVisitDuration()
#22 /home/.yana/mikael/mikael.jansson.be/piwik/index.php(62): Piwik_FrontController->dispatch()
#23 {main}

(follow-up: ↓ 11 ) 03/19/08 14:13:49 changed by matt

Please enable

always_archive_data = true 

in your config/global.ini.php under the

[Debug]

section. try to archive your data again, does it work better? If not send me SSH or FTP access to your piwik installation with write access to your piwik files by email. thanks

(in reply to: ↑ 10 ) 03/19/08 14:21:11 changed by mjbe

Replying to matt:

Please enable {{{ always_archive_data = true }}} in your config/global.ini.php under the {{{ [Debug] }}} section. try to archive your data again, does it work better?

This is what I'm doing:

1. Go to http://thesite/piwik/index.php 2. Data is displayed for the day 3. Click on "week" 4. Exceptions.

I'm not doing any archiving operation.

If not send me SSH or FTP access to your piwik installation with write access to your piwik files by email. thanks

Hah, as if!

However, if you tell me what data you need to make a minimal test case, I can provide it for you.

03/20/08 11:28:45 changed by mjbe

This seems indeed only be happening when I change to another view than _day_. It still seems to be recording visits, which is good, as the "visit by server time" graph works. The "Last visit graph" is broken, though.

Any ideas on how I can go about debugging this?

03/20/08 16:06:48 changed by uncleringo

I have exactly the same issue - Uncaught exception: 'Column nb_visits already in the array!'

I've just tried the latest piwik download today but it does not fix anything.

I've tried adding the indexes as suggested above without result, and also changing always_archive_data to true also without result.

Any further suggestions? If I can provide any more info let me know as I'm keen to help this project if I can!

(follow-up: ↓ 15 ) 03/20/08 16:35:10 changed by matt

The easiest way to help in this case would be to give me access to your piwik files (ftp or ssh) so I can debug. I promise I won't do anything harmful of course.

(in reply to: ↑ 14 ) 03/20/08 16:39:15 changed by mjbe

Replying to matt:

The easiest way to help in this case would be to give me access to your piwik files (ftp or ssh) so I can debug. I promise I won't do anything harmful of course.

I can give you the revision of piwik I'm using plus an SQL dump of the piwik tables.

03/20/08 16:53:12 changed by matt

mjbe, please send me your SQL dump at matthieu at piwik .org thanks

03/22/08 00:36:00 changed by matt

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [395]) - fix #146 Column nb_visits already in the array thanks to all for your help! :) - refs #33 working on this... - split the Record_* classes into several files