Page MenuHomePhabricator

Make failures on foreachwiki more obvious the deployer
Open, Needs TriagePublic

Description

In T209674, a table failed to be created on a wiki. This happened because the deployer did not notice the failure on that wiki when using foreachwiki.

To combat this problem, the failures should be more obvious to the deployer.

Perhaps the failures could be gathered and displayed at the end?

Event Timeline

Perhaps the failures could be gathered and displayed at the end?

What's a "failure"?

As mentioned at T209674#4754656, it seems unlikely that the generic foreachwiki script will be able to detect and gather actual error messages from scripts. But it should be reasonable for it to report a list of the wikis for which the script exited with a non-zero status.

Alternatively, a rewrite of maintenance script running along the lines of T99268: RfC: Create a proper command-line runner for MediaWiki maintenance tasks might include the behavior of foreachwiki in the runner itself, in which case it could be possible to specifically collect exceptions and calls to a fatalError() method.

What's a "failure"?

My point is that (from my limited understanding) that this was a UX problem, not a User error. I think we should resolve the UX issue for deployers. (I am not a deployer, so I don't know what that resolution would look like).

jijiki triaged this task as Medium priority.Dec 4 2018, 10:08 PM
greg raised the priority of this task from Medium to Needs Triage.Dec 4 2018, 10:20 PM
greg removed a project: SRE.

I'd support the proposed outcome by @Anomie of capturing the IDs of wikis for which the script produced errors (not the errors themselves).

Perhaps something like the below (where the lines after the last --- are currently missing)

aawikieg: Running...
aawikieg: Done.
---
bbwikieg: Running...
bbwikieg: Unable to apply update X.
bbwikieg: Done.
---
ccwikieg: Running...
ccwikieg: Fatal Exception: X
#1 /srv/mediawiki/php/maintenance/foo.php
#0 main
---
ddwikieg: Running...
ddwikieg: Done.
---

ERROR: The command failed on the following wikis:

* bbwikieg (Failed)
* ccwikieg (Failed; exit code 255)

Note that foreachwiki would only be able to know that bbwikieg failed if the maintenance script exits with a non-zero code. The mocked-up log saying "Done" after that hints that it probably didn't do so.