Page MenuHomePhabricator

"Can't use the request user for storage with IP masking enabled" when doing a null edit without a temporary account
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

If I am on a wiki anonymously and without a temporary account and I attempt a null edit, I see the below error:

[Y8gf6fZWmsIOsM8IfogQkwAAAAE] /w/index.php?action=submit&title=Lausanne MWException: Can't use the request user for storage with IP masking enabled

Backtrace:

from /srv/mediawiki/php-master/includes/EditPage.php(916)
#0 /srv/mediawiki/php-master/includes/EditPage.php(2764): EditPage->getUserForSave()
#1 /srv/mediawiki/php-master/includes/EditPage.php(2636): EditPage->updateWatchlist()
#2 /srv/mediawiki/php-master/includes/EditPage.php(1918): EditPage->internalAttemptSave(array, boolean, boolean)
#3 /srv/mediawiki/php-master/includes/EditPage.php(729): EditPage->attemptSave(array)
#4 /srv/mediawiki/php-master/includes/actions/EditAction.php(73): EditPage->edit()
#5 /srv/mediawiki/php-master/includes/actions/SubmitAction.php(38): EditAction->show()
#6 /srv/mediawiki/php-master/includes/MediaWiki.php(551): SubmitAction->show()
#7 /srv/mediawiki/php-master/includes/MediaWiki.php(328): MediaWiki->performAction(Article, Title)
#8 /srv/mediawiki/php-master/includes/MediaWiki.php(915): MediaWiki->performRequest()
#9 /srv/mediawiki/php-master/includes/MediaWiki.php(571): MediaWiki->main()
#10 /srv/mediawiki/php-master/index.php(50): MediaWiki->run()
#11 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#12 /srv/mediawiki/w/index.php(3): require(string)
#13 {main}

I can save an edit successfully if I modify the article before saving or if I already have a temporary account (or am logged in as a normal user).

I have reproduced this on beta (https://de.wikipedia.beta.wmflabs.org) and locally (docker).

Steps to reproduce problem
  1. Go to https://de.wikipedia.beta.wmflabs.org and check you don't already have a temporary account (if you do you will see a username in the top right such as *Unregistered 1234)
    1. If you do have a temporary account, clear your cookies or create a new browser profile or open a different browser
  2. Open the wikisource editor for any article (e.g. https://de.wikipedia.beta.wmflabs.org/w/index.php?title=Lausanne&action=edit)
  3. Do not change anything, just click Publish (or Seite speichern)
Environment

Browser: Firefox 91, 102
Wiki(s): https://de.wikipedia.beta.wmflabs.org MediaWiki 1.40.0-alpha (8080471) 11:01, 18 January 2023.

Event Timeline

Ammarpad changed the task status from Open to In Progress.Jun 22 2023, 5:48 PM
Ammarpad claimed this task.

Change 932318 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] IP Masking: Abort temp user creation when no revision will be created

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

Change 932348 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] Don't attempt to update the watchlist if temp user creation is active

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

Change 932318 abandoned by Bartosz Dziewoński:

[mediawiki/core@master] IP Masking: Abort temp user creation when no revision will be created

Reason:

Tim's patch should be sufficient

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

Change 932348 merged by jenkins-bot:

[mediawiki/core@master] Don't attempt to update the watchlist if temp user creation is active

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

matmarex reassigned this task from Ammarpad to tstarling.