@sgiehl opened this Issue on February 14th 2014 Member

Some parts of Piwik are not loading correct.

Precondition (to reproduce local):

Setup Piwik with a website (e.g. ID 1). Grant anonymous view access to that website. Logout of Piwik and visit the Visitors Overview. The report shouldn't load.

Reason:
A NoAccessException is thrown which causes an error while loading the report with ajax

I've debugged that issue. The Exception is thrown within the segmenteditor api (https://github.com/piwik/piwik/blob/master/plugins/SegmentEditor/API.php#L277).
See full backtrace below.

URL on the demo to reproduce:

http://demo.piwik.org/index.php?date=yesterday&module=VisitsSummary&action=index&idSite=7&period=day

Full Backtrace for the Exception:


<a href='/0'>#0</a> /var/www/piwik/core/Piwik.php(451): Piwik\Access->checkUserHasSuperUserAccess()
<a href='/1'>#1</a> /var/www/piwik/plugins/SegmentEditor/API.php(277): Piwik\Piwik::checkUserHasSuperUserAccess()
<a href='/2'>#2</a> /var/www/piwik/plugins/SegmentEditor/SegmentEditor.php(57): Piwik\Plugins\SegmentEditor\API->getAll(false, true)
<a href='/3'>#3</a> [internal function]: Piwik\Plugins\SegmentEditor\SegmentEditor->getKnownSegmentsToArchiveAllSites(Array)
<a href='/4'>#4</a> /var/www/piwik/core/EventDispatcher.php(98): call_user_func_array(Array, Array)
<a href='/5'>#5</a> /var/www/piwik/core/Piwik.php(778): Piwik\EventDispatcher->postEvent('Segments.getKno...', Array, false, NULL)
<a href='/6'>#6</a> /var/www/piwik/core/SettingsPiwik.php(88): Piwik\Piwik::postEvent('Segments.getKno...', Array)
<a href='/7'>#7</a> /var/www/piwik/core/ArchiveProcessor/Rules.php(67): Piwik\SettingsPiwik::getKnownSegmentsToArchive()
<a href='/8'>#8</a> /var/www/piwik/core/ArchiveProcessor/Rules.php(55): Piwik\ArchiveProcessor\Rules::shouldProcessReportsAllPlugins(Object(Piwik\Segment), 'day')
<a href='/9'>#9</a> /var/www/piwik/core/Archive.php(647): Piwik\ArchiveProcessor\Rules::getDoneStringFlagFor(Object(Piwik\Segment), 'day', 'VisitsSummary')
<a href='/10'>#10</a> /var/www/piwik/core/Archive.php(531): Piwik\Archive->getDoneStringForPlugin('VisitsSummary')
<a href='/11'>#11</a> /var/www/piwik/core/Archive.php(490): Piwik\Archive->getArchiveIds(Array)
<a href='/12'>#12</a> /var/www/piwik/core/Archive.php(339): Piwik\Archive->get(Array, 'numeric')
<a href='/13'>#13</a> /var/www/piwik/plugins/VisitsSummary/API.php(59): Piwik\Archive->getDataTableFromNumeric(Array)
<a href='/14'>#14</a> [internal function]: Piwik\Plugins\VisitsSummary\API->get('1', 'day', '2014-01-15,2014...', 'visitorType==re...', 'nb_visits,nb_ac...')
<a href='/15'>#15</a> /var/www/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
<a href='/16'>#16</a> /var/www/piwik/core/API/Request.php(215): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
<a href='/17'>#17</a> /var/www/piwik/core/API/Request.php(301): Piwik\API\Request->process()
<a href='/18'>#18</a> /var/www/piwik/plugins/VisitFrequency/API.php(47): Piwik\API\Request::processRequest('VisitsSummary.g...', Array)
<a href='/19'>#19</a> [internal function]: Piwik\Plugins\VisitFrequency\API->get('1', 'day', '2014-01-15,2014...', false, 'nb_visits_retur...')
<a href='/20'>#20</a> /var/www/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
<a href='/21'>#21</a> /var/www/piwik/plugins/API/API.php(451): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
<a href='/22'>#22</a> [internal function]: Piwik\Plugins\API\API->get('1', 'day', '2014-01-15,2014...', false, false)
<a href='/23'>#23</a> /var/www/piwik/core/API/Proxy.php(209): call_user_func_array(Array, Array)
<a href='/24'>#24</a> /var/www/piwik/core/API/Request.php(215): Piwik\API\Proxy->call('\Piwik\Plugins\...', 'get', Array)
<a href='/25'>#25</a> /var/www/piwik/core/ViewDataTable/Request.php(48): Piwik\API\Request->process()
<a href='/26'>#26</a> /var/www/piwik/core/Plugin/ViewDataTable.php(271): Piwik\ViewDataTable\Request->loadDataTableFromAPI(Array)
<a href='/27'>#27</a> /var/www/piwik/core/Plugin/Visualization.php(166): Piwik\Plugin\ViewDataTable->loadDataTableFromAPI(Array)
<a href='/28'>#28</a> /var/www/piwik/core/Plugin/ViewDataTable.php(358): Piwik\Plugin\Visualization->buildView()
<a href='/29'>#29</a> /var/www/piwik/core/Plugin/Controller.php(200): Piwik\Plugin\ViewDataTable->render()
<a href='/30'>#30</a> /var/www/piwik/plugins/VisitsSummary/Controller.php(94): Piwik\Plugin\Controller->renderView(Object(Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution))
<a href='/31'>#31</a> /var/www/piwik/plugins/VisitsSummary/Controller.php(29): Piwik\Plugins\VisitsSummary\Controller->getEvolutionGraph(Array)
<a href='/32'>#32</a> [internal function]: Piwik\Plugins\VisitsSummary\Controller->index()
<a href='/33'>#33</a> /var/www/piwik/core/FrontController.php(521): call_user_func_array(Array, Array)
<a href='/34'>#34</a> /var/www/piwik/core/FrontController.php(84): Piwik\FrontController->doDispatch(NULL, NULL, NULL)
<a href='/35'>#35</a> /var/www/piwik/core/dispatch.php(30): Piwik\FrontController->dispatch()
<a href='/36'>#36</a> /var/www/piwik/index.php(47): require_once('/var/www/piwik/...')
<a href='/37'>#37</a> {main}<a href='/0'>#0</a> /var/www/piwik/core/Piwik.php(451): Piwik\Access->checkUserHasSuperUserAccess()
@tsteur commented on February 16th 2014 Owner

In 1238ea35c8329c90180431f6f387f77e04d003f1: refs #4679 splitted this method into 3 methods and extracted them into a model so we do not have to check for permission when archiving

@tsteur commented on February 16th 2014 Owner

In bf21210326aab3316b6e5cba8d9f2fb22042cf94: refs #4679 do not add any segments in case user does not have super user access

This Issue was closed on February 18th 2014
Powered by GitHub Issue Mirror