Page MenuHomePhabricator

IP reveal: REST APIs throw an exception if site is in read only mode
Closed, ResolvedPublic1 Estimated Story Points

Description

Summary

When a site is in read only mode, the CheckUser IP reveal REST APIs will encounter an exception and return a 500 error with a stack trace. This should instead return a more user friendly error.

Background

  • When a user uses the CheckUser "Show IP" button, a REST API request is made to the IP reveal REST API
    • This request will create a log entry if the user has the permissions to perform the action
  • Inserting jobs on wikis may require writing to the DB, if the $wgJobTypeConf is configured to use the DB (which is the default)
    • This write will fail if the site is in read only mode
    • Even if the job is inserted, the write in the job will still fail
  • When in read-only mode we should return a more friendly 503 error

Acceptance criteria

  • CheckUser REST APIs return a user-friendly server error message when the site is in read only mode

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1123013 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] IP reveal: Return user friendly error when site in read only mode

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

Change #1123013 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] IP reveal: Return user friendly error when site in read only mode

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

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected (When a site is in read-only mode, and a user is viewing a page with the Show IP button (such as: Logs or Recent Changes or View History or IP Information), and then the user selects the Show IP button, it will display an error message).

image.png (363×676 px, 28 KB)

image.png (787×776 px, 43 KB)