Page MenuHomePhabricator

Cron <www-data@terbium> /usr/local/bin/mwscriptwikiset extensions/FlaggedRevs/maintenance/updateStats.php flaggedrevs.dblist > /dev/null creates cron spam every 2 hours
Closed, ResolvedPublic

Description

Cron job FlaggedRevs/maintenance/updateStats.php is sending an email to root@ every 2 hours since April 9th. The messages contain warnings due to slow queries, which are irrelevant:

[Mon Apr  9 12:01:41 2018] [hphp] [30264:7fe7635c8200:0:000001] [] SlowTimer [60886ms] at runtime/ext_mysql: slow query: SELECT /* Wikimedia\Rdbms\Database::query  */  rev_timestamp AS rt,(SELECT  MIN(fr_timestamp)  FROM `flaggedrevs`    WHERE (fr_page_id = rev_page) AND (fr_rev_timestamp >= rev_timestamp)  ) AS nft  FROM `revision`    WHERE (rev_user > 0) AND (rev_timestamp BETWEEN '20090630052123' AND '20090707052123') AND ((rev_id % 1) = 0) AND (rev_parent_id > 0) AND (EXISTS (SELECT  *  FROM `flaggedrevs`    WHERE (fr_page_id = rev_page) AND (fr_rev_timestamp < rev_timestamp) AND (fr_rev_id < rev_id) AND (fr_timestamp < rev_timestamp)  )) 
[Mon Apr  9 12:02:15 2018] [hphp] [30537:7f1b7a955200:0:000001] [] SlowTimer [19785ms] at runtime/ext_mysql: slow query: SELECT /* Wikimedia\Rdbms\Database::query  */  rev_timestamp AS rt,(SELECT  MIN(fr_timestamp)  FROM `flaggedrevs`    WHERE (fr_page_id = rev_page) AND (fr_rev_timestamp >= rev_timestamp)  ) AS nft  FROM `revision`    WHERE (rev_user > 0) AND (rev_timestamp BETWEEN '20140312000108' AND '20140319000108') AND ((rev_id % 1) = 0) AND (rev_parent_id > 0) AND (EXISTS (SELECT  *  FROM `flaggedrevs`    WHERE (fr_page_id = rev_page) AND (fr_rev_timestamp < rev_timestamp) AND (fr_rev_id < rev_id) AND (fr_timestamp < rev_timestamp)  ))

There are so far 95 emails and counting. Warnings like this should be filtered and not be sent to error log. The large amount of mails masks other legitimate errors. Sending to standard output is ok when legitimate errors happen, but not in this case.

Event Timeline

jcrespo triaged this task as Medium priority.Apr 17 2018, 8:33 AM
jcrespo created this task.

I think you meant to subscribe someone else than me, I don't even know what could possibly be printing those warnings. If you need me in particular to investigate this, let me know (and resubscribe me), but someone would probably much more efficiently.

Change 428942 had a related patch set uploaded (by Jcrespo; owner: Jcrespo):
[operations/puppet@production] flaggedreviews-maintenance: Avoid cronspam by sending error output to /dev/null

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

Change 428942 merged by Jcrespo:
[operations/puppet@production] flaggedreviews-maintenance: Avoid cronspam by sending error output to /dev/null

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

jcrespo claimed this task.

Horrible hack applied to avoid cronspam, if you disagree with it, feel free to deploy a new one on top!