Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘index-6-blockTitle’ for key ‘plugin_settings_pkey’

When trying to upgrade from OJS 3.2.1-4 to 3.3.0-11 TLS, I get the errors Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘index-6-blockTitle’ for key ‘plugin_settings_pkey

ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘index-6-blockTitle’ for key ‘plugin_settings_pkey’ (SQL: insert into plugin_settings (context_id, plugin_name, setting_name, setting_type, setting_value) values (1, menusidebar, blockTitle, object, a:1:{s:5:“en_US”;s:11:“menusidebar”;}), (1, flagcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“flagcounter”;}), (1, barcode, blockTitle, object, a:1:{s:5:“en_US”;s:7:“barcode”;}), (1, visitor, blockTitle, object, a:1:{s:5:“en_US”;s:7:“visitor”;}), (1, citednessinscopus, blockTitle, object, a:1:{s:5:“en_US”;s:17:“citednessinscopus”;}), (1, journaltemplate, blockTitle, object, a:1:{s:5:“en_US”;s:15:“journaltemplate”;}), (1, partnership, blockTitle, object, a:1:{s:5:“en_US”;s:11:“partnership”;}), (1, sinta_acredited, blockTitle, object, a:1:{s:5:“en_US”;s:15:“sinta_acredited”;}), (1, statindeks, blockTitle, object, a:1:{s:5:“en_US”;s:10:“statindeks”;}), (2, sidebarmenu, blockTitle, object, a:1:{s:5:“en_US”;s:11:“sidebarmenu”;}), (2, collapsepanel, blockTitle, object, a:1:{s:5:“en_US”;s:13:“collapsepanel”;}), (2, indexing, blockTitle, object, a:1:{s:5:“en_US”;s:8:“indexing”;}), (2, references, blockTitle, object, a:1:{s:5:“en_US”;s:10:“references”;}), (2, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (2, sertifikat, blockTitle, object, a:1:{s:5:“en_US”;s:10:“sertifikat”;}), (2, visitor, blockTitle, object, a:1:{s:5:“en_US”;s:7:“visitor”;}), (3, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (3, indexed, blockTitle, object, a:1:{s:5:“en_US”;s:7:“indexed”;}), (3, plagiarism, blockTitle, object, a:1:{s:5:“en_US”;s:10:“plagiarism”;}), (3, mendeley, blockTitle, object, a:1:{s:5:“en_US”;s:8:“mendeley”;}), (3, visitorcounter, blockTitle, object, a:1:{s:5:“en_US”;s:14:“visitorcounter”;}), (3, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (3, akreditasi, blockTitle, object, a:1:{s:5:“en_US”;s:10:“akreditasi”;}), (3, authorguidelines, blockTitle, object, a:1:{s:5:“en_US”;s:16:“authorguidelines”;}), (4, indexed, blockTitle, object, a:1:{s:5:“en_US”;s:7:“indexed”;}), (4, plagiarism, blockTitle, object, a:1:{s:5:“en_US”;s:10:“plagiarism”;}), (4, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (4, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (4, visitorflag, blockTitle, object, a:1:{s:5:“en_US”;s:11:“visitorflag”;}), (4, references, blockTitle, object, a:1:{s:5:“en_US”;s:10:“references”;}), (4, newsidebar, blockTitle, object, a:1:{s:5:“en_US”;s:10:“newsidebar”;}), (5, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (5, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (5, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}), (5, pict-akreditasi, blockTitle, object, a:1:{s:5:“en_US”;s:15:“pict-akreditasi”;}), (5, blank-1, blockTitle, object, a:1:{s:5:“en_US”;s:7:“blank-1”;}), (5, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (5, referensi, blockTitle, object, a:1:{s:5:“en_US”;s:9:“referensi”;}), (6, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (6, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (6, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}), (6, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (6, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (6, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (7, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (7, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (7, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}), (7, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (8, aboutjournal, blockTitle, object, a:1:{s:5:“en_US”;s:12:“aboutjournal”;}), (8, user, blockTitle, object, a:1:{s:5:“en_US”;s:4:“user”;}), (8, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (8, visitor, blockTitle, object, a:1:{s:5:“en_US”;s:7:“visitor”;}), (8, citation, blockTitle, object, a:1:{s:5:“en_US”;s:8:“citation”;}), (9, sidebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sidebar”;}), (9, newsidebar, blockTitle, object, a:1:{s:5:“en_US”;s:10:“newsidebar”;}), (10, plagiarism, blockTitle, object, a:1:{s:5:“en_US”;s:10:“plagiarism”;}), (10, articletemplate, blockTitle, object, a:1:{s:5:“en_US”;s:15:“articletemplate”;}), (10, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (10, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (10, refrence, blockTitle, object, a:1:{s:5:“en_US”;s:8:“refrence”;}), (10, issn, blockTitle, object, a:1:{s:5:“en_US”;s:4:“issn”;}), (10, gambar, blockTitle, object, a:1:{s:5:“en_US”;s:6:“gambar”;}), (11, aboutthejournal, blockTitle, object, a:1:{s:5:“en_US”;s:15:“aboutthejournal”;}), (11, issn, blockTitle, object, a:1:{s:5:“en_US”;s:4:“issn”;}), (11, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (11, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (11, flagcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“flagcounter”;}), (12, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (12, flagcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“flagcounter”;}), (12, tools, blockTitle, object, a:1:{s:5:“en_US”;s:5:“tools”;}), (12, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (12, issn, blockTitle, object, a:1:{s:5:“en_US”;s:4:“issn”;}), (12, index, blockTitle, object, a:1:{s:5:“en_US”;s:5:“index”;}), (13, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (13, upload, blockTitle, object, a:1:{s:5:“en_US”;s:6:“upload”;}), (13, plagirism, blockTitle, object, a:1:{s:5:“en_US”;s:9:“plagirism”;}), (13, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (13, reference, blockTitle, object, a:1:{s:5:“en_US”;s:9:“reference”;}), (13, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (13, bg, blockTitle, object, a:1:{s:5:“en_US”;s:2:“bg”;}), (13, e-issn, blockTitle, object, a:1:{s:5:“en_US”;s:6:“e-issn”;}), (13, indeks, blockTitle, object, a:1:{s:5:“en_US”;s:6:“indeks”;}), (13, indeks2, blockTitle, object, a:1:{s:5:“en_US”;s:7:“indeks2”;}), (14, menu_utama, blockTitle, object, a:1:{s:5:“en_US”;s:10:“menu_utama”;}), (14, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (14, plagiarism-detection, blockTitle, object, a:1:{s:5:“en_US”;s:20:“plagiarism-detection”;}), (14, reference_management, blockTitle, object, a:1:{s:5:“en_US”;s:20:“reference_management”;}), (14, visitor-counter, blockTitle, object, a:1:{s:5:“en_US”;s:15:“visitor-counter”;}), (14, call-editor, blockTitle, object, a:1:{s:5:“en_US”;s:11:“call-editor”;}), (15, menu, blockTitle, object, a:1:{s:5:“en_US”;s:4:“menu”;}), (15, menu_1, blockTitle, object, a:1:{s:5:“en_US”;s:6:“menu_1”;}), (16, sidemenu, blockTitle, object, a:1:{s:5:“en_US”;s:8:“sidemenu”;}), (16, counter, blockTitle, object, a:1:{s:5:“en_US”;s:7:“counter”;}), (16, plagiarism, blockTitle, object, a:1:{s:5:“en_US”;s:10:“plagiarism”;}), (16, rference, blockTitle, object, a:1:{s:5:“en_US”;s:8:“rference”;}), (16, uploadartikel, blockTitle, object, a:1:{s:5:“en_US”;s:13:“uploadartikel”;}), (17, sidebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sidebar”;}), (17, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (18, statcounter, blockTitle, object, a:1:{s:5:“en_US”;s:11:“statcounter”;}), (18, schoolar, blockTitle, object, a:1:{s:5:“en_US”;s:8:“schoolar”;}), (18, mainmenu, blockTitle, object, a:1:{s:5:“en_US”;s:8:“mainmenu”;}), (18, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (18, etichal, blockTitle, object, a:1:{s:5:“en_US”;s:7:“etichal”;}), (18, copyright, blockTitle, object, a:1:{s:5:“en_US”;s:9:“copyright”;}), (18, eissn, blockTitle, object, a:1:{s:5:“en_US”;s:5:“eissn”;}), (19, visitors, blockTitle, object, a:1:{s:5:“en_US”;s:8:“visitors”;}), (19, template, blockTitle, object, a:1:{s:5:“en_US”;s:8:“template”;}), (19, scholar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“scholar”;}), (19, analitic, blockTitle, object, a:1:{s:5:“en_US”;s:8:“analitic”;}), (19, sidebar, blockTitle, object, a:1:{s:5:“en_US”;s:7:“sidebar”;}))

To Reproduce:

  1. upgrade from Full Package
  2. run nohup php tools/upgrade.php upgrade > upgrade.log &

What application are you using?
OJS 3.3.0-11 TLS

Additional Information:
seem like plugin_settings reproduce duplicate value

Anyone could help me?

Hi @rovandi, Did you find a solution to your problem?

Hi @rovandi
I’m facing the same issue.
Not solved yet, but I think I’ve found where the issue originates:

  • check the plugin_settings table of the DB of your OJS 3.2.1-4 installation
  • look for the record whose plugin_name value is “customblockmanagerplugin”

SELECT * FROM plugin_settings WHERE plugin_name = "customblockmanagerplugin" and setting_name = "blocks"

  • check the content of the “setting_value” field: you will find a serialized array where the “index” value is repeated more times.

I think that this is a bug of the customBolckPlugin which saved multiple values for the same custom block plugin that you created.

I haven’t tried it yet, but I think that you can try to remove or disable the customBlockPlugin from your OJS before the upgrade and try to enable it after the upgrade.

I’ll let you know as soon ad I have done a test

Hi @rovandi, have a look at this:

could work for you.

Your Solution its work for me i delete all
image

but all custom block are empty
image

Hi @acahya .
Happy that it worked for you.

Yes, if you delete the settings for CustomBlockManager Plugin in the plugin_settings table
your custom blocks get lost.

To avoid it, you should edit the serialized content of the setting_value field.
But working on serialized content is very complicated.

So, the easiest, cleanest and quickest should be the following:

  • before you proceed with the upgrade make a copy of title and HTML content of any custom block used on your journal
  • remove the custom blocks form the journal’s pages (Should be in “Web site > Settings > Appearance”)
  • delete the custom blocks in the Custom Block plugin’s configuration.
  • execute the above query (SELECT * FROM plugin_settings WHERE plugin_name = “customblockmanagerplugin” and setting_name = “blocks”) and remove the resulting records (if any)

Then you can proceed with the OJS upgrade.

After upgrade is complete, re-create the content blocks using titles and HTML saved before and add the blocks to your journal’s pages.

Hope this helps.