Skip to content

SegmentEditor API throws NoAccessException #4679

@sgiehl

Description

@sgiehl

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:


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor errors / faults / flaws / inconsistencies etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions