Hello
Apologies for the inconvenience. This kind of error actually means that you have been migrated to a database where fragments from previous unsuccessful attempts may remain. Can you try using a new database or clean the old one when restoring after unsuccessful attempts?
If you are testing the Joomla 4 upgrade, and you test and re-test on the same database, kindly make sure that you delete everything between each test.
Otherwise, the installer re-creates and re-inserts the same records on the tables that were created in the previous test, and then it fails with the error that you mentioned: "JInstaller: :Installer: Found SQL Duplicate entry '1' for key 'Primary'"
Additionally, if there was a previous failed attempt to upgrade to Joomla 4, there could be inconsistencies in the tables too.