Page MenuHomePhabricator

test_proofwiki is failing with RuntimeError: Unsupported url
Closed, ResolvedPublic

Description

https://travis-ci.org/magul/pywikibot-core/jobs/222020334#L4513

======================================================================

ERROR: test_proofwiki (tests.site_detect_tests.StandardVersionSiteTestCase)

Test detection of MediaWiki sites for www.proofwiki.org.

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/travis/build/magul/pywikibot-core/tests/site_detect_tests.py", line 63, in test_proofwiki

    self.assertSite('http://www.proofwiki.org/wiki/$1')

  File "/home/travis/build/magul/pywikibot-core/tests/site_detect_tests.py", line 37, in assertSite

    self.assertIsInstance(MWSite(url), MWSite)

  File "/home/travis/build/magul/pywikibot-core/pywikibot/site_detect.py", line 91, in __init__

    raise RuntimeError('Unsupported url: {0}'.format(self.fromurl))

RuntimeError: Unsupported url: https://proofwiki.org/wiki/

This is making most travis builds fail.

Event Timeline

The HTML source code of https://proofwiki.org/:

<h1>Sorry! This site is experiencing technical difficulties.</h1><p>Try waiting a few minutes and reloading.</p><p><small>(Cannot access the database)</small></p><hr /><div style="margin: 1.5em">You can try searching via Google in the meantime.<br />
<small>Note that their indexes of our content may be out of date.</small>
</div>
<form method="get" action="//www.google.com/search" id="googlesearch">
	<input type="hidden" name="domains" value="https://proofwiki.org" />
	<input type="hidden" name="num" value="50" />
	<input type="hidden" name="ie" value="UTF-8" />
	<input type="hidden" name="oe" value="UTF-8" />
	<input type="text" name="q" size="31" maxlength="255" value="" />
	<input type="submit" name="btnG" value="Search" />
	<p>
		<label><input type="radio" name="sitesearch" value="https://proofwiki.org" checked="checked" />ProofWiki</label>
		<label><input type="radio" name="sitesearch" value="" />WWW</label>
	</p>
</form>

This is a mediawiki message (reportOutageHTML) shown after a database issue.

The test should be skipped in this situation, but the problem is that Mediawiki is responding with a 200 status code instead of 500 (server error).

There is an old task open opened for this at: T35917. We can manually process the page content and raise ServerError until that issue is resolved.

Change 348211 had a related patch set uploaded (by Dalba):
[pywikibot/core@master] site_detect.py: Detect database error in reponse.content

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

Xqt triaged this task as Medium priority.Apr 14 2017, 12:52 PM

Change 348211 merged by jenkins-bot:
[pywikibot/core@master] site_detect.py: Detect database error from reponse.content

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