Page MenuHomePhabricator

Watchlist for bot too long so /raw triggers an error
Closed, DeclinedPublic

Description

Author: warddr

Description:
My bot has a huge watchlist (all pages that are created using this bot) of 116k pages. I'd like to empty it since pywikipediabot sometimes updates the local cache of these pages and it takes forever.

The problem is that /raw results in an error (I assume it is timeout related):

Our servers are currently experiencing a technical problem. This is probably temporary and should be fixed soon. Please try again in a few minutes.
If you report this error to the Wikimedia System Administrators, please include the details below.
Request: GET http://nl.wiktionary.org/wiki/Speciaal:VolglijstBewerken/raw, from 10.64.0.105 via cp1067 cp1067 ([10.64.0.104]:3128), Varnish XID 1763728516
Forwarded for: 5.133.180.183, 91.198.174.104, 208.80.154.134, 10.64.0.105
Error: 503, Service Unavailable at Thu, 17 Apr 2014 21:46:12 GMT

retrying doesn't work. What can I do about this?


Version: 1.23.0
Severity: normal
OS: Linux
Platform: PC
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=66212

Details

Reference
bz64074

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:15 AM
bzimport set Reference to bz64074.
bzimport added a subscriber: Unknown Object (MLST).

Workaround using pywikibot-core:

import sys, pywikibot
pywikibot.handleArgs()
site = pywikibot.Site()
site.login()

if pywikibot.inputChoice('Are you sure you want to clear your watchlist on %s?' % site, ['yes', 'no'], ['y', 'n'], 'n') == 'n':

sys.exit(1)

while True:

wt = pywikibot.data.api.Request(site=site, action='tokens', type='watch').submit()['tokens']['watchtoken']
wd = pywikibot.data.api.Request(site=site, action='watch', unwatch=True, generator='watchlistraw', gwrlimit=5000, token=wt).submit()
if not wd['watch']:
    break
else:
   print "%i pages removed..." % len(wd['watch'])

(store in scripts/clearwatchlist.py; then python pwb.py clearwatchlist -site:... -lang:...)

warddr wrote:

This workaroud fixed the problem for me, thanks Merlijn!
A more elegant solution would be nice (one in the mediawiki software), but this one works in the rare occasion of a huge watchlist.