Page MenuHomePhabricator

APIError: Petscan: No result for source categories
Closed, ResolvedPublic

Description

19:45:06 ======================================================================
19:45:06 ERROR: test_petscan (tests.pagegenerators_tests.PetScanPageGeneratorTestCase)
19:45:06 Test PetScanPageGenerator.
19:45:06 ----------------------------------------------------------------------
19:45:06 Traceback (most recent call last):
19:45:06   File "/src/tests/pagegenerators_tests.py", line 383, in test_petscan
19:45:06     site=site)
19:45:06   File "/src/tests/aspects.py", line 237, in assertPageTitlesEqual
19:45:06     gen_titles = self._get_gen_titles(gen, len(titles), site)
19:45:06   File "/src/tests/aspects.py", line 172, in _get_gen_titles
19:45:06     return [page.title() for page in self._get_gen_pages(gen, count, site)]
19:45:06   File "/src/tests/aspects.py", line 154, in _get_gen_pages
19:45:06     gen_pages = list(gen)
19:45:06   File "/usr/lib/python3.6/_collections_abc.py", line 317, in __next__
19:45:06     return self.send(None)
19:45:06   File "/src/pywikibot/tools/collections.py", line 277, in send
19:45:06     return next(self._started_gen)
19:45:06   File "/src/pywikibot/pagegenerators/_generators.py", line 1231, in generator
19:45:06     for raw_page in self.query():
19:45:06   File "/src/pywikibot/pagegenerators/_generators.py", line 1219, in query
19:45:06     raise APIError('Petscan', data['error'], **self.opts)
19:45:06 pywikibot.exceptions.APIError: Petscan: No result for source categories

from https://integration.wikimedia.org/ci/job/pywikibot-core-tox-deeptest-py36-docker/2893/console

Event Timeline

One reason this now fails is because on my request to delete "Category:Pywikibot Protect Test" in T352560, the category has now been removed from:
User:Sn1per/ProtectTest1
User:Sn1per/ProtectTest2

see https://test.wikipedia.org/w/index.php?title=User%3ASn1per%2FProtectTest1&diff=583975&oldid=221071

Beside that, there could be more, or it was maybe PetScan that had temporary problems.

Xqt claimed this task.
Xqt subscribed.

Works again:

D:\pwb\GIT\core>pwb pagegenerators_tests -v PetScanPageGeneratorTestCase.test_petscan
tests: max_retries reduced from 15 to 1
test_petscan (__main__.PetScanPageGeneratorTestCase.test_petscan)
Test PetScanPageGenerator. ... ok

----------------------------------------------------------------------
Ran 1 test in 4.172s

OK

D:\pwb\GIT\core>

The created category was not a problem, probably an upstream issue

Xqt reopened this task as Open.EditedDec 2 2023, 12:38 PM

Fails again, even on petscan page

Change 979467 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [tests] expect PetScanPageGeneratorTestCase to fail

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

Change 979467 merged by jenkins-bot:

[pywikibot/core@master] [tests] skip PetScanPageGeneratorTestCase if APIError occurred

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

Xqt removed Xqt as the assignee of this task.Dec 3 2023, 8:32 AM

I see the error on my production code as well. Probably a duplicate of https://github.com/magnusmanske/petscan_rs/issues/106

Change 987742 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] Revert "[tests] skip PetScanPageGeneratorTestCase if APIError occurred"

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

Xqt claimed this task.
This comment was removed by Xqt.

Change 987742 abandoned by Xqt:

[pywikibot/core@master] Revert "[tests] skip PetScanPageGeneratorTestCase if APIError occurred"

Reason:

Still fails

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

Xqt removed Xqt as the assignee of this task.Jan 5 2024, 1:13 PM

Hello, since yesterday PetScan returns the error message

"Wikimedia Cloud Services Error: This web service cannot be reached. "

https://petscan.wmflabs.org/

Could you please check / restart?

Thanks a lot!

Change 993003 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] Revert "[tests] skip PetScanPageGeneratorTestCase if APIError occurred"

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

Seems it was solved upstream. Closing this task now.

Xqt claimed this task.

Change 993003 merged by jenkins-bot:

[pywikibot/core@master] Revert "[tests] skip PetScanPageGeneratorTestCase if APIError occurred"

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