A database error has occurred: Duplicate entry 'JQueryPlugin-0-enabled' for key 'plugin_settings_pkey'

OK is this what you are looking for?
[root@OJSServer ojs3]# php tools/upgrade.php upgrade

(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’


(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’


(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’


(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’


(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’


(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’

[pre-install]

(mysql): SELECT * FROM versions WHERE current = 1


(mysql): SELECT * FROM versions WHERE current = 1 AND product_type = ‘core’ AND product = ‘ojs2’

[load: upgrade.xml]
[version: 2.4.8.1]
[schema: lib/pkp/xml/schema/signoff.xml]

(mysql): select version()


(mysql): SHOW INDEX FROM signoffs


(mysql): SHOW COLUMNS FROM signoffs


(mysql): SHOW COLUMNS FROM signoffs


(mysql): DROP INDEX signoff_symbolic ON signoffs


(mysql): ALTER TABLE signoffs MODIFY COLUMN signoff_id BIGINT NOT NULL AUTO_INCREMENT


(mysql): ALTER TABLE signoffs MODIFY COLUMN symbolic VARCHAR(32) NOT NULL


(mysql): ALTER TABLE signoffs MODIFY COLUMN assoc_type BIGINT NOT NULL DEFAULT 0


(mysql): ALTER TABLE signoffs MODIFY COLUMN assoc_id BIGINT NOT NULL DEFAULT 0


(mysql): ALTER TABLE signoffs MODIFY COLUMN user_id BIGINT NOT NULL


(mysql): ALTER TABLE signoffs MODIFY COLUMN file_id BIGINT


(mysql): ALTER TABLE signoffs MODIFY COLUMN file_revision BIGINT


(mysql): ALTER TABLE signoffs MODIFY COLUMN date_notified DATETIME


(mysql): ALTER TABLE signoffs MODIFY COLUMN date_underway DATETIME


(mysql): ALTER TABLE signoffs MODIFY COLUMN date_completed DATETIME


(mysql): ALTER TABLE signoffs MODIFY COLUMN date_acknowledged DATETIME


(mysql): ALTER TABLE signoffs MODIFY COLUMN user_group_id BIGINT


(mysql): ALTER TABLE signoffs ADD UNIQUE INDEX signoff_symbolic (assoc_type, assoc_id, symbolic, user_id, user_group_id, file_id, file_revision)

[data: dbscripts/xml/upgrade/2.3.3_preupdate1.xml]

(mysql): SHOW TABLES


(mysql): select version()


(mysql): SHOW COLUMNS FROM review_assignments


(mysql): SHOW COLUMNS FROM review_rounds


(mysql): SHOW COLUMNS FROM comments

ojs2 has produced an error
Message: WARNING: assert(): Assertion failed
In file: /var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php
At line: 155
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.4.16
Apache Version: N/A
DB Driver: mysql
ojs2 has produced an error
Message: WARNING: assert(): Assertion failed
In file: /var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php
At line: 155
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.4.16
Apache Version: N/A
DB Driver: mysql
ojs2 has produced an error
Message: WARNING: assert(): Assertion failed
In file: /var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php
At line: 155
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.4.16
Apache Version: N/A
DB Driver: mysql

(mysql): ALTER TABLE article_notes CHANGE COLUMN article_id assoc_id

1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1
ADOConnection._Execute(ALTER TABLE article_notes CHANGE COLUMN article_id assoc_id , false)% line 864, file: /var/www/html/ojs3/lib/pkp/lib/adodb/adodb.inc.php
ADOConnection.Execute(ALTER TABLE article_notes CHANGE COLUMN article_id assoc_id )% line 452, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(ALTER TABLE article_notes CHANGE COLUMN article_id assoc_id )% line 447, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(Array[1])% line 447, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(Array[3])% line 400, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
ERROR: Upgrade failed: DB: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1
[root@OJSServer ojs3]#

Hi @smithmich,

Your old installation is still OJS 2.3.2, correct? Can you check whether your article_notes table in the database contains article_id or assoc_id columns?

Regards,
Alec Smecher
Public Knowledge Project Team

I don’t show an article_notes table in the database.
mysql> show tables;
±--------------------------------------+
| Tables_in_sbij |
±--------------------------------------+
| access_keys |
| announcement_settings |
| announcement_type_settings |
| announcement_types |
| announcements |
| article_comments |
| article_files |
| article_galley_settings |
| article_galleys |
| article_galleys_stats_migration |
| article_html_galley_images |
| article_search_keyword_list |
| article_search_object_keywords |
| article_search_objects |
| article_settings |
| article_supp_file_settings |
| article_supplementary_files |
| article_xml_galleys |
| articles |
| auth_sources |
| author_settings |
| authors |
| captchas |
| citation_settings |
| citations |
| comments |
| completed_payments |
| controlled_vocab_entries |
| controlled_vocab_entry_settings |
| controlled_vocabs |
| counter_monthly_log |
| custom_issue_orders |
| custom_section_orders |
| data_object_tombstone_oai_set_objects |
| data_object_tombstone_settings |
| data_object_tombstones |
| edit_assignments |
| edit_decisions |
| email_log |
| email_log_users |
| email_templates |
| email_templates_data |
| email_templates_default |
| email_templates_default_data |
| event_log |
| event_log_settings |
| external_feed_settings |
| external_feeds |
| filter_groups |
| filter_settings |
| filters |
| gifts |
| group_memberships |
| group_settings |
| groups |
| institutional_subscription_ip |
| institutional_subscriptions |
| issue_files |
| issue_galley_settings |
| issue_galleys |
| issue_settings |
| issues |
| journal_settings |
| journals |
| metadata_description_settings |
| metadata_descriptions |
| metrics |
| mutex |
| notes |
| notification_mail_list |
| notification_settings |
| notification_subscription_settings |
| notifications |
| oai_resumption_tokens |
| paypal_transactions |
| plugin_settings |
| processes |
| published_articles |
| published_articles_stats_migration |
| queued_payments |
| referral_settings |
| referrals |
| review_assignments |
| review_form_element_settings |
| review_form_elements |
| review_form_responses |
| review_form_settings |
| review_forms |
| review_rounds |
| roles |
| rt_contexts |
| rt_searches |
| rt_versions |
| scheduled_tasks |
| section_editors |
| section_settings |
| sections |
| sessions |
| signoffs |
| site |
| site_settings |
| static_page_settings |
| static_pages |
| subscription_type_settings |
| subscription_types |
| subscriptions |
| temporary_files |
| theses |
| user_interests |
| user_settings |
| users |
| versions |
±--------------------------------------+
112 rows in set (0.00 sec)

mysql>

Hi @smithmich,

You’re looking in the database loaded from the OJS 2.3.2 dump, before the upgrade is performed, correct? I’m afraid we’re running up against database corruption of some kind again; a healthy OJS 2.3.2 installation should definitely include an article_notes table.

I’m at a bit of a loss what to suggest – I don’t have any idea what the upgrade history of that installation is, but for a whole table to be missing is pretty dire. Do you have any idea what might have caused this?

Regards,
Alec Smecher
Public Knowledge Project Team

I was looking at the database after trying to upgrade it. Looking at the original database it does have an article_notes table. In it is an article_id column. Sorry about that.

Hi @smithmich,

Thanks. And just confirming – the above error message is what you get the first time you run an upgrade against the original 2.x database? Or is it after an upgrade attempt has failed?

Regards,
Alec Smecher
Public Knowledge Project Team

That was in fact after an upgrade attempt. Should I restore the original database and try the upgrade again with logging enabled?

Hi @smithmich,

Yes – every failed upgrade will leave the database in an inconsistent state, so you always need to restore from backup after a failed upgrade.

Regards,
Alec Smecher
Public Knowledge Project Team

I restored the original database and ran the command. There was too much output to capture it all but this was at the end.
(mysql): UPDATE published_articles SET date_published = NULL WHERE date_published = ‘0000-00-00 00:00:00’

1292: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date_published’ at row 1
ADOConnection._Execute(UPDATE published_articles SET date_published = NULL WHERE date_published = ‘0000-00-00 00:00:00’, false)% line 864, file: /var/www/html/ojs3/lib/pkp/lib/adodb/adodb.inc.php
ADOConnection.Execute(UPDATE published_articles SET date_published = NULL WHERE date_published = ‘0000-00-00 00:00:00’)% line 452, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(UPDATE published_articles SET date_published = NULL WHERE date_published = ‘0000-00-00 00:00:00’)% line 447, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(Array[2])% line 400, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
Installer.executeAction(Array[3])% line 269, file: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php
ERROR: Upgrade failed: DB: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date_published’ at row 1
[root@OJSServer ojs3]#

Hi @smithmich,

That’s Incorrect datetime value · Issue #1788 · pkp/pkp-lib · GitHub, which has already been fixed, and affects certain versions of MySQL. You can apply the fix by making this change, or, if you’re comfortable using the standard patch tool, applying this patch. They’re equivalent.

Then, as always, restore from backup and re-run the upgrade. Note that you can turn off the debug option until we need it again to drop the amount of output waaaay down.

Regards,
Alec Smecher
Public Knowledge Project Team

Do I just edit the 2.4.2_update.xml file and replace the content with what you provided in the first link?

Hi @smithmich,

That link describes editing dbscripts/xml/upgrade/2.4.2_update.xml, removing one line (the one in red), and adding two in its place (the ones in green). The leading + and - characters are not part of the code; they just indicate additions and removals.

Regards,
Alec Smecher
Public Knowledge Project Team

Great. The upgrade to 2.4.8 was successful. I will try upgrading to 3.0.2 tomorrow.

1 Like

Hi asmecher,
I just found out that I can not login as the site administrator after the upgrade. It just says invalid username or password.

Hi @smithmich,

Does your old config.inc.php specify the same value as the new one for the encryption setting?

Regards,
Alec Smecher
Public Knowledge Project Team

The old one used sha1, the new one says md5

Hi @smithmich,

That’s your problem; you need to keep the same setting or your old logins won’t work.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks for your help. I have upgraded to version 3.0.1 now and turned the site over to my site administrator. If he runs into any trouble I will open a new thread if that is what I should do.