Prevent "An unexpected website was found in the request" in the logs

I regularly see entries like the following in /var/log/php.log:
Error in Matomo (tracker): An unexpected website was found in the request: website id was set to '24' .

This is rather annoying as it doesn’t state which domain was using this id before. So, this should either be left out completely or entries from the table “site” shouldn’t be deleted. Delete corresponding data in other tables, but not that record itself, just add a field “deleted” and set that to “true”.

This would also prevent having users asking for help about those messages.

Lars
PS: Using the latest Matomo 4.2.1

1 Like

This still seems to be a thing unfortunately. I deleted some old websites and not only logs, but some of the dashboard views like “Visits over time” and “Visits overview” are now broken with a big red error due to the deleted websites…
i guess solution so far is to keep those id’s populated in the db…
Using Matomo 5.1.2

Hi @Alexander_Miu
In this case, can you see the generated error log in the Matomo errors log file? If this is the same as @larsen, I think you can create an issue at: