While upgrading a MediaWiki installation I ran into the error
Query: INSERT INTO `actor` (actor_name) VALUES ('RedirectBot') Function: MigrateActors::addActorsForRows Error: 1062 Duplicate entry 'RedirectBot' for key 'actor_name' (localhost) while running maintenance/upgrade.php. The problem bit quite a lot of people with older MediaWiki installations. And while the official bug report is mildly interesting to read, there hasn’t been a solution since July 2019.
In my case it was rather easy to identify the problem.