Problem updating from Matomo 3.5.1 to 4.1.1 version

Hello,

I’m having problems updating the version of the Matomo installation I have on a server. I perform the procedure that is documented step by step:

  • Make backup of the database and files

  • Put in maintenance mode and disable the log tracker

  • Copy the Matomo 4.1.1 files in the path

  • Launch Matomo update by command line: php console core: update
    In this step, I get the error that I have to correct as the screenshot shows. I delete that file and run the update process again.
    After finishing the update process, it throws me the following message with the following error:

    [X] Error during plugin updates:

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’

    • /var/www/educacion/cau_ce/estadisticasweb/core/Columns/Updater.php:
      Error trying to execute the migration ‘ALTER TABLE piwik_log_visit MODIFY COLUMN visitor_count_visits INT(11) UNSIGNED NOT NULL DEFAULT 0, MODIFY COLUMN visit_total_interactions MEDIUMINT UNSIGNED DEFAULT 0, MODIFY COLUMN referer_name VARCHAR(255) NULL, MODIFY COLUMN referer_url VARCHAR(1500) NULL, MODIFY COLUMN config_browser_name VARCHAR(40) NULL, ADD COLUMN config_client_type TINYINT( 1 ) NULL DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL, MODIFY COLUMN location_region char(3) DEFAULT NULL;’.
      The error was: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_region’ in ‘piwik_log_visit’
      The update completed successfuly, however there were issues during the process. Please read the above descriptions for details. For further help:

    • Check the [ Matomo FAQ ] which explains most common errors during update.

    • Ask your system administrator - they may be able to help you with the error which is most likely related to your server or MySQL setup.

Matomo has been successfully updated!

It appears you have executed this update with user root:root, while your Matomo files are owned by apache:apache.

To ensure that the Matomo files are readable by the correct user, you may need to run the following command (or a similar command depending on your server configuration):

I can’t continue and it stays on that page that is still waiting for updates in the database.
I had to revert to the previous version to detect why it is giving that failure in the update.
Any idea why this bug?

Kind regards

Hi,

The last error sounds quite like

Could you try deleting the plugins\VisitTime\Columns\ServerTime.php file?

That’s what I did, delete that file and relaunch the update. All the steps indicated were executed, but at the end of the update process it informs me that the update has been done correctly but gives the errors commented on in the post when executing certain table modification sentences.