Error when upgrading from OJS 3.3.0-21 to 3.4.0-9: Duplicate entry in user_settings

Hello,

I’m encountering a problem while upgrading from OJS 3.3.0-21 to 3.4.0-9. The upgrade fails with the following error:

Could not make the query numbered: 0  
MySQL Error No: 1062  
Duplicate entry '1-en-familyName-0-0' for key 'user_settings.user_settings_pkey'

To investigate, I ran the following query to check for duplicate rows:

SELECT user_id, locale, setting_name, assoc_type, assoc_id, COUNT(*)
FROM user_settings
WHERE user_id = 1 AND setting_name = 'familyName'
GROUP BY user_id, locale, setting_name, assoc_type, assoc_id
HAVING COUNT(*) > 1;

However, this returned no results, which suggests that there are no exact duplicates for that key combination.

I’m not sure how to proceed, since the upgrade still fails due to a duplicate key conflict. Any guidance or suggestions would be appreciated.

Thank you!

Hi @Unce,

Here is a similar thread you might review:

In short, OJS 3.3.0-x used en_US as a locale code for English, and starting with 3.4.0-x, we use en instead. However, your database seems to already contain some data with the en locale code. Did you attempt an upgrade that failed? If so, you’ll need to restore from backup to a “clean” 3.3.0-x database.

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 13 days. New replies are no longer allowed.