Frequent 400 errors after upgrading to 3.13.3

After updating to 3.13.3 we are seeing many 400 errors in the browser console. On the Matomo server, we see this error repeatedly in the log:

AH01071: Got error 'PHP message: Error in Matomo (tracker): Error query: preparing query failed: Unknown column ‘time_spent’ in ‘field list’ : UPDATE matomo_log_link_visit_action SET time_spent = ? WHERE idlink_va = ? In query: UPDATE matomo_log_link_visit_action SET time_spent = ? WHERE idlink_va = ?

Looking at the table schema, I can see there is no column named ‘time_spent’ in that table.

I followed the procedure here to ensure that the upgrade was performed completely, and I’m still seeing errors:

https://matomo.org/faq/how-to-update/faq_179/

Please advise.

Grepping through the code, the error seems to originate here:

./plugins/CustomDimensions/Tracker/CustomDimensionsRequestProcessor.php: $model->updateAction($lastIdLinkVa, array(‘time_spent’ => $timeSpent));

It seems that the CustomDimensions plugin is supposed to add the ‘time_spent’ column as part of its “install” routine. We’re running the latest release of that plugin (3.1.9), and I’ve deactivated/reactivated the plugin but we’re still missing the ‘time_spent’ column in that table.