Last modified: 2014-07-13 18:32:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T66074, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 64074 - Watchlist for bot too long so /raw triggers an error
Watchlist for bot too long so /raw triggers an error
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Watchlist (Other open bugs)
1.23.0
PC Linux
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-17 21:58 UTC by Ward De Ridder
Modified: 2014-07-13 18:32 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ward De Ridder 2014-04-17 21:58:25 UTC
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?
Comment 1 Merlijn van Deen (test) 2014-04-17 22:09:45 UTC
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:...)
Comment 2 Ward De Ridder 2014-04-17 22:25:54 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links