deleteDefaultMessages.php doesn't seem to work, because it tries to add the bot group to the user "MediaWiki default".
Instead of being a system user, "MediaWiki default" seems to be an anon actor, so you can't add groups to it. And you can change to User::newSystemUser because than there is a duplicate key in actor table.
Complaint originally at: https://www.mediawiki.org/w/index.php?title=Topic:V9jdyxvfc2xxlnts
Steps to reproduce
- Create some dummy message by the default user:
echo 'test' | php edit.php -u 'MediaWiki default' 'MediaWiki:Test'
- run php deleteDefaultMessages.php
Expected behaviour: It works. Actual behaviour: UnexpectedValueException from line 162 of /var/www/html/w/includes/user/UserGroupMembership.php: UserGroupMembership::insert() needs a positive user ID. Perhaps addGroup() was called before the user was added to the database.