Topic on Project:Support desk

Upgrading from 1.22.15 to 1.33.0: "is usable, cannot create an anonymous actor"

5
4ShadesSEOW (talkcontribs)

Hi everyone,

I am trying to upgrade an old (v.1.22.15 on PHP5.7 and mysql) mediawiki to MW1.33.0 on PHP7.3.9. I have done this successfully for 2 different wikis today, but on the third wiki it fails at the "Upgrade existing installation" stage, with the following errors:


maintenance/migrateActors.php.

Creating actor entries for all registered users

... 1 - 72

Completed actor creation, added 5 new actor(s)

Beginning migration of revision.rev_user and revision.rev_user_text to revision_actor_temp.revactor_actor

... rev_id=100

... rev_id=201

... rev_id=302

... rev_id=402

User name "4Shades" is usable, cannot create an anonymous actor for it. Run maintenance/cleanupUsersWithNoId.php to fix this situation.

... plus many more lines like this, then

An error occurred:

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: INSERT  INTO `actor` (actor_name) VALUES ('')

Function: MigrateActors::addActorsForRows

Error: 1062 Duplicate entry '' for key 'actor_name' (localhost)


I have tried opening a shell and running the script maintenance/cleanupUsersWithNoId.php but it crashes immediately. Can anyone give me any pointers here? I am happy to edit tables etc manually if need be. Perhaps I just need to kill all edit archive records to remove anonymous users from the DB and restart the conversion?

Many thanks in advance,

4Shades


Bawolff (talkcontribs)

> I have tried opening a shell and running the script maintenance/cleanupUsersWithNoId.php but it crashes immediately.

Does it give any error? If not, what is the exit code (checkable by running echo $? immediately after the script exits).

4ShadesSEOW (talkcontribs)

Here is the output of cleanupUsersWithNoId.php


Parse error: syntax error, unexpected '?' in E:\Apache2.4.41\htdocs\mediawiki-1.33.0\maintenance\Maintenance.php on line 882

Call Stack:

   0.0004     274552   1. {main}() E:\Apache2.4.41\htdocs\mediawiki-1.33.0\maintenance\cleanupUploadStash.php:0


The echo $? command outputs "$?".

4ShadesSEOW (talkcontribs)

Found the source of the PHP error on cleanupUsersWithNoId.php - I was referencing the older PHP version in the PATH. Referencing PHP7.3.9 instead makes that error go away.

4ShadesSEOW (talkcontribs)

Having executed cleanupUsersWithNoId.php successfully I can complete the upgrade script ok.

Reply to "Upgrading from 1.22.15 to 1.33.0: "is usable, cannot create an anonymous actor""