Error while upgrading 3.1.1.0 to 3.1.1-4 under addPluginVersions

Hi everyone,

I am upgrading one of our instances from 3.1.1.0 to 3.1.1-4 and facing a problem. Please note the error below:

php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.1.1.4]
[code: Installer Installer::checkPhpVersion]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be         skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
PHP Warning:  Invalid argument supplied for foreach() in /path_to_installation/v3.1.1-4/lib/pkp/classes/navigationMenu/NavigationMenuItemDAO.inc.php on line 377
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[code: Installer Installer::migrateSRLocale]
[code: Installer Installer::migrateNOLocale]
[note: docs/release-notes/README-3.1.1]
[code: Installer Installer::addPluginVersions]
<h1>DB Error: Duplicate entry 'plugins.generic-acron-1-2-0-0' for key 'versions_pkey'</h1>ojs2: DB     Error: Duplicate entry 'plugins.generic-acron-1-2-0-0' for key 'versions_pkey'

Please note I have cleaned the new database to the exact state of the old version to avoid interference of running the upgrade on broken DBs.

Any indication on how to solve this issue and/or how to debug it, will be appreciated.

Thanks in advance

Hey @rafaels

Maybe uninstall the acron plugin before the upgrade?

If that doesn’t work, if you have everything backed up, you could try deleting the row in the “versions” table that corresponds to the acron plugin. (delete from versions where product = ‘acron’) and see how the upgrade goes after that. You may also need to do the same to the plugin_settings table where the plugin_name column is “acronplugin”.

Cheers,
Jason

Thank you very much for your assistance, @jnugent!

The issue was happening not only with this listing of the plugin, but with a few more. The listing on the DB had a couple of versions of acron and only the latest version had the column versions.current set as 1. In order to be able to run the upgrade, I made:

DELETE FROM versions WHERE current=0;

I was assigned to the maintenance of these OJS instances recently, so I am not very familiar with its structure yet. But if this solution of mine has any downside, please let me know.

Once again, thank you very much for the assistance.

Best regards,

Rafael