Page MenuHomePhabricator

test_page_gen_redlink is failing with APIMWException
Closed, ResolvedPublic

Description

Running proofreadpage_tests.TestIndexPageMappingsRedlinks.test_page_gen_redlink:

Error
Traceback (most recent call last):
  File "...\Python36\lib\unittest\case.py", line 59, in testPartExecutor
    yield
  File "...\Python36\lib\unittest\case.py", line 605, in run
    testMethod()
  File "...\pywikibot-core\tests\proofreadpage_tests.py", line 686, in test_page_gen_redlink
    self.assertEqual(list(gen), self.pages)
  File "...\pywikibot-core\pywikibot\proofreadpage.py", line 887, in <genexpr>
    gen = (p for p in gen if p.ql in filter_ql)
  File "...\pywikibot-core\pywikibot\proofreadpage.py", line 281, in wrapper
    obj._decompose_page()
  File "...\pywikibot-core\pywikibot\proofreadpage.py", line 444, in _decompose_page
    if not (hasattr(self, '_text') or self.text):
  File "...\pywikibot-core\pywikibot\proofreadpage.py", line 408, in text
    self._text = self.preloadText()
  File "...\pywikibot-core\pywikibot\page.py", line 665, in preloadText
    self.site.loadpageinfo(self, preload=True)
  File "...\pywikibot-core\pywikibot\site.py", line 2967, in loadpageinfo
    self._update_page(page, query)
  File "...\pywikibot-core\pywikibot\site.py", line 2950, in _update_page
    for pageitem in query:
  File "...\pywikibot-core\pywikibot\data\api.py", line 2775, in __iter__
    self.data = self.request.submit()
  File "...\pywikibot-core\pywikibot\data\api.py", line 2128, in submit
    raise e
pywikibot.data.api.APIMWException: internal_api_error_BadMethodCallException: [Wh@7dApAEMUAAKjKXTkAAACD] Exception caught: Call to a member function exists() on a non-object (boolean) [servedby:mw1316]

Event Timeline

jayvdb subscribed.

Thanks for raising this @Dalba !

Why not MediaWiki-API? ;-)

This is preventing merges of students work in GCI. :/

I've accepted one students task, but this will affect all pywikibot GCI tasks, and all other pywiki dev work. Should we disable these tests temporarily?

I've accepted one students task, but this will affect all pywikibot GCI tasks, and all other pywiki dev work. Should we disable these tests temporarily?

Agreed, we can mark it as expected failure.

Change 394296 had a related patch set uploaded (by Dalba; owner: Dalba):
[pywikibot/core@master] proofreadpage_tests.py: Mark test_page_gen_redlink as expected failure

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

It does not fail for me in python 27 or python36.

It does not fail for me in python 27 or python36.

It may be due to caching. Try changing cached = True to False on TestIndexPageMappingsRedlinks class.

Also see if the URI in T181697#3799038 is working for you or not.

Change 394296 merged by jenkins-bot:
[pywikibot/core@master] proofreadpage_tests.py: Mark test_page_gen_redlink as expected failure

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

Change 394637 had a related patch set uploaded (by Mpaa; owner: Mpaa):
[pywikibot/core@master] proofreadpage_tests: fix test_page_gen_redlink

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

Dalba assigned this task to Mpaa.

Change 394637 merged by jenkins-bot:
[pywikibot/core@master] proofreadpage_tests: fix test_page_gen_redlink

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

Is it still reproducible or it's a temporary server error ?