Page MenuHomePhabricator

redirect.py doesn't delete broken redirects
Closed, ResolvedPublic

Description

The bot crashes while running and says that redirects are not redirects...

tools.rubinbot@tools-bastion-01:~$ python .pywikibot/scripts/version.py
Pywikibot: [https] r-pywikibot-core.git (8d1e7d0, g2, 2015/05/23, 16:06:14, OUTDATED)
Release version: 2.0b3
httplib2 version: 0.8
  cacerts: /etc/ssl/certs/ca-certificates.crt
    certificate test: ok
Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2]
  unicode test: ok
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB: Not set
PYWIKIBOT2_NO_USER_CONFIG: Not set
Config base dir: /data/project/rubinbot/.pywikibot
Usernames for family "wikipedia":
        ru: Rubinbot II (also sysop)
tools.rubinbot@tools-bastion-01:~$ python .pywikibot/scripts/redirect.py br -v -v
The base directory is /data/project/rubinbot/.pywikibot
=== Pywikibot framework v2.0 -- Logging header ===
COMMAND: ['.pywikibot/scripts/redirect.py', 'br', '-v', '-v']
DATE: 2015-05-26 13:54:26.413026 UTC
VERSION: [https] r-pywikibot-core.git (8d1e7d0, g2, 2015/05/23, 16:06:14, n/a)
SYSTEM: ('Linux', 'tools-bastion-01', '3.13.0-45-generic', '#74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015', 'x86_64')
CONFIG FILE DIR: /data/project/rubinbot/.pywikibot
PACKAGES:
  BaseHTTPServer (/usr/lib/python2.7/BaseHTTPServer.pyc) = 0.3
  SimpleHTTPServer (/usr/lib/python2.7/SimpleHTTPServer.pyc) = 0.6
  SocketServer (/usr/lib/python2.7/SocketServer.pyc) = 0.4
  _elementtree (/usr/lib/python2.7/lib-dynload/_elementtree.x86_64-linux-gnu.so) = 1.0.6
  cgi (/usr/lib/python2.7/cgi.pyc) = 2.6
  distutils (/usr/lib/python2.7/distutils/) = 2.7.6
  email (/usr/lib/python2.7/email/) = 4.0.3
  httplib2 (/usr/lib/python2.7/dist-packages/httplib2/) = 0.8
  json (/usr/lib/python2.7/json/) = 2.0.9
  logging (/usr/lib/python2.7/logging/) = 0.5.1.2
  mwparserfromhell (/usr/lib/python2.7/dist-packages/mwparserfromhell/) = 0.3.3
  parser (/usr/lib/python2.7/lib-dynload/parser.x86_64-linux-gnu.so) = 0.5
  pickle (/usr/lib/python2.7/pickle.pyc) = $Revision: 72223 $
  platform (/usr/lib/python2.7/platform.pyc) = 1.0.7
  pyexpat (/usr/lib/python2.7/lib-dynload/pyexpat.x86_64-linux-gnu.so) = 2.7.6
  pywikibot ([path unknown]) = ??
  re (/usr/lib/python2.7/re.pyc) = 2.2.1
  setuptools (/usr/lib/python2.7/dist-packages/setuptools/) = 3.3
  urllib (/usr/lib/python2.7/urllib.pyc) = 1.17
  urllib2 (/usr/lib/python2.7/urllib2.pyc) = 2.7
MODULES:
  /shared/pywikipedia/core/pywikibot/textlib.py 462afa2 2015-05-23 12:03:44.740559
  /shared/pywikipedia/core/pywikibot/comms/http.py b336a0a 2015-05-23 12:03:43.936538
  /shared/pywikipedia/core/pywikibot/data/api.py c6cbf67 2015-05-23 12:03:44.112543
  /shared/pywikipedia/core/pywikibot/userinterfaces/__init__.py 43eceeb 2015-05-23 12:03:44.820561
  /shared/pywikipedia/core/pywikibot/i18n.py 77e57c6 2015-05-23 12:03:44.568555
  /shared/pywikipedia/core/pywikibot/comms/threadedhttp.py 69cf1f8 2015-05-23 12:03:43.952539
  /shared/pywikipedia/core/pywikibot/data/__init__.py 44183c7 2015-05-23 12:03:44.088542
  /shared/pywikipedia/core/pywikibot/daemonize.py 918ee97 2015-05-23 12:03:44.064542
  /shared/pywikipedia/core/pywikibot/exceptions.py ad09618 2015-05-23 12:03:44.208545
  /shared/pywikipedia/core/pywikibot/site.py eae3500 2015-05-23 12:03:44.712559
  /shared/pywikipedia/core/pywikibot/bot.py b319e3c 2015-05-23 12:03:43.884537
  /shared/pywikipedia/core/pywikibot/__init__.py 615589e 2015-05-23 12:03:43.860536
  /shared/pywikipedia/core/pywikibot/throttle.py 4157254 2015-05-23 12:03:44.748560
  /shared/pywikipedia/core/pywikibot/page.py 3f9c93a 2015-05-23 12:03:44.648557
  /shared/pywikipedia/core/pywikibot/family.py b978cc6 2015-05-23 12:03:44.552555
  /shared/pywikipedia/core/pywikibot/xmlreader.py 86185cf 2015-05-23 12:03:44.948565
  /shared/pywikipedia/core/pywikibot/plural.py c9edb6b 2015-05-23 12:03:44.676558
  /shared/pywikipedia/core/pywikibot/version.py 8de383e 2015-05-23 12:03:44.916564
  /shared/pywikipedia/core/pywikibot/userinterfaces/terminal_interface.py 9a5fbf1 2015-05-23 12:03:44.844562
  /shared/pywikipedia/core/pywikibot/config2.py 971b19d 2015-05-23 12:03:44.016541
  /shared/pywikipedia/core/pywikibot/tools/ip.py 808c0cc 2015-05-23 12:03:44.796561
  /shared/pywikipedia/core/pywikibot/userinterfaces/terminal_interface_base.py c4468e3 2015-05-23 12:03:44.856562
  /shared/pywikipedia/core/pywikibot/userinterfaces/terminal_interface_unix.py 60d8cb2 2015-05-23 12:03:44.864563
  /shared/pywikipedia/core/pywikibot/tools/__init__.py 692fc89 2015-05-23 12:03:44.772560
  /shared/pywikipedia/core/pywikibot/diff.py 5acc741 2015-05-23 12:03:44.180545
  /shared/pywikipedia/core/pywikibot/login.py 70f3f31 2015-05-23 12:03:44.604556
  /shared/pywikipedia/core/pywikibot/comms/__init__.py 747d0a7 2015-05-23 12:03:43.920538
  /shared/pywikipedia/core/pywikibot/userinterfaces/transliteration.py efd4103 2015-05-23 12:03:44.892563
=== === === === === === === === === === === === === ===
Pywikibot r615589e44ff6b07edb1c00a35ef1d05a1655f65b
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2]
Found 1 wikipedia:ru processes running, including this one.
LOADING SITE wikipedia:ru VERSION: 1.26wmf6
Retrieving special page...


>>> Valentino <<<
Valentino is not a redirect.


>>> Танец с волками (фильм) <<<
Танец с волками (фильм) is not a redirect.


>>> Танец с волками <<<
Танец с волками is not a redirect.


>>> Тенистая улица <<<
Тенистая улица is not a redirect.


>>> 10-й механизированный корпус (2-го формирования) <<<
10-й механизированный корпус (2-го формирования) is not a redirect.


>>> 5-й армейский корпус (Россия) <<<
Traceback (most recent call last):
  File ".pywikibot/scripts/redirect.py", line 796, in <module>
    main()
  File ".pywikibot/scripts/redirect.py", line 793, in main
    bot.run()
  File ".pywikibot/scripts/redirect.py", line 694, in run
    self.delete_broken_redirects()
  File ".pywikibot/scripts/redirect.py", line 407, in delete_broken_redirects
    self.delete_1_broken_redirect(redir_name)
  File ".pywikibot/scripts/redirect.py", line 442, in delete_1_broken_redirect
    movedTarget = self.moved_page(targetPage)
  File ".pywikibot/scripts/redirect.py", line 416, in moved_page
    return lastmove.new_title()
  File "/shared/pywikipedia/core/pywikibot/logentries.py", line 212, in new_title
    self._new_title = pywikibot.Page(self.site, self.data['move']['new_title'])
  File "/shared/pywikipedia/core/pywikibot/logentries.py", line 30, in __missing__
    raise KeyError("Log entry (%s) has no '%s' key" % (self._type, key))
KeyError: u"Log entry (move) has no 'move' key"
Dropped throttle(s).
<type 'exceptions.KeyError'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
All threads finished.

Details

Related Gerrit Patches:

Event Timeline

Rubin16 created this task.May 26 2015, 1:55 PM
Rubin16 raised the priority of this task from to Needs Triage.
Rubin16 updated the task description. (Show Details)
Rubin16 added a subscriber: Rubin16.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMay 26 2015, 1:55 PM
Rubin16 triaged this task as Normal priority.May 26 2015, 1:55 PM
Rubin16 set Security to None.
Xqt added a subscriber: Xqt.May 26 2015, 2:05 PM

mw has been changed for logentries.
Bug is already known, the corresponding Task is T99516

Xqt added a comment.May 26 2015, 2:08 PM

Ah and btw the Error message is wrong. The missing key is 'new_title'
There is a patch in review: I610540df99fd6f5a77f0cfc8702555c2a082307a
Either you may try it or wait until the patch is released

Change 211802 had a related patch set uploaded (by Xqt):
[FIX] Re-enable BlockEntry and MoveEntry methods

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

Change 211802 merged by jenkins-bot:
[FIX] Re-enable BlockEntry and MoveEntry methods

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

Xqt closed this task as Resolved.May 31 2015, 3:16 PM
Xqt claimed this task.