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

Can you point me to where I would find the error message? Like I mentioned earlier, the upgrade to version 2.3.2 was successful and I could access the site. It is trying to upgrade to 2.4.8 where it is failing.

Hi @smithmich,

A healthy OJS 2.3.2 installation will contain a database table called article_event_log table. The only reason I can think that it wouldn’t, as per the other thread, is if someone tried to upgrade the install to a newer version (which renames/deletes that table), but the upgrade failed, and the site continued to be used in an inconsistent state after the failed upgrade. Is that a possibility?

Regards,
Alec Smecher
Public Knowledge Project Team

I got a copy of the database that had is supposed to be correct and got passed that error. Now I get this error:
A database error has occurred: 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. I am running mysql version 5.7.17.

Hi @smithmich,

The lack of context in that error message makes it a little difficult to interpret. One way to get more context is to run the upgrade with the “debug” option turned on; this will cause all DB queries to be dumped as they’re executed, and the last one you see should be the problem query. When re-running a failed upgrade, make sure to restore your database and files area first.

If you’re using the web-based upgrade tool, consider using the command-line one instead. It’ll provide more information.

Regards,
Alec Smecher
Public Knowledge Project Team

When I try to run the upgrade.php I get access denied. I am logged in as root. I was reading similar cases and they suggest clearing the cache. Do you know where the cache is located?

Hi @smithmich,

Hmm, you shouldn’t get an “access denied” if you’re running as root. Could you post a screenshot? I’m not sure this is cache-related.

Regards,
Alec Smecher
Public Knowledge Project Team

This is a screen shot. I’m pretty sure the permissions are correct on the upgrade.php file.

Hi @smithmich,

Try running that from the OJS installation directory, rather than the tools subdirectory. (The tools part is already specified in the first parameter to the php binary.)

Make sure, as always, that you’ve got a good backup of your database and files area, and if you hit a problem, capture the output of the upgrade command so you can post it here.

Regards,
Alec Smecher
Public Knowledge Project Team

OK that worked but I got this output.
[root@OJSServer ojs3]# php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.8.1]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate1.xml]
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
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

Hi @smithmich,

Try my earlier suggestion regarding the debug option.

Regards,
Alec Smecher
Public Knowledge Project Team

Which debug options should I turn on and where will the output be?

Hi @smithmich,

The debug option is in the config.inc.php configuration file. While that option is enabled, database queries will be dumped by OJS however it’s executed – either to the website for web-based interaction or on the terminal for terminal-based interaction (as you’re now doing).

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, I have turned on show_stacktrace and rerun the upgrade.php command. This is the output:
[root@OJSServer ojs3]# php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.8.1]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate1.xml]
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:
File: (unknown) line (unknown)
Function: PKPApplication->errorHandler(2, “assert(): Assertion failed”, “/var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php”, 155, Array(12))
File: /var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php line 155
Function: assert(False)
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 396
Function: DBDataXMLParser->parseData(“dbscripts/xml/upgrade/2.3.3_preupdate1.xml”)
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 269
Function: Installer->executeAction(Array(3))
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 190
Function: Installer->executeInstaller()
File: /var/www/html/ojs3/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 87
Function: Installer->execute()
File: /var/www/html/ojs3/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 63
Function: UpgradeTool->upgrade()
File: /var/www/html/ojs3/tools/upgrade.php line 34
Function: UpgradeTool->execute()
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:
File: (unknown) line (unknown)
Function: PKPApplication->errorHandler(2, “assert(): Assertion failed”, “/var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php”, 155, Array(12))
File: /var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php line 155
Function: assert(False)
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 396
Function: DBDataXMLParser->parseData(“dbscripts/xml/upgrade/2.3.3_preupdate1.xml”)
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 269
Function: Installer->executeAction(Array(3))
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 190
Function: Installer->executeInstaller()
File: /var/www/html/ojs3/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 87
Function: Installer->execute()
File: /var/www/html/ojs3/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 63
Function: UpgradeTool->upgrade()
File: /var/www/html/ojs3/tools/upgrade.php line 34
Function: UpgradeTool->execute()
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:
File: (unknown) line (unknown)
Function: PKPApplication->errorHandler(2, “assert(): Assertion failed”, “/var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php”, 155, Array(12))
File: /var/www/html/ojs3/lib/pkp/classes/db/DBDataXMLParser.inc.php line 155
Function: assert(False)
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 396
Function: DBDataXMLParser->parseData(“dbscripts/xml/upgrade/2.3.3_preupdate1.xml”)
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 269
Function: Installer->executeAction(Array(3))
File: /var/www/html/ojs3/lib/pkp/classes/install/Installer.inc.php line 190
Function: Installer->executeInstaller()
File: /var/www/html/ojs3/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 87
Function: Installer->execute()
File: /var/www/html/ojs3/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 63
Function: UpgradeTool->upgrade()
File: /var/www/html/ojs3/tools/upgrade.php line 34
Function: UpgradeTool->execute()
Server info:
OS: Linux
PHP Version: 5.4.16
Apache Version: N/A
DB Driver: mysql
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

Hi @smithmich,

That’s the show_stacktrace option; I was looking for the output from the debug option.

Regards,
Alec Smecher
Public Knowledge Project Team

I set display_errors to On and ran the command. This is the output now.
[root@OJSServer ojs3]# php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 2.4.8.1]
[schema: lib/pkp/xml/schema/signoff.xml]
[data: dbscripts/xml/upgrade/2.3.3_preupdate1.xml]
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

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
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

Hi @smithmich,

Sorry, that’s still not the right setting – you need to turn on the debug option. It’s in the [database] section. :slight_smile:

Regards,
Alec Smecher
Public Knowledge Project Team

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