"Unknown column 'setting_type'" error trying to upgrade from 3.0 to 3.3

I’m trying to upgrade from OJS 3.0 to 3.3, and have gotten a slew of errors from the upgrade.php script where I have to manually add/drop columns/indexes the script is expecting to find but doesn’t or doesn’t expect to find but does. But I can’t figure out what to do about the following error, since the script that’s flagged doesn’t contain the string “setting_type”:

PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'setting_type' in 'where clause' in /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:78
Stack trace:
#0 /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(78): PDO->prepare()
#1 /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(485): Doctrine\DBAL\Driver\PDOConnection->prepare()
#2 /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#3 /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback()
#4 /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(496): Illuminate\Database\Connection->run()
 in /opt/www/bollerreview.tcu.edu/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

This error is coming up even after restoring the database from backup from the before the first time the upgrade script failed.

-Kerry

HI @KerryBouchard,

It will be hard to identify the issue here. However, I’m concerned that you seem to have to be manually adding/removing columns. That shouldn’t be the case when running an upgrade and if it is, that suggests there may be a deeper problem with your system.

I’d suggest going back to your original system on 3.0 and trying to upgrade in segments, to better identify the problems you’re facing at each interval. Try upgrading first to 3.1.2-4, then to 3.2.1-4, then to 3.3.0-7.

Thank you, I’m finally getting back to this project.

    -Kerry

I was able to upgrade our version 3.0.0 OJS installation (a sandbox copy) that would only run under PHP5.4 to version 3.1.2-4 by running the /tools/upgrade.php script under PHP7.4. After going into the Plugin Gallery and upgrading the Bootstrap 3 Base Theme plugin the site uses, everything looked okay.

Then I repeated the process to upgrade from 3.1.2-4 to 3.2.1-4, updated the Bootstrap 3 Base Theme plugin, and again everything looked okay.

Today I tried to upgrade from 3.2.1-4 to 3.3.0-10. The upgrade script ran successfully, and the site came up in the state it looks like before the Bootstrap 3 plugin is added. However, after going in to the Administrative screens and upgrading the Bootstrap 3 theme, the public page of the site will no longer load - I just get an HTTP 500 error. The NGINX server log shows the following errors related to the Bootstrap Theme". Since it was able to run under PHP7.4 in the 3.1.2-4 and 3.2.1-4 versions, it’s strange to me that 3.3.0-10 would have a problem. Does anyone know if this is a PHP compatibility issue, or something else?

2022/04/12 13:13:57 [error] 27123#27123: *25328 FastCGI sent in stderr: "PHP message: PHP Warning: Use of undefined constant CDN_JQUERY_VERSION - assumed ‘CDN_JQUERY_VERSION’ (this will throw an Error in a future version of PHP) in /opt/www/bollerreview_upgrade.tcu.edu/current/plugins/themes/bootstrap3/BootstrapThreeThemePlugin.inc.php on line 131
PHP message: PHP Warning: Use of undefined constant CDN_JQUERY_UI_VERSION - assumed ‘CDN_JQUERY_UI_VERSION’ (this will throw an Error in a future version of PHP) in /opt/www/bollerreview_upgrade.tcu.edu/current/plugins/themes/bootstrap3/BootstrapThreeThemePlugin.inc.php on line 132

What version of the Bootstrap3 plugin do you have installed? You can find this by opening the following file:

/opt/www/bollerreview_upgrade.tcu.edu/current/plugins/themes/bootstrap3/version.xml

And looking at the <release> tag:

<release>3.2.0.3</release>

This turned out to be the “default database engine doesn’t support foreign key constraint” problem documented at Upgrade to 3.3: default database engine doesn't support foreign key constraint · Issue #6732 · pkp/pkp-lib · GitHub. The reason I hadn’t realized that before is that I’d failed to capture the output of the “tools/upgrade.php upgrade” in a log file, and didn’t realize the upgrade had failed. After restoring the database to the 3.2.1-4 version, running queries to change the database engine from MyISAM to InnoDB on all the tables, the 3.3.0-10 upgrade script ran successfully, and all the public pages are working. I’m no having a completely different problem with the Administration page; I will start a new thread on that.

Thanks for everyone’s help.

1 Like