Upgrade Warnings in OJS 3.3.0.21: Missing Columns and DB Compliance Issues

Hi,

I recently upgraded my Open Journal Systems installation from version 3.2.1.4 to 3.3.0.21. The update completed successfully, and the system appears to be functioning normally. However, during the upgrade process, several errors related to missing columns were logged, particularly involving the object_for_review_settings table and the setting_name column.

Before I was able to complete the upgrade successfully, I had to follow certain steps to handle errors during the update process. Specifically, I executed the upgrade CLI script, and on encountering errors, I restored the database from backup and corrected the root causes before trying again.

Additionally, before starting the upgrade, I made sure to convert all database tables from MyISAM to the InnoDB engine. This is a requirement for OJS 3.3.x, which requires all tables to be InnoDB and the database user to have the REFERENCES privilege.

Here are the steps I followed:

Run the upgrade and handle errors:

Description: Run the upgrade script via CLI. On error, log the message, restore the database dump, and fix the cause before retrying.

php tools/upgrade.php upgrade

Note: Always restore the backup of the database if an error occurs during the upgrade process.

Delete and recreate the database:

mysql -u example_user -p -e “DROP DATABASE IF EXISTS example_database; CREATE DATABASE example_database CHARACTER SET utf8 COLLATE utf8_general_ci;”

Restore the database backup:

mysql -u example_user -p example_database < ~/backup-ojs-3.2.1.4/ojs-db-backup.sql

Database error encountered:

ERROR: Upgrade failed: DB: SQLSTATE[01000]: Warning: 1265 Data truncated for column ‘review_round_id’ at row 1 (SQL: ALTER TABLE review_assignments CHANGE review_round_id review_round_id BIGINT NOT NULL)

Diagnosed the cause:

mysql -u example_user -p example_database -e “SELECT review_round_id, COUNT(*) as total FROM review_assignments GROUP BY review_round_id ORDER BY total DESC;”

Result:

±----------------±------+
| review_round_id | total |
±----------------±------+
| NULL | 1 |
±----------------±------+

Fix to resolve the problem:

mysql -u example_user -p example_database -e “DELETE FROM review_assignments WHERE review_round_id IS NULL;”

During the upgrade process, these error messages were logged:

Failed to migrate the settings entity “object_for_review_settings”
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘setting_name’ in ‘field list’ in /var/www/html/revistas/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:80

Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘setting_name’ in ‘field list’ (SQL: select setting_name, setting_value, s.* from object_for_review_settings as s where setting_type = object)

While these errors did not cause the upgrade to fail outright, they are concerning, and I want to ensure my installation is fully compliant and stable.

Has anyone else experienced similar errors during upgrades? What steps would you suggest to resolve or avoid these warnings?

Thank you for your support.

Hi @Kelvin,

The objects_for_review_settings table is related to the no-longer-maintained “Objects for Review” plugin for OJS 2.x; it’s not used in 3.x. Were you using that plugin? If not, you should be able to remove that table before running the upgrade, and it’ll resolve the error.

Are you sure you got an “upgrade completed successfully” message at the end of the upgrade process? What version does OJS self-report if you look e.g. at the page source?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thanks for your reply!

Yes, at the end of the upgrade process I received the confirmation message:

Successfully upgraded to version 3.3.0.21

Also, I checked using the CLI commands:

php tools/upgrade.php check
Code version: 3.3.0.21
Database version: 3.2.1.4
Latest version: 3.5.0.0
Database version is older than code version
Run “tools/upgrade.php upgrade” to update

php -d memory_limit=2048M tools/upgrade.php upgrade | tee -a upgrade.log

I performed this upgrade in a test environment. Now, I will try again, removing the object_for_review_settings table as you suggested. Regarding the plugin, I was not using it in the previous version; as far as I know, we do not use this kind of peer review here—only the regular editorial workflow.

Despite the warnings related to the object_for_review_settings table, the upgrade completed and the system shows version 3.3.0.21 in the admin panel, see:

Based on your advice, I understand these errors are related to the deprecated “Objects for Review” plugin from OJS 2.x. Since we do not use that plugin, I will consider removing the object_for_review_settings table before future upgrades.

Thanks for the clarification and support!

Hi @asmecher,

Thank you again for your guidance!
After your response, I reverted my test installation by restoring both the OJS code and the database backups. Then, I repeated the upgrade from version 3.2.1.4 to 3.3.0.21, this time including the step to drop the object_for_review_settings table before starting the process.

The result was a completely clean and successful upgrade: no errors or warnings appeared during the upgrade, and the admin panel now shows version 3.3.0.21 running smoothly.

I confirm that we were not using the “Objects for Review” plugin previously; our editorial workflow is standard.
Your recommendation solved the issue, and the environment is now fully compliant.

Thanks for the support!

1 Like

Hi @Kelvin,

Glad to hear it’s working!

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 13 days. New replies are no longer allowed.