Page MenuHomePhabricator

Fatal error: Uncaught exception during popular pages report generation
Closed, ResolvedPublic1 Estimated Story Points

Description

When processing pages for one of the WikiProjects, the script died with the following fatal error:

PHP Fatal error:  Uncaught exception 'GuzzleHttp\Exception\ServerException' with message 'Server error: `GET https://en.wikipedia.org/w/api.php?action=query&formatversion=2&format=json&titles=Kysyl-Yuryuyya&prop=redirects&rdlimit=500` resulted in a `503 Backend fetch failed` response:
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<title>Wikimedia Error</title>
<style>
* { margin: 0; padding: 0; }
 (truncated...)
' in /mnt/nfs/labstore-secondary-tools-home/kaldari/popularpages/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
Stack trace:
#0 /mnt/nfs/labstore-secondary-tools-home/kaldari/popularpages/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /mnt/nfs/labstore-secondary-tools-home/kaldari/popularpages/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /mnt/nfs/labstore-secondary-tools-home/kaldari/popularpages/ in /mnt/nfs/labstore-secondary-tools-home/kaldari/popularpages/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 111

Let's make sure the script has better exception handling so it can deal with server errors from the API. For example, we may want to put the API call for redirects (which isn't 100% vital) inside a try/catch block and just log the exception (or have it try again).

Event Timeline

kaldari triaged this task as Medium priority.Apr 19 2017, 4:23 PM
kaldari edited projects, added Community-Tech-Sprint; removed Community-Tech.
kaldari set the point value for this task to 1.
kaldari raised the priority of this task from Medium to High.Apr 20 2017, 5:34 PM

Looks like this killed the bot job again. Changing to High priority.

The weird thing is, this has never happened before. I think something is up with the API. I did previously chat with someone and they said our API is robust enough to not throw this error unless you make like a thousand requests a second or something.

I will look into fixing this meanwhile.

My current theory is that something messed up with the API during the DC switch.