Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDPR tool doesn't work when selecting all websites #12842

Closed
Findus23 opened this issue May 7, 2018 · 2 comments · Fixed by #12854
Closed

GDPR tool doesn't work when selecting all websites #12842

Findus23 opened this issue May 7, 2018 · 2 comments · Fixed by #12854
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@Findus23
Copy link
Member

Findus23 commented May 7, 2018

This could be related to #12312

The API-URL the tool tries to access is
index.php?date=1998-01-01,today&doNotFetchActions=1&filter_limit=401&format=JSON2&idSite=all&method=Live.getLastVisitsDetails&module=API&period=range&segment=countryCode%3D%3DDE

"An unexpected website was found in the request: website id was set to '1' 
.#0 /home/lukas/public_html/matomocopy/plugins/SitesManager/API.php(222): Piwik\\Site::setSiteFromArray(1, false)
#1 /home/lukas/public_html/matomocopy/core/Site.php(73): Piwik\\Plugins\\SitesManager\\API->getSiteFromId(1)
#2 /home/lukas/public_html/matomocopy/plugins/Live/Model.php(298): Piwik\\Site->__construct(Array)
#3 /home/lukas/public_html/matomocopy/plugins/Live/Model.php(335): Piwik\\Plugins\\Live\\Model->makeSite(Array)
#4 /home/lukas/public_html/matomocopy/plugins/Live/Model.php(244): Piwik\\Plugins\\Live\\Model->getWhereClauseAndBind('log_visit.idsit...', Array, Array, 'range', '1998-01-01,toda...', false, false)
#5 /home/lukas/public_html/matomocopy/plugins/Live/Model.php(39): Piwik\\Plugins\\Live\\Model->makeLogVisitsQueryString(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', 0, 401, false, false, '')
#6 /home/lukas/public_html/matomocopy/plugins/Live/API.php(396): Piwik\\Plugins\\Live\\Model->queryLogVisits(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', 0, 401, false, false, '')
#7 /home/lukas/public_html/matomocopy/plugins/Live/API.php(181): Piwik\\Plugins\\Live\\API->loadLastVisitorDetailsFromDatabase(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', 0, 401, false, '', false)
#8 [internal function]: Piwik\\Plugins\\Live\\API->getLastVisitsDetails(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', false, false, false, '1')
#9 /home/lukas/public_html/matomocopy/core/API/Proxy.php(236): call_user_func_array(Array, Array)
#10 /home/lukas/public_html/matomocopy/core/API/Request.php(253): Piwik\\API\\Proxy->call('\\\\Piwik\\\\Plugins\\\\...', 'getLastVisitsDe...', Array)
#11 /home/lukas/public_html/matomocopy/plugins/API/Controller.php(41): Piwik\\API\\Request->process()
#12 [internal function]: Piwik\\Plugins\\API\\Controller->index()
#13 /home/lukas/public_html/matomocopy/core/FrontController.php(559): call_user_func_array(Array, Array)
#14 /home/lukas/public_html/matomocopy/core/FrontController.php(137): Piwik\\FrontController->doDispatch('API', false, Array)
#15 /home/lukas/public_html/matomocopy/core/dispatch.php(34): Piwik\\FrontController->dispatch()
#16 /home/lukas/public_html/matomocopy/index.php(27): require_once('/home/lukas/pub...')
#17 {main}"

Quick debugging show that $infoSite is empty here:

if (empty($idSite) || empty($infoSite)) {

@Findus23 Findus23 added the Bug For errors / faults / flaws / inconsistencies etc. label May 7, 2018
@Findus23 Findus23 added this to the 3.5.0 milestone May 7, 2018
@tsteur
Copy link
Member

tsteur commented May 7, 2018

As mentioned in check I recommend you check if $_POST['token_auth'] is set. Depending on the size of the request etc this might not be set.

@Findus23
Copy link
Member Author

Findus23 commented May 7, 2018

I don't think it is the POST size as the POST data only consists of the token_auth (I am talking about the first request fetching the list, not the request actually exporting/deleting the data)

grafik

This can even be reproduced by making a GET to http://localhost/matomocopy/index.php?module=API&method=Live.getLastVisitsDetails&idSite=all&period=month&date=today&format=JSON&token_auth=dfa[...]de without the GDPR tool which makes me think it is the same issue as #12312

tsteur added a commit that referenced this issue May 8, 2018
fix #12842

I would assume this change fixes the issue. In theory it should still work even without this change and it usually does (cause it would use the first siteId within the list). It would be interesting to see what the `site` and `access` table on this instance looks like.

Update: I can think of an error when idSite 1 was deleted see https://3v4l.org/gEvUb 

So this change likely fixes it.
@tsteur tsteur self-assigned this May 8, 2018
mattab pushed a commit that referenced this issue May 8, 2018
fix #12842

I would assume this change fixes the issue. In theory it should still work even without this change and it usually does (cause it would use the first siteId within the list). It would be interesting to see what the `site` and `access` table on this instance looks like.

Update: I can think of an error when idSite 1 was deleted see https://3v4l.org/gEvUb 

So this change likely fixes it.
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label May 8, 2018
@mattab mattab removed the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Aug 28, 2018
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this issue Oct 11, 2018
fix matomo-org#12842

I would assume this change fixes the issue. In theory it should still work even without this change and it usually does (cause it would use the first siteId within the list). It would be interesting to see what the `site` and `access` table on this instance looks like.

Update: I can think of an error when idSite 1 was deleted see https://3v4l.org/gEvUb 

So this change likely fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants