Page MenuHomePhabricator

Handle search api errors better
Closed, DeclinedPublic

Description

So I was working on matching some painters and I hit a search error

Traceback (most recent call last):
  File "C:\pywikibot\coredev\painting_add_creator.py", line 315, in <module>
    main()
  File "C:\pywikibot\coredev\painting_add_creator.py", line 310, in main
    paintingBot.run()
  File "C:\pywikibot\coredev\painting_add_creator.py", line 154, in run
    creatorItem = self.getCreator(creator)
  File "C:\pywikibot\coredev\painting_add_creator.py", line 196, in getCreator
    for creatoritem in creategen:
  File "C:\pywikibot\coredev\pywikibot\pagegenerators.py", line 1619, in Preload
ingItemGenerator
    for page in generator:
  File "C:\pywikibot\coredev\pywikibot\pagegenerators.py", line 1674, in Wikibas
eItemGenerator
    for page in gen:
  File "C:\pywikibot\coredev\pywikibot\pagegenerators.py", line 1998, in SearchP
ageGenerator
    namespaces=namespaces):
  File "C:\pywikibot\coredev\pywikibot\data\api.py", line 2265, in __iter__
    self.data = self.request.submit()
  File "C:\pywikibot\coredev\pywikibot\data\api.py", line 1734, in submit
    raise APIError(**result['error'])
pywikibot.data.api.APIError: gsrsearch-error: Search is currently too busy.  Ple
ase try again later.
<class 'pywikibot.data.api.APIError'>
CRITICAL: Closing network session.

Would be nicer to have error handling for the gsrsearch-error errors. When hit, it should probably wait and try later for maxtries just like other functions in pywikibot.

Related Objects

Event Timeline

Multichill raised the priority of this task from to Needs Triage.
Multichill updated the task description. (Show Details)
Multichill subscribed.

This is essentially the same problem as T75135. The underlying problem is MW API code gsrsearch-error is used for both recoverable and non-recoverable errors.

Maybe file an upstream bug that mediawiki should implement different types of gsrsearch-errors so that we know what we're hitting?

Yea. Or talk with the search team first?

This is also an issue that can cause travis tests that would otherwise pass to fail.
EDIT: Derp, just saw T75135

Xqt subscribed.

Haven’t seen it for a long time. If this is still an issue, please re-open