Page MenuHomePhabricator

populate_adm_tree.php runs out of memory
Closed, ResolvedPublic

Description

From the 2018-07-24 logs

2018-07-24_13:13:47 Update admin structure tree...
Deleting previous data...
Rebuilding table...
PHP Fatal error:  Allowed memory size of 209715200 bytes exhausted (tried to allocate 32 bytes) in /mnt/nfs/labstore-secondary-tools-project/heritage/heritage/erfgoedbot/populate_adm_tree.php on line 45
PHP Stack trace:
PHP   1. {main}() /mnt/nfs/labstore-secondary-tools-project/heritage/heritage/erfgoedbot/populate_adm_tree.php:0
PHP   2. mysqli_result->fetch_object() /mnt/nfs/labstore-secondary-tools-project/heritage/heritage/erfgoedbot/populate_adm_tree.php:45

Fatal error: Allowed memory size of 209715200 bytes exhausted (tried to allocate 32 bytes) in /mnt/nfs/labstore-secondary-tools-project/heritage/heritage/erfgoedbot/populate_adm_tree.php on line 45

Call Stack:
    0.0055     266472   1. {main}() /mnt/nfs/labstore-secondary-tools-project/heritage/heritage/erfgoedbot/populate_adm_tree.php:0
  206.6300  209637400   2. mysqli_result->fetch_object() /mnt/nfs/labstore-secondary-tools-project/heritage/heritage/erfgoedbot/populate_adm_tree.php:45

Event Timeline

It's worth noting that this is the only php file in the erfgoedbot directory. It's also unclear to me if anyone uses the adm_tree table (likely not since it's broken).

Our choices are either to drop the table and all associated scripts, or to rebuild this in python and solve the memory issue.

As far as I remember, the admin_tree table was only ever used by the WLM mobile app. it is exposed by the api/includes/ApiAdminTree.php endpoint but well...

@Multichill Do you know if there were any other users of the admin_tree table beyond the deprecated WLM mobile app ?

I don't think anything else is using it. I would check two weeks of logs to see if anything tried to use it and if not, just kill it.

Change 448054 had a related patch set uploaded (by Jean-Frédéric; owner: Jean-Frédéric):
[labs/tools/heritage@master] Bump PHP memory limit from 200M to 800M in populate_adm_tree.php

https://gerrit.wikimedia.org/r/448054

Change 448054 merged by jenkins-bot:
[labs/tools/heritage@master] Bump PHP memory limit from 200M to 800M in populate_adm_tree.php

https://gerrit.wikimedia.org/r/448054

Mentioned in SAL (#wikimedia-cloud) [2018-07-31T09:12:50Z] <Lokal_Profil> Deploy latest from Git master: a230a6e (T200337), 12f5559, bad6d8d (T200410), 3c7e8d9, e00f1b3, a021cb9 (T200428), 0631408, d2e8246, b9ff533, a471c38, 1c5b9f6 [correction to previous]

Note that we should look for this one in the logs then resolve

2018-08-19_13:50:18 Update admin structure tree...
Deleting previous data...
Rebuilding table...
Querying data...
Inserting data...
Inserted 136750 admin zones in 157.65047192574 seconds.

Change 456760 had a related patch set uploaded (by Jean-Frédéric; owner: Jean-Frédéric):
[labs/tools/heritage@master] Bump PHP memory limit from 800M to 1200M in populate_adm_tree.php

https://gerrit.wikimedia.org/r/456760

Change 456760 merged by jenkins-bot:
[labs/tools/heritage@master] Bump PHP memory limit from 800M to 1200M in populate_adm_tree.php

https://gerrit.wikimedia.org/r/456760

Mentioned in SAL (#wikimedia-cloud) [2018-09-01T20:23:06Z] <Lokal-Profil> Deploy latest from Git master: 17b27b3, c5122c7 (T200337), 6e85721, b48135e (T174871)

JeanFred claimed this task.
JeanFred added a subscriber: Aklapper.

This has not failed us in a while, closing as Resolved.