Update from 1.9.0 to 1.9.1 Error in core\ArchiveProcessing\Day.php

After Piwik instance was updated from 1.9.0 to 1.9.1, the following error messages are being displayed after the login.

Notice: Undefined offset: 1 in …\piwik\core\ArchiveProcessing\Day.php on line 906

Backtrace -->

#0 Piwik_ErrorHandler(…) called at […\piwik\core\ArchiveProcessing\Day.php:906]
#1 Piwik_ArchiveProcessing_Day->updateInterestStats(…) called at […\piwik\plugins\CustomVariables\CustomVariables.php:208]
#2 Piwik_CustomVariables->archiveDayAggregate(…) called at […\piwik\plugins\CustomVariables\CustomVariables.php:177]
#3 Piwik_CustomVariables->archiveDay(…) called at [:]
#4 call_user_func_array(…) called at […\piwik\libs\Event\Dispatcher.php:284]
#5 Event_Dispatcher->postNotification(…) called at […\piwik\core\PluginsManager.php:722]
#6 Piwik_PostEvent(…) called at […\piwik\core\ArchiveProcessing\Day.php:45]
#7 Piwik_ArchiveProcessing_Day->compute(…) called at […\piwik\core\ArchiveProcessing.php:498]
#8 Piwik_ArchiveProcessing->launchArchiving(…) called at […\piwik\core\Archive\Single.php:236]
#9 Piwik_Archive_Single->prepareArchive(…) called at […\piwik2\piwik\core\Archive\Array\IndexedBySite.php:192]
#10 Piwik_Archive_Array_IndexedBySite->getArchiveIdsAfterLaunching(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:131]
#11 Piwik_Archive_Array_IndexedBySite->loadValuesFromDB(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:108]
#12 Piwik_Archive_Array_IndexedBySite->getValues(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:73]
#13 Piwik_Archive_Array_IndexedBySite->getDataTableFromNumeric(…) called at […\piwik\plugins\MultiSites\API.php:192]
#14 Piwik_MultiSites_API->buildDataTable(…) called at […\piwik\plugins\MultiSites\API.php:112]
#15 Piwik_MultiSites_API->getAll(…) called at […\piwik\plugins\MultiSites\Controller.php:65]
#16 Piwik_MultiSites_Controller->getSitesInfo(…) called at […\piwik\plugins\MultiSites\Controller.php:36]
#17 Piwik_MultiSites_Controller->index(…) called at [:]
#18 call_user_func_array(…) called at […\piwik\core\FrontController.php:138]
#19 Piwik_FrontController->dispatch(…) called at […\piwik\index.php:53]

There is series of similar error messages referring to the different line numbers in Day.php file [907, 923, 924, 925, 926 etc].

How can this error be fixed ?

Any updates ??? GeoIP plugin was earlier enabled but its disabled now.

Waiting for the updates to get this issue sorted out.

Thanking you in anticipation !!!

Surprising error! can you try the following patch:


--- core/ArchiveProcessing/Day.php	(revision 7348)
+++ core/ArchiveProcessing/Day.php	(revision )
@@ -903,6 +903,10 @@
 		}
 		if(!$doNotSumVisits)
 		{
+			if(!isset($newRowToAdd[Piwik_Archive::INDEX_NB_UNIQ_VISITORS])) {
+				echo 'Missing index for row:';
+				var_dump($newRowToAdd);
+			}
 			$oldRowToUpdate[Piwik_Archive::INDEX_NB_UNIQ_VISITORS]		+= $newRowToAdd[Piwik_Archive::INDEX_NB_UNIQ_VISITORS];
 			$oldRowToUpdate[Piwik_Archive::INDEX_NB_VISITS] 			+= $newRowToAdd[Piwik_Archive::INDEX_NB_VISITS];
 		}


it will then output some code on screen for the data that is causing trouble. can you please copy paste here or in pastebin?

Hi Matt,

Thanks for your response. The issue does not appeared yesterday while testing but its back again now. The same error message is there but the line number 907 is not there. The error message shows line number 910, 911, 927, 928, 929, 930 in piwik\core\ArchiveProcessing\Day.php file.

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

Notice: Undefined offset: 1 in …\piwik\core\ArchiveProcessing\Day.php on line 910

Backtrace -->

#0 Piwik_ErrorHandler(…) called at […\piwik\core\ArchiveProcessing\Day.php:910]
#1 Piwik_ArchiveProcessing_Day->updateInterestStats(…) called at […\piwik\plugins\CustomVariables\CustomVariables.php:208]
#2 Piwik_CustomVariables->archiveDayAggregate(…) called at […\piwik\plugins\CustomVariables\CustomVariables.php:177]
#3 Piwik_CustomVariables->archiveDay(…) called at [:]
#4 call_user_func_array(…) called at […\piwik\libs\Event\Dispatcher.php:284]
#5 Event_Dispatcher->postNotification(…) called at […\piwik\core\PluginsManager.php:722]
#6 Piwik_PostEvent(…) called at […\piwik\core\ArchiveProcessing\Day.php:45]
#7 Piwik_ArchiveProcessing_Day->compute(…) called at […\piwik\core\ArchiveProcessing.php:498]
#8 Piwik_ArchiveProcessing->launchArchiving(…) called at […\piwik\core\Archive\Single.php:236]
#9 Piwik_Archive_Single->prepareArchive(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:192]
#10 Piwik_Archive_Array_IndexedBySite->getArchiveIdsAfterLaunching(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:131]
#11 Piwik_Archive_Array_IndexedBySite->loadValuesFromDB(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:108]
#12 Piwik_Archive_Array_IndexedBySite->getValues(…) called at […\piwik\core\Archive\Array\IndexedBySite.php:73]
#13 Piwik_Archive_Array_IndexedBySite->getDataTableFromNumeric(…) called at […\piwik\plugins\MultiSites\API.php:192]
#14 Piwik_MultiSites_API->buildDataTable(…) called at […\piwik\plugins\MultiSites\API.php:112]
#15 Piwik_MultiSites_API->getAll(…) called at […\piwik\plugins\MultiSites\Controller.php:65]
#16 Piwik_MultiSites_Controller->getSitesInfo(…) called at […\piwik\plugins\MultiSites\Controller.php:36]
#17 Piwik_MultiSites_Controller->index(…) called at [:]
#18 call_user_func_array(…) called at […\piwik\core\FrontController.php:138]
#19 Piwik_FrontController->dispatch(…) called at […\piwik\index.php:53]

Please find the attached file having all the error messages and the screenshots which are being displayed.

Hope to hear from you soon. Thanking you in anticipation.

Thanks for the following up I still don’t understand. Is there no message “Missing index for row:” displayed on the screen?> please PM this post URL + bug descrpition + piwik url /login/pwd and i’ll take a look

Hi Matt,

No there is no message like “Missing index for row” being displayed. I have already attached the pdf and the screen shots having the error message details.

Please let me know if you want to have a look at any further files, I can attach that required files.

It would be really nice.

Thanks…

Hi Matt,

Undefinded Offsets in the following lines of piwik\core\ArchiveProcessing\Day.php file are being displayed.

910 $oldRowToUpdate[Piwik_Archive::INDEX_NB_UNIQ_VISITORS] += $newRowToAdd[Piwik_Archive::INDEX_NB_UNIQ_VISITORS];
911 $oldRowToUpdate[Piwik_Archive::INDEX_NB_VISITS] += $newRowToAdd[Piwik_Archive::INDEX_NB_VISITS];

927 $oldRowToUpdate[Piwik_Archive::INDEX_MAX_ACTIONS] = (float)max($newRowToAdd[Piwik_Archive::INDEX_MAX_ACTIONS], $oldRowToUpdate[Piwik_Archive::INDEX_MAX_ACTIONS]);
928 $oldRowToUpdate[Piwik_Archive::INDEX_SUM_VISIT_LENGTH] += $newRowToAdd[Piwik_Archive::INDEX_SUM_VISIT_LENGTH];
929 $oldRowToUpdate[Piwik_Archive::INDEX_BOUNCE_COUNT] += $newRowToAdd[Piwik_Archive::INDEX_BOUNCE_COUNT];
930 $oldRowToUpdate[Piwik_Archive::INDEX_NB_VISITS_CONVERTED] += $newRowToAdd[Piwik_Archive::INDEX_NB_VISITS_CONVERTED];

Can you please check these lines only the Undefinded Offset number along with the line number of Day.php file change. Rest all the line in Notice message are same i.e.

#0 Piwik_ErrorHandler(…) called at …\piwik\core\ArchiveProcessing\Day.php:928]
#1 Piwik_ArchiveProcessing_Day->updateInterestStats(…) called at …\piwik\plugins\CustomVariables\CustomVariables.php:208]
#2 Piwik_CustomVariables->archiveDayAggregate(…) called at …\piwik\plugins\CustomVariables\CustomVariables.php:177]
#3 Piwik_CustomVariables->archiveDay(…) called at [:]
#4 call_user_func_array(…) called at …\piwik\libs\Event\Dispatcher.php:284]
#5 Event_Dispatcher->postNotification(…) called at …\piwik\core\PluginsManager.php:722]
#6 Piwik_PostEvent(…) called at …\piwik\core\ArchiveProcessing\Day.php:45]
#7 Piwik_ArchiveProcessing_Day->compute(…) called at …\piwik\core\ArchiveProcessing.php:498]
#8 Piwik_ArchiveProcessing->launchArchiving(…) called at …\piwik\core\Archive\Single.php:236]
#9 Piwik_Archive_Single->prepareArchive(…) called at …\piwik\core\Archive\Array\IndexedBySite.php:192]
#10 Piwik_Archive_Array_IndexedBySite->getArchiveIdsAfterLaunching(…) called at …\piwik\core\Archive\Array\IndexedBySite.php:131]
#11 Piwik_Archive_Array_IndexedBySite->loadValuesFromDB(…) called at …\piwik\core\Archive\Array\IndexedBySite.php:108]
#12 Piwik_Archive_Array_IndexedBySite->getValues(…) called at …\piwik\core\Archive\Array\IndexedBySite.php:73]
#13 Piwik_Archive_Array_IndexedBySite->getDataTableFromNumeric(…) called at …\piwik\plugins\MultiSites\API.php:192]
#14 Piwik_MultiSites_API->buildDataTable(…) called at …\piwik\plugins\MultiSites\API.php:112]
#15 Piwik_MultiSites_API->getAll(…) called at …\piwik\plugins\MultiSites\Controller.php:65]
#16 Piwik_MultiSites_Controller->getSitesInfo(…) called at …\piwik\plugins\MultiSites\Controller.php:36]
#17 Piwik_MultiSites_Controller->index(…) called at [:]
#18 call_user_func_array(…) called at …\piwik\core\FrontController.php:138]
#19 Piwik_FrontController->dispatch(…) called at …\piwik\index.php:53]

I have attached another screen shot [attachment 968 piwik_error3.JPG]. This time the notice message was Visitor Location [Country].

Please check.

Thanks.

Can you please email ftp access + piwik url + login + pwd + URL to this forum post by email or PM ? I’ll take a look

Hi,

I’m having this issue right now with 1.11.1, in the same lines:

in the new day.php file the numbers are:

905, 906, 922, 923, 924, 925

this was fixed?

can you try with the latest beta from: Index of /

[quote=matt]
can you try with the latest beta from: Index of /

I will try it…

is there any issue if I just replace the Day.php from the beta?

[quote=khrizart]

[quote=matt]
can you try with the latest beta from: Index of /

I will try it…

is there any issue if I just replace the Day.php from the beta?[/quote]

I just did it, I replace the Day.php file from the last beta 1.12-b11 and works, I don’t have the issue any more…

thanks.