Upgrade from 2.2.0 to 2.8.1. Piwik is not working


#1

Hello,

yesterday I upgraded my Piwik installation from 2.2.0 to 2.8.1. also updated php from 5.3.28 to 5.5.18.

It is a high traffic server with a total Db Size over 15GB. I added “record_statistics = 0” to the config file and started the automatic update process.
Database Upgrade was started from the shell.
The upgrade took nearly 2 hours and ended with “Piwik has been successfully updated!”

so I’m now running Piwik 2.8.1 on IIS7 with php 5.5.18.

but at the moment there is no data shown, the overview is empty.
There are Data in “Real Time Visitor Count”, “Visitors in Real-Time” or “Visitors->Visitor Log”, partly with Errors but it seems Piwik is tracking.


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

Notice: Undefined index: config_device_type in EXAMPLE\FILESYSTEM\webstat\app\plugins\DevicesDetection\DevicesDetection.php on line 49 

Backtrace -->

#0 Piwik\Error::errorHandler(...) called at [EXAMPLE\FILESYSTEM\webstat\app\plugins\DevicesDetection\DevicesDetection.php:49]
#1 Piwik\Plugins\DevicesDetection\DevicesDetection->extendVisitorDetails(...) called at [:]
#2 call_user_func_array(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\EventDispatcher.php:121]
#3 Piwik\EventDispatcher->postEvent(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\Piwik.php:678]
#4 Piwik\Piwik::postEvent(...) called at [EXAMPLE\FILESYSTEM\webstat\app\plugins\Live\Visitor.php:74]
#5 Piwik\Plugins\Live\Visitor->getAllVisitorDetails(...) called at [EXAMPLE\FILESYSTEM\webstat\app\plugins\Live\API.php:584]
#6 Piwik\Plugins\Live\API->Piwik\Plugins\Live\{closure}(...) called at [:]
#7 call_user_func_array(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\DataTable.php:408]
#8 Piwik\DataTable->filter(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\DataTable.php:453]
#9 Piwik\DataTable->applyQueuedFilters(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\API\ResponseBuilder.php:211]
#10 Piwik\API\ResponseBuilder->handleDataTable(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\API\ResponseBuilder.php:97]
#11 Piwik\API\ResponseBuilder->getResponse(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\API\Request.php:218]
#12 Piwik\API\Request->process(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\ViewDataTable\Request.php:48]
#13 Piwik\ViewDataTable\Request->loadDataTableFromAPI(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\Plugin\ViewDataTable.php:327]
#14 Piwik\Plugin\ViewDataTable->loadDataTableFromAPI(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\Plugin\Visualization.php:166]
#15 Piwik\Plugin\Visualization->buildView(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\Plugin\ViewDataTable.php:414]
#16 Piwik\Plugin\ViewDataTable->render(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\Plugin\Report.php:304]
#17 Piwik\Plugin\Report->render(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\Plugin\Controller.php:327]
#18 Piwik\Plugin\Controller->renderReport(...) called at [EXAMPLE\FILESYSTEM\webstat\app\plugins\Live\Controller.php:61]
#19 Piwik\Plugins\Live\Controller->indexVisitorLog(...) called at [:]
#20 call_user_func_array(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\FrontController.php:587]
#21 Piwik\FrontController->doDispatch(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\FrontController.php:95]
#22 Piwik\FrontController->dispatch(...) called at [EXAMPLE\FILESYSTEM\webstat\app\core\dispatch.php:34]
#23 require_once(...) called at [EXAMPLE\FILESYSTEM\webstat\app\index.php:46]

and there is also an error when I start the archive script from the console


ERROR CoreConsole[2014-10-22 08:19:31] [02138] Got invalid response from API request: http://www.example.com/webstat/app/index.php?module=API&method=API.get&idSite=1&period=day&date=last52&format=php&token_auth=TOKEN&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:83:"Mysqli prepare error: Unknown column 'log_visit.config_device_type' in 'field list'";}'
ERROR CoreConsole[2014-10-22 08:19:31] [02138] Empty or invalid response '' forwebsite id 1, Time elapsed: 2.808s, skipping
ERROR CoreConsole[2014-10-22 08:19:33] [02138] Got invalid response from API request: http://www.example.com/webstat/app/index.php?module=API&method=API.get&idSite=4&period=day&date=last52&format=php&token_auth=TOKEN&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:83:"Mysqli prepare error: Unknown column 'log_visit.config_device_type' in 'field list'";}'
...
...
...
ERROR CoreConsole[2014-10-22 08:21:51] [02138] Empty or invalid response '' for website id 48, Time elapsed: 2.870s, skipping
ERROR CoreConsole[2014-10-22 08:21:52] [02138] 42 total errors during this script execution, please investigate and try and fix these errors.

any help would be greatly appreciated! if you need more info please let me know.


(Matthieu Aubry) #2

can you try disable / enable the DeviceDetector plugin?

If that does not work, maybe just disable it for now, and it should restore your stats (after maybe a core:archive command execution )


#3

With disabled “DeviceDetector plugin” everything is working fine.

Thank you for your great piece of software and your greater support!
at the moment I’m reprocessign the past reports with no error.
50% done :slight_smile:


INFO CoreConsole[2014-10-23 13:02:54] [135f3] Archived website id = 1, period = day, 180 visits in last last2 days, 78 visits today, Time elapsed: 3.900s
INFO CoreConsole[2014-10-23 13:02:57] [135f3] Archived website id = 1, period = week, 1563 visits in last last3 weeks, 386 visits this week, Time elapsed: 2.870s
INFO CoreConsole[2014-10-23 13:03:04] [135f3] Archived website id = 1, period = month, 6226 visits in last last3 months, 1894 visits this month, Time elapsed: 7.504s
INFO CoreConsole[2014-10-23 13:26:09] [135f3] Archived website id = 1, period = year, 61652 visits in last last3 years, 22307 visits this year, Time elapsed: 1385.046s
INFO CoreConsole[2014-10-23 13:26:09] [135f3] Archived website id = 1, 4 API requests, Time elapsed: 1399.320s [1/40 done]
INFO CoreConsole[2014-10-23 13:26:13] [135f3] Archived website id = 4, period = day, 119 visits in last last2 days, 55 visits today, Time elapsed: 3.682s
INFO CoreConsole[2014-10-23 13:26:15] [135f3] Archived website id = 4, period = week, 790 visits in last last3 weeks, 237 visits this week, Time elapsed: 2.465s
INFO CoreConsole[2014-10-23 13:26:22] [135f3] Archived website id = 4, period = month, 3497 visits in last last3 months, 976 visits this month, Time elapsed: 6.490s
INFO CoreConsole[2014-10-23 13:44:02] [135f3] Archived website id = 4, period = year, 34090 visits in last last3 years, 13602 visits this year, Time elapsed: 1060.254s
INFO CoreConsole[2014-10-23 13:44:02] [135f3] Archived website id = 4, 4 API requests, Time elapsed: 1072.890s [2/40 done]
INFO CoreConsole[2014-10-23 13:44:04] [135f3] Archived website id = 11, period = day, 0 visits in last last2 days, 0 visits today, Time elapsed: 1.529s
INFO CoreConsole[2014-10-23 13:44:05] [135f3] Archived website id = 11, period = week, 0 visits in last last3 weeks, 0 visits this week, Time elapsed: 1.264s
INFO CoreConsole[2014-10-23 13:44:06] [135f3] Archived website id = 11, period = month, 2 visits in last last3 months, 0 visits this month, Time elapsed: 1.451s
INFO CoreConsole[2014-10-23 13:49:39] [135f3] Archived website id = 11, period = year, 59196 visits in last last3 years, 6 visits this year, Time elapsed: 332.405s
INFO CoreConsole[2014-10-23 13:49:39] [135f3] Archived website id = 11, 4 API requests, Time elapsed: 336.648s [3/40 done]
INFO CoreConsole[2014-10-23 13:49:42] [135f3] Archived website id = 12, period = day, 184 visits in last last2 days, 83 visits today, Time elapsed: 3.619s
INFO CoreConsole[2014-10-23 13:49:46] [135f3] Archived website id = 12, period = week, 1564 visits in last last3 weeks, 390 visits this week, Time elapsed: 3.292s
INFO CoreConsole[2014-10-23 13:49:57] [135f3] Archived website id = 12, period = month, 6226 visits in last last3 months, 1895 visits this month, Time elapsed: 11.263s
INFO CoreConsole[2014-10-23 14:05:33] [135f3] Archived website id = 12, period = year, 51953 visits in last last3 years, 22122 visits this year, Time elapsed: 935.953s
INFO CoreConsole[2014-10-23 14:05:33] [135f3] Archived website id = 12, 4 API requests, Time elapsed: 954.127s [4/40 done]
INFO CoreConsole[2014-10-23 14:05:36] [135f3] Archived website id = 13, period = day, 120 visits in last last2 days, 57 visits today, Time elapsed: 3.042s
INFO CoreConsole[2014-10-23 14:05:41] [135f3] Archived website id = 13, period = week, 1105 visits in last last4 weeks, 238 visits this week, Time elapsed: 5.413s
INFO CoreConsole[2014-10-23 14:06:38] [135f3] Archived website id = 13, period = month, 5110 visits in last last4 months, 976 visits this month, Time elapsed: 56.987s
INFO CoreConsole[2014-10-23 14:17:39] [135f3] Archived website id = 13, period = year, 32512 visits in last last4 years, 13466 visits this year, Time elapsed: 660.956s
INFO CoreConsole[2014-10-23 14:17:39] [135f3] Archived website id = 13, 4 API requests, Time elapsed: 726.398s [5/40 done]
INFO CoreConsole[2014-10-23 14:17:44] [135f3] Archived website id = 14, period = day, 246 visits in last last2 days, 132 visits today, Time elapsed: 4.196s
INFO CoreConsole[2014-10-23 14:17:50] [135f3] Archived website id = 14, period = week, 1921 visits in last last4 weeks, 493 visits this week, Time elapsed: 6.614s
INFO CoreConsole[2014-10-23 14:19:49] [135f3] Archived website id = 14, period = month, 7054 visits in last last4 months, 1744 visits this month, Time elapsed: 118.466s
INFO CoreConsole[2014-10-23 14:29:33] [135f3] Archived website id = 14, period = year, 19208 visits in last last4 years, 19084 visits this year, Time elapsed: 584.251s
INFO CoreConsole[2014-10-23 14:29:33] [135f3] Archived website id = 14, 4 API requests, Time elapsed: 713.528s [6/40 done]
INFO CoreConsole[2014-10-23 14:29:43] [135f3] Archived website id = 15, period = day, 2034 visits in last last2 days, 966 visits today, Time elapsed: 9.953s
INFO CoreConsole[2014-10-23 14:29:52] [135f3] Archived website id = 15, period = week, 19243 visits in last last4 weeks, 3978 visits this week, Time elapsed: 9.422s
INFO CoreConsole[2014-10-23 14:34:56] [135f3] Archived website id = 15, period = month, 83741 visits in last last4 months, 17133 visits this month, Time elapsed: 304.013s
INFO CoreConsole[2014-10-23 15:08:42] [135f3] Archived website id = 15, period = year, 782752 visits in last last4 years, 274618 visits this year, Time elapsed: 2025.395s
INFO CoreConsole[2014-10-23 15:08:42] [135f3] Archived website id = 15, 4 API requests, Time elapsed: 2348.783s [7/40 done]
INFO CoreConsole[2014-10-23 15:08:45] [135f3] Archived website id = 16, period = day, 1 visits in last last2 days, 1 visits today, Time elapsed: 3.245s
INFO CoreConsole[2014-10-23 15:08:47] [135f3] Archived website id = 16, period = week, 9 visits in last last2 weeks, 7 visits this week, Time elapsed: 2.527s
INFO CoreConsole[2014-10-23 15:08:52] [135f3] Archived website id = 16, period = month, 24 visits in last last2 months, 10 visits this month, Time elapsed: 4.290s
INFO CoreConsole[2014-10-23 15:08:55] [135f3] Archived website id = 16, period = year, 227 visits in last last2 years, 137 visits this year, Time elapsed: 3.448s
INFO CoreConsole[2014-10-23 15:08:55] [135f3] Archived website id = 16, 4 API requests, Time elapsed: 13.510s [8/40 done]
INFO CoreConsole[2014-10-23 15:09:02] [135f3] Archived website id = 17, period = day, 338 visits in last last2 days, 162 visits today, Time elapsed: 6.911s
INFO CoreConsole[2014-10-23 15:09:15] [135f3] Archived website id = 17, period = week, 3225 visits in last last4 weeks, 691 visits this week, Time elapsed: 12.932s
INFO CoreConsole[2014-10-23 15:12:21] [135f3] Archived website id = 17, period = month, 13707 visits in last last4 months, 2872 visits this month, Time elapsed: 185.515s
INFO CoreConsole[2014-10-23 15:32:33] [135f3] Archived website id = 17, period = year, 72707 visits in last last4 years, 40677 visits this year, Time elapsed: 1212.479s
INFO CoreConsole[2014-10-23 15:32:33] [135f3] Archived website id = 17, 4 API requests, Time elapsed: 1417.837s [9/40 done]
INFO CoreConsole[2014-10-23 15:32:35] [135f3] Archived website id = 18, period = day, 0 visits in last last2 days, 0 visits today, Time elapsed: 1.669s
INFO CoreConsole[2014-10-23 15:32:36] [135f3] Archived website id = 18, period = week, 0 visits in last last2 weeks, 0 visits this week, Time elapsed: 1.700s
INFO CoreConsole[2014-10-23 15:32:38] [135f3] Archived website id = 18, period = month, 0 visits in last last2 months, 0 visits this month, Time elapsed: 1.903s
INFO CoreConsole[2014-10-23 15:32:42] [135f3] Archived website id = 18, period = year, 121 visits in last last2 years, 22 visits this year, Time elapsed: 3.370s
INFO CoreConsole[2014-10-23 15:32:42] [135f3] Archived website id = 18, 4 API requests, Time elapsed: 8.642s [10/40 done]
INFO CoreConsole[2014-10-23 15:32:48] [135f3] Archived website id = 19, period = day, 377 visits in last last2 days, 158 visits today, Time elapsed: 6.568s
INFO CoreConsole[2014-10-23 15:32:58] [135f3] Archived website id = 19, period = week, 4621 visits in last last4 weeks, 793 visits this week, Time elapsed: 9.875s
INFO CoreConsole[2014-10-23 15:35:10] [135f3] Archived website id = 19, period = month, 19713 visits in last last4 months, 4133 visits this month, Time elapsed: 132.132s
INFO CoreConsole[2014-10-23 15:52:06] [135f3] Archived website id = 19, period = year, 71314 visits in last last4 years, 48799 visits this year, Time elapsed: 1015.856s
INFO CoreConsole[2014-10-23 15:52:06] [135f3] Archived website id = 19, 4 API requests, Time elapsed: 1164.431s [11/40 done]
INFO CoreConsole[2014-10-23 15:52:10] [135f3] Archived website id = 20, period = day, 76 visits in last last2 days, 34 visits today, Time elapsed: 4.196s
INFO CoreConsole[2014-10-23 15:52:16] [135f3] Archived website id = 20, period = week, 765 visits in last last4 weeks, 154 visits this week, Time elapsed: 5.881s


#4

all past reports are now processed :slight_smile:
had a few failures between with script execution timeout and memory limit.


INFO CoreConsole[2014-10-24 04:27:31] [2affe] Archived website id = 24, period = day, 26925 visits in last last2 days, 525 visits today, Time elapsed: 4.571s
ERROR CoreConsole[2014-10-24 05:00:30] [2affe] Got invalid response from API request: http://example.com/piwik/index.php?module=API&method=API.get&idSite=24&period=week&date=last207&format=php&token_auth=TOKEN&trigger=archivephp. Response was 'HTTP 500'

INFO CoreConsole[2014-10-24 06:29:02] [2affe] Archived website id = 33, period = week, 1484043 visits in last last234 weeks, 21994 visits this week, Time elapsed: 2613.033s
ERROR CoreConsole[2014-10-24 06:38:44] [2affe] Got invalid response from API request: http://example.com/piwik/index.php?module=API&method=API.get&idSite=33&period=month&date=last52&format=php&token_auth=TOKEN&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:71:"Out of memory (allocated 1914437632) (tried to allocate 14538386 bytes)";}'

INFO CoreConsole[2014-10-24 08:42:36] [3e762] Archived website id = 24, period = month, 9694704 visits in last last52 months, 524113 visits this month, Time elapsed: 106.922s
ERROR CoreConsole[2014-10-24 08:54:50] [3e762] Got invalid response from API request: http://example.com/piwik/index.php?module=API&method=API.get&idSite=24&period=year&date=last7&format=php&token_auth=TOKEN&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:71:"Out of memory (allocated 1718091776) (tried to allocate 51642503 bytes)";}'

configured the fastCGI settings on IIS7 with “Activity Timeout = 6000” (hat still timeouts with 3000sec) and start the archive script as follows (memory limit in php.ini is set to 2048M but this was not enough)


php.exe -d memory_limit=-1 "FILESYS\webstat\app\console" core:archive --url=http://example.com/piwik