Undefined index: location_region visitor.php:203


#1

Hi.
I just upgraded from v. 1.x.x (I think it was 1.8.9)

Now when visiting the piwik i get an error in module: Visitors in real-time

Error is:

There is an error. Please report the message (Piwik 2.0.3) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).

Notice: Undefined index: location_region in /var/www/vhosts/tmj.dk/piwik/plugins/Live/Visitor.php on line 302

Backtrace -->

#0 Piwik\Error::errorHandler(…) called at [/var/www/vhosts/tmj.dk/piwik/plugins/Live/Visitor.php:302]
#1 Piwik\Plugins\Live\Visitor->getRegionCode(…) called at [/var/www/vhosts/tmj.dk/piwik/plugins/Live/Visitor.php:292]
#2 Piwik\Plugins\Live\Visitor->getRegionName(…) called at [/var/www/vhosts/tmj.dk/piwik/plugins/Live/Visitor.php:98]
#3 Piwik\Plugins\Live\Visitor->getAllVisitorDetails(…) called at [/var/www/vhosts/tmj.dk/piwik/plugins/Live/API.php:555]
#4 Piwik\Plugins\Live{closure}(…) called at [:]
#5 call_user_func_array(…) called at [/var/www/vhosts/tmj.dk/piwik/core/DataTable.php:411]
#6 Piwik\DataTable->filter(…) called at [/var/www/vhosts/tmj.dk/piwik/core/DataTable.php:456]
#7 Piwik\DataTable->applyQueuedFilters(…) called at [/var/www/vhosts/tmj.dk/piwik/core/API/ResponseBuilder.php:319]
#8 Piwik\API\ResponseBuilder->handleDataTable(…) called at [/var/www/vhosts/tmj.dk/piwik/core/API/ResponseBuilder.php:90]
#9 Piwik\API\ResponseBuilder->getResponse(…) called at [/var/www/vhosts/tmj.dk/piwik/core/API/Request.php:222]
#10 Piwik\API\Request->process(…) called at [/var/www/vhosts/tmj.dk/piwik/plugins/Live/Controller.php:115]
#11 Piwik\Plugins\Live\Controller->getLastVisitsStart(…) called at [/var/www/vhosts/tmj.dk/piwik/plugins/Live/Controller.php:41]
#12 Piwik\Plugins\Live\Controller->widget(…) called at [:]
#13 call_user_func_array(…) called at [/var/www/vhosts/tmj.dk/piwik/core/FrontController.php:117]
#14 Piwik\FrontController->dispatch(…) called at [/var/www/vhosts/tmj.dk/piwik/index.php:62]


#2

When changing from one website that is monitored to ‘All websites’ i get this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘log_visit.location_region’ in ‘field list’

Guess my database is not correctly updated.
How to perform upgrade fix ?


(Matthieu Aubry) #3

These new fields were in the update for 1.9 see: matomo/1.9-b9.php at master · matomo-org/matomo · GitHub

Here is how you can re-run the update: Update - Analytics Platform - Matomo


#4

Thanks - I ran the SQL update commands from phpmyadmin and now it Works. THANKS

Commands executes:

Note: if you manually execute these queries, it is expected that some of them fail. In this case, simply ignore the errors, and run the next ones in the list.

ALTER TABLE piwik_logger_message ADD COLUMN tag VARCHAR(50) NULL AFTER idlogger_message; 
ALTER TABLE piwik_logger_message ADD COLUMN level TINYINT AFTER timestamp; 
ALTER TABLE piwik_logger_message MODIFY level VARCHAR(16) NULL; 
UPDATE `piwik_archive_numeric_2012_01` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2012_10` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2012_11` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2012_12` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_01` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_02` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_03` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_04` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_05` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_06` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_07` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_08` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_09` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_10` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_11` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2013_12` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2014_01` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_numeric_2014_02` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2012_01` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2012_10` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2012_11` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2012_12` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_01` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_02` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_03` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_04` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_05` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_06` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_07` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_08` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_09` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_10` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_11` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2013_12` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2014_01` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_archive_blob_2014_02` SET `name`=REPLACE(`name`, 'Referers_', 'Referrers_') WHERE `name` LIKE 'Referers_%'; 
UPDATE `piwik_segment` SET `definition`=REPLACE(`definition`, 'referer', 'referrer') WHERE `definition` LIKE '%referer%'; 
UPDATE `piwik_report` SET `reports`=REPLACE(`reports`, 'Referer', 'Referrer') WHERE `reports` LIKE '%Referer%'; 
UPDATE `piwik_user_dashboard` SET `layout`=REPLACE(`layout`, 'Referer', 'Referrer') WHERE `layout` LIKE '%Referer%';

#5

Can be closed.


#6

Closed