Error in CustomReports after upgrade

We just upgraded to the latest versions of Matomo (5.3.1) and the CustomReportsPlugin (5.3.3) and now the following warning appears 10 times when going to settings:

WARNING: /plugins/CustomReports/Dao/CustomReportsDao.php(325): Warning - Undefined array key "multiple_idsites" - Matomo 5.3.1 - Please report this message in the Matomo forums: (please do a search first as it might have been reported already) (Module: API, Action: getEvolutionGraph, Method: CustomReports.getConfiguredReports, In CLI mode: false)

Hi @johannes.med . I’m sorry to hear that you’re experiencing this issue. It looks like the multiple_idsites column should have been added by the migration script as part of the 5.2.0 release of the plugin. Did you run the core:update console command or run the database updates via the UI after the upgrade? If you need to add the column manually, you can use the following SQL:

ALTER TABLE `custom_reports`
ADD `multiple_idsites` VARCHAR(2000) NULL;

If you use a prefix in your database, you’ll need to adjust the table name accordingly.

Thanks Jacob, that statement fixed the warnings :+1: We used the UI for the upgrade.

@jacobr hope it’s OK to just add this in here, but it seems somewhat related it’s also a database migration issue during the same upgrade. I noticed that our archive job has been failing with this error:

Error: Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=3&period=day&date=2025-05-12&format=json&trigger=archivephp. Response was '{“result”:“error”,“message”:"Mysqli prepare error: Unknown column ‘created_time’ in ‘field list’ - in plugin Funnels

Is there a way to check what fields are missing in our database? Or a script to manually execute to conditionally add all missing fields?

Thanks in advance for your help!

Hi @johannes.med . It’s also related to a migration (database change) which wasn’t executed for some reason. The create_time column was added to Funnels by the 5.0.0 release of the plugin, so the associated migration must have somehow been skipping when upgrading from Matomo 4. You can add the column manually using the following:

ALTER TABLE `log_funnel` ADD `created_time` DATETIME NOT NULL;

If you use a prefix in your database, you’ll need to adjust the table name accordingly.

I’m not aware of any way to do a system-wide check for missing columns. If the installed version of the plugin is updated in the database, the system assumes that any associated migrations have been executed. You might be able to export your database schema and the schema of the database from a fresh Matomo install and use mysqldiff or something similar to find the differences.

Thanks for the help, that fixed the issue. Then I’ll just see if anything pops up, but looks good for now :+1: