Page MenuHomePhabricator

Copypatrol is down for French and Spanish wikipedias
Closed, ResolvedPublic

Event Timeline

MariaDB [s51306__copyright_p]> select COUNT(*) from copyright_diffs where review_timestamp RLIKE '2017-05' and lang = 'fr' LIMIT 10;
+----------+
| COUNT(*) |
+----------+
|       18 |
+----------+
1 row in set (0.06 sec)

MariaDB [s51306__copyright_p]> select COUNT(*) from copyright_diffs where review_timestamp RLIKE '2017-04' and lang = 'fr' LIMIT 10;
+----------+
| COUNT(*) |
+----------+
|       88 |
+----------+
1 row in set (0.04 sec)

MariaDB [s51306__copyright_p]> select COUNT(*) from copyright_diffs where review_timestamp RLIKE '2017-03' and lang = 'fr' LIMIT 10;
+----------+
| COUNT(*) |
+----------+
|      122 |
+----------+
1 row in set (0.04 sec)

Thanks for reporting this, @Framawiki and sorry about us not keeping on top of things.
From what I can see, Eranbot is not gathering any data for French and Spanish wikis. I don't immediately see a reason for this because it's configured to work in the exact same way as English. The error logs don't seem to say anything helpful.

MariaDB [s51306__copyright_p]> select lang, project, status, diff_timestamp from copyright_diffs where lang='fr' order by diff_timestamp desc limit 5;
+------+-----------+--------+----------------+
| lang | project   | status | diff_timestamp |
+------+-----------+--------+----------------+
| fr   | wikipedia | fixed  | 20170409120447 |
| fr   | wikipedia | false  | 20170409101505 |
| fr   | wikipedia | false  | 20170409095358 |
| fr   | wikipedia | false  | 20170409081734 |
| fr   | wikipedia | false  | 20170409043724 |
+------+-----------+--------+----------------+
5 rows in set (0.05 sec)

@kaldari @MusikAnimal @Samwilson @DannyH I want to start a discussion about us replacing eranbot here with something of our own. It doesn't have to be something as fancy or complicated as eranbot but it needs to be something we can fix and debug if and when required. It's next to impossible to parse eranbot's error logs and figure out where it's blowing up or what we need to do in order to fix things. I suspect a big part of the problem is connecting to IRC and fetching data. Also a part of the problem is that eranbot repo has a lot of code that has nothing to do with copypatrol.
This is a big blocker before employing Copypatrol for other language wikis.

Niharika renamed this task from Copypatrol is down for frwiki to Copypatrol is down for French and Spanish wikipedias.Jun 5 2017, 2:54 PM

Yeah, that's frustrating. I agree that we should talk about rewriting eranbot. We can't work on it right now (before Wikimania), because there's a lot of people joining the team all at once, and too many current projects. But Copypatrol is important, and I don't want to drop this.

@eranroz Meanwhile can you help us figure out what's wrong? Thank you.

  • Issues with updates - I suspect it is something with the IRC connections. I don't like the way we update based on IRC. The bot supports using rcstream instead, but it is even less relieble. I would like to replace the IRC updates soon with eventstreams ( T158943 )
  • I will check the logs later today

It is known issue that the irc client library of pywikibot doesn't get reconnected. The simple workaround so far was built on restarting the process after a while.
However, qstat

 name       user         state submit/start at     queue                          slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
 eswiki     tools.eranbo r     04/05/2017 07:30:04 task@tools-exec-1419.tools.eqi     1        
frwiki     tools.eranbo r     04/09/2017 10:10:07 task@tools-exec-1417.tools.eqi     1        
 enwiki     tools.eranbo r     06/07/2017 17:00:14 task@tools-exec-1436.tools.eqi     1

(the "submit/start at" is long long time ago) The process is not getting killed as there was no -l h_rt=4:05:00 in the jsub. I killed it manually and added it for future runs

@eranroz Some ideas for improvement, if it can help:
Do you use continuous jobs ? with Bigbrother ?
And stupid question but is there a task for the pywikibot problem ? It sounds pretty boring if it is not capable to reconnect itself.
You have an old version of pwb (2017/03/30) in /data/project/eranbot/pywikibot/core, if you still use it you can rather use the last version that is hosted at /shared/pywikipedia/core/

Using continuous jobs with Bigbrother seems like a good solution. @eranroz, what do you think about switching to that rather than using cron and jsub to periodically stop and restart?

@eranroz Some ideas for improvement, if it can help:
Do you use continuous jobs ? with Bigbrother ?
And stupid question but is there a task for the pywikibot problem ? It sounds pretty boring if it is not capable to reconnect itself.
You have an old version of pwb (2017/03/30) in /data/project/eranbot/pywikibot/core, if you still use it you can rather use the last version that is hosted at /shared/pywikipedia/core/

  1. bigbrother would be a good solution if the issue is that the job isn't always up, but this isn't the issue. the job intentionally kill itself and get up soon afterwards as a simple WA for disconnections from IRC. (see next point) In other words, we want to AVOID continuous jobs here.
  2. irc updates issue - the bot uses IRCBot (from pywikibot.botirc) which import from ircbot import SingleServerIRCBot this old version of irc package. (in the latest package it is called irc.bot rather than ircbot - see also T111626 ). Some events such as on_nicknameinuse are possibly not called. Since this requires some rewrite of this infrastructure we simple restart the bot. A different approach is to use rcstream - but this is obsolete, and never worked well. The new api is eventstream, and is currently under review https://gerrit.wikimedia.org/r/#/c/346164
kaldari claimed this task.

@eranroz - Makes sense. Thanks for the explanation.

I've confirmed that both the French and Spanish CopyPatrols are running again.

For future reference, the cronjob that is running for these is: (using Spanish Wikipedia as an example)

*/10 * * * * jsub -N eswiki -mem 500m -l h_rt=4:05:00 -once -quiet -o /data/project/eranbot/outs python /data/project/eranbot/gitPlagiabot/plagiabot/plagiabot.py -lang:es -blacklist:User:EranBot/Copyright/Blacklist -live:on -reportlogger