Search code examples
mediawiki

Unable to login to a local MediaWiki instance after having created a new user with the createAndPromote maintenance script


I'm running a local MediaWiki instance in a container and everything looks fine except for the creation of user accounts.

I'm using the following command to create a new account:

docker exec -it mediawiki-mediawiki-1 php /var/www/html/maintenance/run.php createAndPromote --force --sysop --bureaucrat --interface-admin New.Username change_password
wiki: Creating and promoting User:New.Username into sysop, bureaucrat, interface-admin...
done.
docker exec -it mediawiki-mediawiki-1 php /var/www/html/maintenance/run.php resetUserEmail New.Username [email protected]
Done!

Everything looks ok, but trying to login I get the error: Incorrect username or password entered. Please try again..

What am I missing or how can I debug this problem?

MediaWiki: 1.40.0 PHP: 8.1.22 ICU: 72.1 MariaDB: 11.0.3-MariaDB-1:11.0.3+maria~ubu2204


Solution

  • resetUserEmail.php (without the --no-reset-password flag) sets a random password, as the script is normally used in the case of malicious account takeovers.