@jbrule opened this Issue on July 13th 2020

When archiving via cron we keep getting this message about website 115. It looks like it has been deleted and no longer exists in Matomo. Other various sites have been deleted but do not cause such an error. Any ideas?

INFO [2020-07-07 16:35:31] 47726  Archived website id = 3690, period = day, 0 segments, 133483 visits in last 52 days, 1979 visits today, Time elapsed: 5.569s
INFO [2020-07-07 16:35:31] 47726  - Will invalidate archived reports for 2020-03-10 for following websites ids: 115
INFO [2020-07-07 16:35:31] 47726  Failed to invalidate archived reports: An unexpected website was found in the request: website id was set to '115' .
INFO [2020-07-07 16:35:31] 47726  Will pre-process for website id = 3690, period = week, date = last2
INFO [2020-07-07 16:35:31] 47726  - pre-processing all visits
INFO [2020-07-07 16:35:32] 47726  Archived website id = 3690, period = week, 0 segments, 22694 visits in last 2 weeks, 5651 visits this week, Time elapsed: 1.659s
INFO [2020-07-07 16:35:33] 47726  - Will invalidate archived reports for 2020-03-10 for following websites ids: 115
INFO [2020-07-07 16:35:33] 47726  Failed to invalidate archived reports: An unexpected website was found in the request: website id was set to '115' .
INFO [2020-07-07 16:35:33] 47726  Will pre-process for website id = 3690, period = month, date = last2
INFO [2020-07-07 16:35:33] 47726  - pre-processing all visits
INFO [2020-07-07 16:35:35] 47726  Archived website id = 3690, period = month, 0 segments, 98786 visits in last 2 months, 15035 visits this month, Time elapsed: 2.462s
INFO [2020-07-07 16:35:35] 47726  - Will invalidate archived reports for 2020-03-10 for following websites ids: 115
INFO [2020-07-07 16:35:35] 47726  Failed to invalidate archived reports: An unexpected website was found in the request: website id was set to '115' .
INFO [2020-07-07 16:35:35] 47726  Will pre-process for website id = 3690, period = year, date = last2
INFO [2020-07-07 16:35:35] 47726  - pre-processing all visits
INFO [2020-07-07 16:35:37] 47726  Archived website id = 3690, period = year, 0 segments, 396869 visits in last 2 years, 396532 visits this year, Time elapsed: 2.620s
INFO [2020-07-07 16:35:38] 47726  - Will invalidate archived reports for 2020-03-10 for following websites ids: 115
INFO [2020-07-07 16:35:38] 47726  Failed to invalidate archived reports: An unexpected website was found in the request: website id was set to '115' .
INFO [2020-07-07 16:35:38] 47726  Will pre-process for website id = 3690, period = range, date = last6
INFO [2020-07-07 16:35:38] 47726  - pre-processing all visits
INFO [2020-07-07 16:35:39] 47726  Archived website id = 3690, period = range, 0 segments, 0 visits in last 30 ranges, 0 visits this range, Time elapsed: 1.606s
INFO [2020-07-07 16:35:39] 47726  - Will invalidate archived reports for 2020-03-10 for following websites ids: 115
INFO [2020-07-07 16:35:39] 47726  Failed to invalidate archived reports: An unexpected website was found in the request: website id was set to '115' .
INFO [2020-07-07 16:35:39] 47726  Will pre-process for website id = 3690, period = range, date = last7
INFO [2020-07-07 16:35:39] 47726  - pre-processing all visits
INFO [2020-07-07 16:35:40] 47726  Archived website id = 3690, period = range, 0 segments, 16966 visits in last 7 ranges, 16966 visits this range, Time elapsed: 0.980s
INFO [2020-07-07 16:35:40] 47726  Archived website id = 3690, 6 API requests, Time elapsed: 14.901s [1539/1546 done]
@tsteur commented on July 13th 2020 Member

@jbrule can you double check you're not calling the archive using some force-idsites parameter like --force-idsites=115,...? Can you share any other parameter that is being used when running core:archive?

@jbrule commented on July 14th 2020

Nope nothing like that. This is my complete cron entry

0 */4 * * *         cd /var/www/production/matomo && scl enable rh-php72 "./console core:archive --url=https://webanalytics.****.edu/matomo" >> /var/www/production/logs/archive.log 2>&1
@tsteur commented on July 14th 2020 Member

If you have database access can you run a SQL query like this:

select * from matomo_option where option_name like '%SharedSiteIdsToArchive%'

and check if the mentioned idSite is set there and remove it? Also can you double check the site is really removed by executing the query below?

select * from matomo_site where idsite = 115

You might need to rename the table prefix from matomo_ to your table prefix.

@jbrule commented on July 14th 2020

select * from piwik_option where option_name like '%SharedSiteIdsToArchive%' No rows returned

select * from piwik_site where idsite = 115 No rows returned

@tsteur commented on July 14th 2020 Member

Thanks @jbrule very appreciated. Starting to understand things better.

Can you also run this query and check if there's anything related to 115?

select * from matomo_option where option_name like '%report_to_invalidate_%'
@jbrule commented on July 16th 2020

select * from piwik_option where option_name like '%report_to_invalidate_%'

"option_name","option_value","autoload"
"report_to_invalidate_115_2020-03-10_46451",1,0
@tsteur commented on July 16th 2020 Member

Could you delete this entry? that seems to be causing the issue. We'll need to check if these entries already get deleted when deleting a site.

@tsteur commented on July 16th 2020 Member

I just checked we are already deleting this entry when a site is deleted. There must have been a race condition. I'll keep this issue open to eventually look if we can have some additional cleanup script or some other way to prevent this.

Anyone reading this:

The workaround is to run a query like this:

delete from `matomo_option` where option_name like '%report_to_invalidate_IDSITE_%'

Where you need to replace IDSITE with the number of the idSite that is causing issues and matomo_ may need to be replaced with the actual table prefix. For example piwik_option or just option.

@jbrule commented on July 17th 2020

Resolved: I removed the (previously mentioned) row from piwik_options and the warning is no longer present when archiving.

Powered by GitHub Issue Mirror