Page MenuHomePhabricator

successful edit causes server to return HTTP 500
Closed, ResolvedPublic

Description

Author: russblau

Description:
After a successful page edit using action=edit, the server returns an HTTP 500 code (with an empty body) instead of a normal response. This was encountered on http://test.wikipedia.org repeatedly. (Note that edits that fail for various reasons return proper error/failure messages.)

This bug appears to have been introduced between r33962 and r35960, although I am unable to diagnose further.


Version: 1.13.x
Severity: major

Details

Reference
bz14443

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:10 PM
bzimport set Reference to bz14443.

Every edit? Some edits? Repeatable consistently? Example client code? Sample output of the error page?

Bryan.TongMinh wrote:

Edit test

Attached a sample script using http://mwclient.sourceforge.net/.

The result is a plain 500 without any body text.

Attached:

Confirm this on test.wikipedia.org, but not on my home wiki with SVN HEAD.

Details:
URL: http://test.wikipedia.org/w/api.php?format=xml&action=edit&title=Sandbox&assert=user&maxlag=5
POST: &md5=770ce8a34322c7c20271c43396a6e141&summary=API+test&timestamp=2008-06-07T15%3a23%3a55Z&text=API+TEST%0a%0auh.....%0a%0a%3d%3d+Section+One+%3d%3d%0aTest%0a%3d%3d+Section+Two+%3d%3d%0aTest%0a%0a%7b%7bUC%3a%7b%7bFULLPAGENAME%7d%7d+%7d%7d&token=5ef49b2e44f207eee65f22771c19226d%2b%5c

Produced the following result: http://test.wikipedia.org/w/index.php?title=Sandbox&diff=60322&oldid=60321
but returned an empty page with HTTP 500.

I'm unable to produce a successful edit with Bryan's sample code.

Running configured site config
Site has writeapi: True
Editting page1
Traceback (most recent call last):

File "basic_edit_test.py", line 39, in <module>
  page.save(text1, comment1)
File "/Users/brion/src/mwc/mwclient/page.py", line 133, in save
  raise errors.EditError(self, result['edit']['result'])

mwclient.errors.EditError: (<Page object 'Testothing/text1' for <Site object 'test.wikipedia.org/w/'>>, u'Failure')

Tried for a few minutes to whip together an api-based test edit script, but it seems to be a royal pain in the ass with cookie-based auth. Provide a sample script that works and we can try looking for errors. :)

Bryan.TongMinh wrote:

Edit in browser test

Hmm odd. I unfortunately don't have time to debug that script.

How about the nice and shiny attached HTML form to use the edit api?

Attached:

Or just send this to the server:

POST /w/api.php?action=edit&format=xml&title=Sandbox&summary=API%20test&text=API%20TEST&token=%2B%5C HTTP/1.0
Host: test.wikipedia.org
User-Agent: Bugzilla 14443
Content-length: 0

russblau wrote:

I was able to duplicate the bug using Bryan's web form (comment #5 above). I used the form to create a new page; this edit was successful and returned a normal HTTP 200 response. However, using the form to edit the same page caused an HTTP 500. The edit was successful on the wiki, but the web server did not return an appropriate response.

Regression due to r35696, fixed in r36159.