Page MenuHomePhabricator

Undefined offset: 3 in /data/project/heritage/heritage/api/includes/Statistics.php on line 112
Closed, ResolvedPublic

Description

Probably linked to the fixes to T135502

Notice: Undefined offset: 3 in /data/project/heritage/heritage/api/includes/Statistics.php on line 112

Call Stack:
    0.0116     668104   1. {main}() /data/project/heritage/heritage/api/api.php:0
    0.0966    1648256   2. ApiMain::dispatch() /data/project/heritage/heritage/api/api.php:36
    0.1174    1956560   3. ApiMonuments->executeModule() /data/project/heritage/heritage/api/includes/ApiMain.php:39
    0.1415    2201328   4. ApiMonuments->statistics_db() /data/project/heritage/heritage/api/includes/ApiMonuments.php:75
    0.1423    2203664   5. Statistics->retrieveReport() /data/project/heritage/heritage/api/includes/ApiMonuments.php:370
    4.7166    2386024   6. Statistics::invertIdx() /data/project/heritage/heritage/api/includes/Statistics.php:84


Notice: Undefined offset: 2 in /data/project/heritage/heritage/api/includes/Statistics.php on line 112

Call Stack:
    0.0116     668104   1. {main}() /data/project/heritage/heritage/api/api.php:0
    0.0966    1648256   2. ApiMain::dispatch() /data/project/heritage/heritage/api/api.php:36
    0.1174    1956560   3. ApiMonuments->executeModule() /data/project/heritage/heritage/api/includes/ApiMain.php:39
    0.1415    2201328   4. ApiMonuments->statistics_db() /data/project/heritage/heritage/api/includes/ApiMonuments.php:75
    0.1423    2203664   5. Statistics->retrieveReport() /data/project/heritage/heritage/api/includes/ApiMonuments.php:370
    4.7166    2386024   6. Statistics::invertIdx() /data/project/heritage/heritage/api/includes/Statistics.php:84

Example url: https://tools.wmflabs.org/heritage/api/api.php?action=statistics&stcountry=ua&format=html (note that this does not appear if you append limit=10.

Event Timeline

I don’t anymore o_O Maybe caching issues ? Anyway, closing :)

(Should have provided a link in the first place, now I’m even doubting!)

Might also be temporary issues until the Statistics table has been regenerated (since it will use the old id's until then).

Reopening this as I'm now seeing it again. (will add link to description).

I have a sneaky feeling this is actually due to old ids which don't get purged. But I'll have to investigate further.

Lokal_Profil renamed this task from Undefined offset: 3 in /data/project/heritage/heritage/api/includes/Statistics.php on line 84 to Undefined offset: 3 in /data/project/heritage/heritage/api/includes/Statistics.php on line 112 .May 26 2016, 6:51 AM
Lokal_Profil updated the task description. (Show Details)
Lokal_Profil updated the task description. (Show Details)

An indication that something is wrong is that the value of day in the statistics-db is "2016-01-05". Even though every new build should start by deleting the existing data (clearLatestData()), before building the new report.

select count(idx) from statistics where idx like "ua:%" and idx not like "%:uk:wikipedia";

Shows that there are 275 results like "ua:category". Additionally there will be a a set of ids like "ua:[[muni]]:uk:wikipedia" (which we want) and "ua:muni:uk:wikipedia" (which we don't want).

The real question is why clearLatestData() failed to clear old data. It is also unclear to me what the purpose of "day" is since "lastDay" gets set during purging of old data and then reused for storing the new data.

Closing per last two comments.