One site in multisite is corrupted

We run Piwik in a Wordpress multisite installation and it works fine for all of our blogs. Except for one. One blog is showing no data for past week, yet when I look at the Piwik dashboard, I see it showing ONLY visitors in real time. But all the other boxes are empty – keywords, websites, browsers, visitor map, etc.

Here’s a snippet from the archiving cronjob run once an hour. Site 307 is a normal site with normal stats. Site 308 is the site with no data showing (even though the real-time stats box in Piwik is showing 117 visits at the moment – so definitely people visiting and piwik is recording it):

INFO [2017-10-31 19:07:36] Archived website id = 307, period = day, 0 segments, 41 visits in last 2 days, 16 visits today, Time elapsed: 0.589s
INFO [2017-10-31 19:07:36] Will pre-process for website id = 307, period = week, date = last2
INFO [2017-10-31 19:07:36] - pre-processing all visits
INFO [2017-10-31 19:07:37] Archived website id = 307, period = week, 0 segments, 184 visits in last 2 weeks, 41 visits this week, Time elapsed: 0.980s
INFO [2017-10-31 19:07:37] Will pre-process for website id = 307, period = month, date = last2
INFO [2017-10-31 19:07:37] - pre-processing all visits
INFO [2017-10-31 19:07:39] Archived website id = 307, period = month, 0 segments, 1271 visits in last 2 months, 614 visits this month, Time elapsed: 1.654s
INFO [2017-10-31 19:07:39] Will pre-process for website id = 307, period = year, date = last2
INFO [2017-10-31 19:07:39] - pre-processing all visits
INFO [2017-10-31 19:07:42] Archived website id = 307, period = year, 0 segments, 46669 visits in last 2 years, 8583 visits this year, Time elapsed: 2.797s
INFO [2017-10-31 19:07:42] Will pre-process for website id = 307, period = range, date = previous7
INFO [2017-10-31 19:07:42] - pre-processing all visits
INFO [2017-10-31 19:07:42] Archived website id = 307, period = range, 0 segments, 143 visits in previous 7 ranges, 143 visits this range, Time elapsed: 0.275s
INFO [2017-10-31 19:07:42] Archived website id = 307, 5 API requests, Time elapsed: 6.301s [307/371 done]
INFO [2017-10-31 19:07:42] Day has finished for website id 308 since last run
INFO [2017-10-31 19:07:42] Will pre-process for website id = 308, period = day, date = last52
INFO [2017-10-31 19:07:42] - pre-processing all visits
INFO [2017-10-31 19:07:44] Day has finished for website id 309 since last run

Piwik is inserted automatically into the footer of all blogs in our Wordpress multisite install using the standard “Default tracking” code. All the sites are using the exact same templates. There’s nothing special about this site, except that Piwik seems to have some corrupted data regarding this site…

Is there any way to reset Piwik for just this one site? Or some other method used to troubleshoot the site? There’s nothing in the error logs for the server. I’m at a loss on how to resolve this issue…

Thanks!

This has shown up in the error_log of PHP. I have the timeout set for something like 4 minutes currently… Should I raise this value even higher?

Is there some command line utility where I can get piwik to process just this one site, no matter how long it takes?

It may not be corrupted data, just a really, really large dataset that piwik is choking on. There must be some way to process this…

/usr/bin/php /home/piwik/public_html/console core:archive --url=https://somewhere.com/ > /home/piwik/piwik-arch.log
ERROR [2017-11-02 12:32:47] Empty or invalid response ‘Got invalid response from API request: https://somewhere.com/?module=API&method=API.get&idSite=308&period=day&date=last52&format=php&trigger=archivephp&token_auth=removed. Response was ‘curl_exec: Empty reply from server. Hostname requested was: somewhere.com’’ for website id 308, Time elapsed: 1.598s, skipping

When I try and access the URL directly through Lynx, I get this:

Looking up somewhere.com
Making HTTPS connection to somewhere.com
Verified connection to somewhere.com (cert=somewhere.com)
Secure 256-bit TLSv1/SSLv3 (ECDHE-RSA-AES256-GCM-SHA384) HTTP connection
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
Can’t Access `https://somewhere.com/?module=API&method=API.get&idSite=308&period=day&date=last52&format=php&trigger=archivephp&token_auth=auth-token-here’
Alert!: Unable to access document.

lynx: Can’t access startfile (just to be clear, I do use my actual auth token in the URL above, but removed it from this)

The weird thing, I don’t get this error for any other site. All other sites generate a proper JSON response back. Something is being spit out for this particular site that can’t be processed.

If I delete this site in Piwik’s dashboard, will the Piwik plugin in Wordpress attempt to recreate it? Maybe that’s the way to go in solving this problem?

I ended up just doing this for this one site:

https://piwik.org/faq/how-to/faq_73/

deleting all of the suspected corrupted data or the data the site was choking on for the last month or two.