https://bugzilla.wikimedia.org/show_bug.cgi?id=35300

       Web browser: ---
             Bug #: 35300
           Summary: API returns invalid JSON despite HTTP status 200
           Product: MediaWiki
           Version: 1.19
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: API
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---


Since a while I enabled a semi-automated reporting of a very heavily used
script on WikimediCommons.

The user has the possibility to press a button to post the error message to a
list of those.

Now, after about 1 month there are 4 reported (this means that this occurs much
more often) errors:

API request returned code 200 parsererror. Error code is SyntaxError:
JSON.parse: Parsed string contains more than single value: <!DOCTY...

or

API request returned code 200 parsererror. Error code is SyntaxError:
JSON.parse: unexpected non-whitespace character after JSON data

This means that jQuery received a 200 response and tried to build a JS-object
for the presumed json-string and that failed.

Since we are using "secure techniques" (js objects) to build the query string,
and the format-parameter is always set to json by a wrapper-method (all
requests are handled by doAPICall), this problem only occurs when editing, I
think the problem is at the server side.

If you would like to be up-to-date with those issues, just watch
https://secure.wikimedia.org/wikipedia/commons/wiki/MediaWiki_talk:AjaxQuickDelete.js/auto-errors
for new entries with "API request returned code" (I could make a separate page
for server errors, if you want or send them with JSONP to a
health-status-server. 
It's a page you can learn a lot from: E.g. "API request failed (hookaborted):
The modification you tried to make was aborted by an extension hook" is a very
bad error-message. User has to guess which hook of the the thousands.)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to