Page MenuHomePhabricator

Impossible to mark revisions in FlaggedRevs after update to MW 1.38.1 (due to REST API configuration)
Closed, InvalidPublicBUG REPORT

Assigned To
None
Authored By
D3nnis3n
Jun 26 2022, 5:34 PM
Referenced Files
F35279856: image.png
Jun 27 2022, 8:23 AM
F35279850: image.png
Jun 27 2022, 8:23 AM
F35277607: image.png
Jun 26 2022, 5:34 PM

Description

Hey,
today we updated MW from 1.37.1 to 1.38.1 and did so as well with FlaggedRevs.

Since then it's no longer possible to mark any revisions. Console shows this for when pressing the "Submit" button. The button just grays out and nothing ever happens afterwards.

image.png (151×1 px, 27 KB)

Event Timeline

This is probably caused by ba3a7af8a09a, but there are actually two issues here:

  • The REST API returns a 404 status. This is probably due to incorrect configuration, so please ask at the MediaWiki support desk. (But you may want to look at the exact response to find out whether it’s really incorrect configuration—the web server doesn’t find the PHP script to execute—, or the API endpoint itself returns 404 for some reason.)
  • The submit button gets stuck because of the 404 response. This is a bug and should be fixed, but it’s not very severe as it wouldn’t come up if the configuration was correct.

Visual Editor works fine with the current configuration, when I use any of the rewrites Visual Editor doesn't work anymore. It's been a hell to get that working to begin with, so given no config was changed during the update I'm wondering why it ceased working with the update.

I can confirm that reverting to 1.37.2 and the stable FlaggedRevs for that version restores functionality without any configuration change.

Opening the URL it says errors with 404 gives the following result:

image.png (30×975 px, 4 KB)

I also tried to configure nginx with a redirect method I used a while ago that worked with VisualEditor but broke when 1.37.0 was released, and that leads to the file being downloaded to my computer, but the console spitting a 405 and the issue persisting. At the same time, as expected, Visual Editor is no longer functioning.

image.png (179×1 px, 29 KB)

I honestly don't want to fiddle with nginx configuration any more, it tooks weeks to get something fully functioning and I was active in all the many Visual Editor issues until I found what works.

I guess I will simply try to remove FlaggedRevs for now while keeping the data and temporarily use ApprovedRevs until some solution has been found. I'm rocksolid it's not a configuration problem with VisualEditor and other rest.api using features working fine and no configuration changes when updating plus reverting fixes everything.
Maybe it's a PHP8 issue, Visual Editor also had one until this version. Unfortunately our hosting provider has cancelled support for all versions before 8.

I found a potential solution, adding the following to the .htaccess for the pretty urls worked and leaves both Visual Editor and FlaggedRevs intact - of course I wasn't able to check if something else broke:
RewriteCond %{REQUEST_URI} !^/en/rest.php/.*$ [NC]

Sorry, I'm no professional, lots of trial and error. I just assumed that the problem might be rest.php requests being wrongly handled.
Interestingly, this part is not in the MediaWiki petty url recommendations.

Yes, for my specific configuration with a global wiki in root and several language wikis in subfolders the following will work for both FlaggedRevs and Visual Editor on all of the family wikis:

RewriteCond %{REQUEST_URI} !^.*/rest.php/.*$ [NC]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]

Just in case someone searches for a solution after having a similar problem, given my former configuration experiments seemingly had helped a few people with Visual Editor issues.
In my case, Apache with nginx reverse proxy no additional nginx config is required anymore. A potential reader will likely know more than I do, so maybe can work from there.

Sorry for the multiposts. I have no idea why this is required after newest MW and FlaggedRevs, as I said, basically trial and error on my side, but it now seemingly works. Before, it worked without that.
Guess indeed no issue of FlaggedRevs, sorry for the bad report. Really, I have no idea why it worked without this before.

Aklapper renamed this task from FlaggedRevs - Impossible to mark revisions after Update to MW 1.38.1 to Impossible to mark revisions in FlaggedRevs after update to MW 1.38.1 (due to REST API configuration).Feb 17 2023, 7:41 AM
Aklapper closed this task as Invalid.