Since 4.12 update, we're seeing "PHP notice: Undefined index: excluded_referrers"

Hi,

since the 4.12 update, we’re getting the following notice both in the PHP log and from one of our cronjobs:

PHP Notice: Undefined index: excluded_referrers in /tools/piwik/piwik-4.12.1/plugins/SitesManager/SitesManager.php on line 320

2022-10-25 00:02:07,808: [INFO] bulk tracking returned invalid JSON
2022-10-25 00:02:07,808: [INFO] tracker response:
<br />
<b>Notice</b>:  Undefined index: excluded_referrers in
<b>/tools/piwik/piwik-4.12.1/plugins/SitesManager/SitesManager.php</b>
on line <b>320</b><br />

I’m at a loss as to what could cause this. It seems the error stems from a Matomo PHP file (SitesManager.php). I gather excluded referrers are a new feature. I found no previous case of this problem on Google.

Could someone more knowledgeable than me take a look at this?

Sincerely,
Jonas

Hi,

Did you install 4.12 or 4.12.2?

Hi Philippe, I upgraded from 4.11.0 directly to 4.12.1. Right now we have version 4.12.1, and that’s the one producing the PHP notice. Do you think 4.12.2 might fix this?
Jonas

not sure, but I know there is several errors about referrers fixed in 4.12.1 and 4.12.2…

Then if the update to 4.12.2 is not sufficient, try to run, in command line:

core:update
1 Like

Hi,
the upate to 4.12.2 did not change anything - but the core:update did.

    Your Matomo database is out-of-date, and must be upgraded before you can continue.

    Matomo database will be upgraded from version 4.11.0 to the new version 4.12.2.

    The database upgrade process may take a while, so please be patient.

  Executing ALTER TABLE `piwik_site` ADD COLUMN `excluded_referrers` TEXT NOT NULL AFTER `excluded_user_agents`;... Done. [1 / 3]
  Executing ALTER TABLE `piwik_user` ADD UNIQUE KEY uniq_email (`email`);... Done. [2 / 3]
  Executing ALTER TABLE `piwik_user` ADD COLUMN `invite_link_token` VARCHAR(191) DEFAULT null;... Done. [3 / 3]

Matomo has been successfully updated!

It looks like there was a database update needed.

I’m pretty sure that the Matomo Web GUI did not display any “database update needed” message after the 4.12 update like it usually does.

We’ve had problems with missing database table updates in other Matomo installations just recently. I found myself manually repairing the database, adding missing fields about invites, which I believe was another recent feature.

I guess I will simply run core:update after every update in the future, then.

Thank you for your help Philippe!

Jonas

1 Like

Created: