Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#2758 closed Bug (fixed)

Adding segment to VisitorInterest.getNumberOfVisitsPerVisitDuration causes SQL constraint violation

Reported by: dbvista Owned by:
Priority: major Milestone: 1.7 Piwik 1.7
Component: Core Keywords:
Cc: Sensitive: no

Description

In 1.6, adding the "segment" query parameter like this:

<div id="widgetIframe"><iframe width="100%" height="350" src="http://example.com/piwik/index.php?module=Widgetize&amp;action=iframe&amp;moduleToWidgetize=VisitorInterest&amp;actionToWidgetize=getNumberOfVisitsPerVisitDuration&amp;idSite=9&amp;period=day&amp;date=yesterday&amp;disableLink=1&amp;widget=1&amp;segment=pageTitle!=nexus" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></div>

produces this error message:

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'server_time' in field list is ambiguous

And this backtrace:

#0 /var/www/html/piwik/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/piwik/libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/html/piwik/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('????SELECT?????...', Array)
#3 /var/www/html/piwik/core/Db/Adapter/Pdo/Mysql.php(211): Zend_Db_Adapter_Pdo_Abstract->query('????SELECT?????...', Array)
#4 /var/www/html/piwik/core/ArchiveProcessing/Day.php(349): Piwik_Db_Adapter_Pdo_Mysql->query('????SELECT?????...', Array)
#5 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(163): Piwik_ArchiveProcessing_Day->queryConversionsByDimension('HOUR(server_tim...')
#6 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(133): Piwik_VisitTime->archiveDayAggregateGoals(Object(Piwik_ArchiveProcessing_Day))
#7 [internal function]: Piwik_VisitTime->archiveDay(Object(Piwik_Event_Notification))
#8 /var/www/html/piwik/libs/Event/Dispatcher.php(284): call_user_func_array(Array, Array)
#9 /var/www/html/piwik/core/PluginsManager.php(609): Event_Dispatcher->postNotification(Object(Piwik_Event_Notification), false, false)
#10 /var/www/html/piwik/core/ArchiveProcessing/Day.php(42): Piwik_PostEvent('ArchiveProcessi...', Object(Piwik_ArchiveProcessing_Day))
#11 /var/www/html/piwik/cor

Change History (5)

comment:1 Changed 2 years ago by dbvista

Full backtrace:

#0 /var/www/html/piwik/libs/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/piwik/libs/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /var/www/html/piwik/libs/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('????SELECT?????...', Array)
#3 /var/www/html/piwik/core/Db/Adapter/Pdo/Mysql.php(211): Zend_Db_Adapter_Pdo_Abstract->query('????SELECT?????...', Array)
#4 /var/www/html/piwik/core/ArchiveProcessing/Day.php(349): Piwik_Db_Adapter_Pdo_Mysql->query('????SELECT?????...', Array)
#5 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(163): Piwik_ArchiveProcessing_Day->queryConversionsByDimension('HOUR(server_tim...')
#6 /var/www/html/piwik/plugins/VisitTime/VisitTime.php(133): Piwik_VisitTime->archiveDayAggregateGoals(Object(Piwik_ArchiveProcessing_Day))
#7 [internal function]: Piwik_VisitTime->archiveDay(Object(Piwik_Event_Notification))
#8 /var/www/html/piwik/libs/Event/Dispatcher.php(284): call_user_func_array(Array, Array)
#9 /var/www/html/piwik/core/PluginsManager.php(609): Event_Dispatcher->postNotification(Object(Piwik_Event_Notification), false, false)
#10 /var/www/html/piwik/core/ArchiveProcessing/Day.php(42): Piwik_PostEvent('ArchiveProcessi...', Object(Piwik_ArchiveProcessing_Day))
#11 /var/www/html/piwik/core/ArchiveProcessing.php(440): Piwik_ArchiveProcessing_Day->compute()
#12 /var/www/html/piwik/core/Archive/Single.php(224): Piwik_ArchiveProcessing->launchArchiving()
#13 /var/www/html/piwik/core/Archive/Single.php(253): Piwik_Archive_Single->prepareArchive()
#14 /var/www/html/piwik/core/Archive/Single.php(499): Piwik_Archive_Single->get('VisitTime_local...', 'blob')
#15 /var/www/html/piwik/plugins/VisitTime/API.php(34): Piwik_Archive_Single->getDataTable('VisitTime_local...')
#16 /var/www/html/piwik/plugins/VisitTime/API.php(43): Piwik_VisitTime_API->getDataTable('VisitTime_local...', '9', 'day', 'yesterday', 'pageTitle!=nexu...')
#17 [internal function]: Piwik_VisitTime_API->getVisitInformationPerLocalTime('9', 'day', 'yesterday', 'pageTitle!=nexu...')
#18 /var/www/html/piwik/core/API/Proxy.php(179): call_user_func_array(Array, Array)
#19 /var/www/html/piwik/core/API/Request.php(121): Piwik_API_Proxy->call('Piwik_VisitTime...', 'getVisitInforma...', Array)
#20 /var/www/html/piwik/core/ViewDataTable.php(391): Piwik_API_Request->process()
#21 /var/www/html/piwik/core/ViewDataTable/GenerateGraphData.php(98): Piwik_ViewDataTable->loadDataTableFromAPI()
#22 /var/www/html/piwik/core/Controller.php(146): Piwik_ViewDataTable_GenerateGraphData->main()
#23 /var/www/html/piwik/plugins/VisitTime/Controller.php(58): Piwik_Controller->renderView(Object(Piwik_ViewDataTable_GenerateGraphData_ChartVerticalBar), false)
#24 [internal function]: Piwik_VisitTime_Controller->getVisitInformationPerLocalTime()
#25 /var/www/html/piwik/core/FrontController.php(132): call_user_func_array(Array, Array)
#26 /var/www/html/piwik/core/FrontController.php(153): Piwik_FrontController->dispatch('VisitTime', 'getVisitInforma...', Array)
#27 /var/www/html/piwik/core/ViewDataTable/GenerateGraphHTML.php(148): Piwik_FrontController->fetchDispatch('VisitTime', 'getVisitInforma...', Array)
#28 /var/www/html/piwik/core/ViewDataTable/GenerateGraphHTML.php(108): Piwik_ViewDataTable_GenerateGraphHTML->getGraphData()
#29 /var/www/html/piwik/core/ViewDataTable/GenerateGraphHTML.php(92): Piwik_ViewDataTable_GenerateGraphHTML->buildView()
#30 /var/www/html/piwik/core/Controller.php(146): Piwik_ViewDataTable_GenerateGraphHTML->main()
#31 /var/www/html/piwik/plugins/VisitTime/Controller.php(58): Piwik_Controller->renderView(Object(Piwik_ViewDataTable_GenerateGraphHTML_ChartVerticalBar), true)
#32 [internal function]: Piwik_VisitTime_Controller->getVisitInformationPerLocalTime(true)
#33 /var/www/html/piwik/core/FrontController.php(132): call_user_func_array(Array, Array)
#34 /var/www/html/piwik/core/FrontController.php(153): Piwik_FrontController->dispatch('VisitTime', 'getVisitInforma...', Array)
#35 /var/www/html/piwik/plugins/Widgetize/Controller.php(67): Piwik_FrontController->fetchDispatch('VisitTime', 'getVisitInforma...', Array)
#36 [internal function]: Piwik_Widgetize_Controller->iframe()
#37 /var/www/html/piwik/core/FrontController.php(132): call_user_func_array(Array, Array)
#38 /var/www/html/piwik/index.php(53): Piwik_FrontController->dispatch()
#39 {main}

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

  • Milestone set to 1.6.x Piwik 1.6.x
  • Priority changed from normal to major

Thanks for the report, we will fix it in the next days.

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

  • Priority changed from major to critical

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

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

(In [5564]) Fixes #2758

comment:5 Changed 2 years ago by matt (mattab)

  • Priority changed from critical to major
Note: See TracTickets for help on using tickets.