@Findus23 opened this Issue on May 7th 2018 Member

This could be related to https://github.com/matomo-org/matomo/issues/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' 
.<a href='/0'>#0</a> /home/lukas/public_html/matomocopy/plugins/SitesManager/API.php(222): Piwik\\Site::setSiteFromArray(1, false)
<a href='/1'>#1</a> /home/lukas/public_html/matomocopy/core/Site.php(73): Piwik\\Plugins\\SitesManager\\API-&gt;getSiteFromId(1)
<a href='/2'>#2</a> /home/lukas/public_html/matomocopy/plugins/Live/Model.php(298): Piwik\\Site-&gt;__construct(Array)
<a href='/3'>#3</a> /home/lukas/public_html/matomocopy/plugins/Live/Model.php(335): Piwik\\Plugins\\Live\\Model-&gt;makeSite(Array)
<a href='/4'>#4</a> /home/lukas/public_html/matomocopy/plugins/Live/Model.php(244): Piwik\\Plugins\\Live\\Model-&gt;getWhereClauseAndBind('log_visit.idsit...', Array, Array, 'range', '1998-01-01,toda...', false, false)
<a href='/5'>#5</a> /home/lukas/public_html/matomocopy/plugins/Live/Model.php(39): Piwik\\Plugins\\Live\\Model-&gt;makeLogVisitsQueryString(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', 0, 401, false, false, '')
<a href='/6'>#6</a> /home/lukas/public_html/matomocopy/plugins/Live/API.php(396): Piwik\\Plugins\\Live\\Model-&gt;queryLogVisits(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', 0, 401, false, false, '')
<a href='/7'>#7</a> /home/lukas/public_html/matomocopy/plugins/Live/API.php(181): Piwik\\Plugins\\Live\\API-&gt;loadLastVisitorDetailsFromDatabase(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', 0, 401, false, '', false)
<a href='/8'>#8</a> [internal function]: Piwik\\Plugins\\Live\\API-&gt;getLastVisitsDetails(Array, 'range', '1998-01-01,toda...', 'countryCode%3D%...', false, false, false, '1')
<a href='/9'>#9</a> /home/lukas/public_html/matomocopy/core/API/Proxy.php(236): call_user_func_array(Array, Array)
<a href='/10'>#10</a> /home/lukas/public_html/matomocopy/core/API/Request.php(253): Piwik\\API\\Proxy-&gt;call('\\\\Piwik\\\\Plugins\\\\...', 'getLastVisitsDe...', Array)
<a href='/11'>#11</a> /home/lukas/public_html/matomocopy/plugins/API/Controller.php(41): Piwik\\API\\Request-&gt;process()
<a href='/12'>#12</a> [internal function]: Piwik\\Plugins\\API\\Controller-&gt;index()
<a href='/13'>#13</a> /home/lukas/public_html/matomocopy/core/FrontController.php(559): call_user_func_array(Array, Array)
<a href='/14'>#14</a> /home/lukas/public_html/matomocopy/core/FrontController.php(137): Piwik\\FrontController-&gt;doDispatch('API', false, Array)
<a href='/15'>#15</a> /home/lukas/public_html/matomocopy/core/dispatch.php(34): Piwik\\FrontController-&gt;dispatch()
<a href='/16'>#16</a> /home/lukas/public_html/matomocopy/index.php(27): require_once('/home/lukas/pub...')
<a href='/17'>#17</a> {main}"

Quick debugging show that $infoSite is empty here:
https://github.com/matomo-org/matomo/blob/7cf4525d2c241b382964ceb8ab7ffa7deeb6b991/core/Site.php#L142

@tsteur commented on May 7th 2018 Member

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 commented on May 7th 2018 Member

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 https://github.com/matomo-org/matomo/issues/12312

This Issue was closed on May 8th 2018
Powered by GitHub Issue Mirror