ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'statistic-21-blockTitle' for key 'plugin_settings_pkey'

Upgrade from OJS .3.1.1.4 to 3.1.2.4 to 3.2.1.4 to 3.3.0.13
I have managed the error from step upgrade, but on process upgrade to LTS Version its error

ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘statistic-21-blockTitle’ for key ‘plugin_settings_pkey’
(SQL: insert into plugin_settings (context_id, plugin_name, setting_name, setting_type, setting_value) values
(2, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(2, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(5, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(5, turnitin, blockTitle, object, a:1:{s:5:“en_US”;s:8:“turnitin”;}),
(5, usm-i, blockTitle, object, a:1:{s:5:“en_US”;s:5:“usm-i”;}),
(5, maps, blockTitle, object, a:1:{s:5:“en_US”;s:4:“maps”;}),
(5, statistik, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistik”;}),
(5, sertifikat_akreditasi, blockTitle, object, a:1:{s:5:“en_US”;s:21:“sertifikat_akreditasi”;}),
(6, sedebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sedebar”;}),
(6, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(7, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(7, indeks, blockTitle, object, a:1:{s:5:“en_US”;s:6:“indeks”;}),
(7, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(7, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}),
(7, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}),
(7, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}),
(7, sertifikat_akreditasi, blockTitle, object, a:1:{s:5:“en_US”;s:21:“sertifikat_akreditasi”;}),
(9, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(9, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(10, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(10, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(10, sinta5, blockTitle, object, a:1:{s:5:“en_US”;s:6:“sinta5”;}),
(12, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(12, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(12, indexing, blockTitle, object, a:1:{s:5:“en_US”;s:8:“indexing”;}),
(12, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}),
(12, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}),
(12, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}),
(12, sertifikatakreditasi, blockTitle, object, a:1:{s:5:“en_US”;s:20:“sertifikatakreditasi”;}),
(12, sidebarmenu, blockTitle, object, a:1:{s:5:“en_US”;s:11:“sidebarmenu”;}),
(12, akreditasi, blockTitle, object, a:1:{s:5:“en_US”;s:10:“akreditasi”;}),
(12, submit, blockTitle, object, a:1:{s:5:“en_US”;s:6:“submit”;}),
(12, issn, blockTitle, object, a:1:{s:5:“en_US”;s:4:“issn”;}),
(12, openaccesspolicy, blockTitle, object, a:1:{s:5:“en_US”;s:16:“openaccesspolicy”;}),
(12, maps, blockTitle, object, a:1:{s:5:“en_US”;s:4:“maps”;}),
(12, google-citation, blockTitle, object, a:1:{s:5:“en_US”;s:15:“google-citation”;}),
(13, detail, blockTitle, object, a:1:{s:5:“en_US”;s:6:“detail”;}),
(13, info, blockTitle, object, a:1:{s:5:“en_US”;s:4:“info”;}),
(13, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}),
(13, statistik, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistik”;}),
(13, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}),
(13, e-issn, blockTitle, object, a:1:{s:5:“en_US”;s:6:“e-issn”;}),
(14, detail, blockTitle, object, a:1:{s:5:“en_US”;s:6:“detail”;}),
(14, turnitin, blockTitle, object, a:1:{s:5:“en_US”;s:8:“turnitin”;}),
(14, usm-i, blockTitle, object, a:1:{s:5:“en_US”;s:5:“usm-i”;}),
(14, statistik, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistik”;}),
(15, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(15, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(16, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(16, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(16, maps, blockTitle, object, a:1:{s:5:“en_US”;s:4:“maps”;}),
(16, usm-i, blockTitle, object, a:1:{s:5:“en_US”;s:5:“usm-i”;}),
(17, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(17, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(17, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}),
(17, contact, blockTitle, object, a:1:{s:5:“en_US”;s:7:“contact”;}),
(17, wag, blockTitle, object, a:1:{s:5:“en_US”;s:3:“wag”;}),
(17, googlecitation, blockTitle, object, a:1:{s:5:“en_US”;s:14:“googlecitation”;}),
(19, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(19, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(20, details, blockTitle, object, a:1:{s:5:“en_US”;s:7:“details”;}),
(20, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(21, sedebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sedebar”;}),
(21, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(21, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(21, kerjasama, blockTitle, object, a:1:{s:5:“en_US”;s:9:“kerjasama”;}),
(22, sedebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sedebar”;}),
(22, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(22, kerjasama, blockTitle, object, a:1:{s:5:“en_US”;s:9:“kerjasama”;}),
(23, detail, blockTitle, object, a:1:{s:5:“en_US”;s:6:“detail”;}),
(23, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(23, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}),
(24, detail, blockTitle, object, a:1:{s:5:“en_US”;s:6:“detail”;}),
(24, statistik, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistik”;}),
(25, sedebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sedebar”;}),
(25, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(28, sidebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sidebar”;}))

I Try to find the custom block plugin by query :

SELECT * FROM plugin_settings WHERE plugin_name = “customblockmanagerplugin” and setting_name = “blocks”;

image

when I delete those 20 records the upgrade when successful, but all the customblock plugins content ond sidebar are missing

Anyonw have the same issue and solved the problem.

Hi @acahya

Given the duplicate issue is specific to which key is causing the error, have you tried to remove one of these rows and run the upgrade again?

(21, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),
(21, statistic, blockTitle, object, a:1:{s:5:“en_US”;s:9:“statistic”;}),

They seem to me as the only duplicated rows, and you could keep only one of them. Maybe it worth a try.

Best,
Israel