Page MenuHomePhabricator

Fatal error: Uncaught exception during popular pages report generation
Closed, ResolvedPublic1 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 created this task.Apr 19 2017, 4:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 19 2017, 4:23 PM
kaldari triaged this task as Normal 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 Normal 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.

Niharika claimed this task.Apr 20 2017, 5:44 PM
Niharika moved this task from Ready to In Development on the Community-Tech-Sprint board.

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

Niharika closed this task as Resolved.Apr 21 2017, 11:36 PM
Niharika moved this task from Needs Review/Feedback to Q1 2018-19 on the Community-Tech-Sprint board.
DannyH moved this task from Untriaged to Archive on the Community-Tech board.Apr 25 2017, 2:56 AM