Errors when updating OJS to


I’m currently trying to update the journals I’m managing to
On one particular journal, which was version before, I can’t start the online Installation, as the page is not shown. The error log shows the following error:

[Tue May 11 12:52:12.587380 2021] [php7:error] [pid 13703] [client] PHP Fatal error:  Uncaught Error: Call to a member function getConnection() on null in /var/www/ojs_pf/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php:74
Stack trace:
#0 /var/www/ojs_pf/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php(200): Illuminate\\Database\\Capsule\\Manager::connection()
#1 /var/www/ojs_pf/lib/pkp/classes/db/ Illuminate\\Database\\Capsule\\Manager::__callStatic('raw', Array)
#2 /var/www/ojs_pf/lib/pkp/classes/context/ DAO->retrieve('SELECT * FROM j...', Array)
#3 /var/www/ojs_pf/lib/pkp/classes/core/ ContextDAO->getByPath('pf')
#4 /var/www/ojs_pf/lib/pkp/classes/core/ PKPRouter->getContext(Object(Request), 1)
#5 /var/www/ojs_pf/classes/core/ PKPRequest->_delegateToRouter('getContext', 1)
#6 /var/www/ojs_pf/lib/pkp/classes/template/ Request->getContext()
#7 /var/www/ojs_pf/classes/template/ in /var/www/ojs_pf/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php on line 74

This seems to be a duplicate of: Unable to upgrade Call to a member function getConnection() on null · Issue #6703 · pkp/pkp-lib · GitHub which should have been solved in

Any ideas what could be the problem here?

Hi @KBodarwe

Can you confirm that you have the fix for the previously reported bug in your code:

It should just be the line with the + sign in front of it, around line 36 in the file referenced in the commit.

If it’s there, then we can consider other things.


Hi @jnugent ,
yes I can confirm that fix is present in the code.


Hi Karl,

Have you tried running the update from the command line instead of the online way?

php tools/upgrade.php upgrade

my understanding is the previous bug was only present in the online version.

If you just want to see if the database connection component works you can run

php tools/upgrade.php check

Which still needs to connect to the database first.


Hello Jason,

Updating from the command line fails, throwing the following error:

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

Also several of these errors were thrown throughout the process, before it was canceled:

PHP Notice:  unserialize(): Error at offset 245 of 3730 bytes in /var/www/ojs_pf/lib/pkp/classes/db/ on line 252

running the check from the command line first brought the following results:

Code version:
Database version:
Latest version:
Database version is older than code version
Run "tools/upgrade.php upgrade" to update

Any idea what could have gone wrong?


Hi @KBodarwe

Off the top of my head, it sounds like you might have some invalid values in the review_assignments table, for the review_round_id column. MySQL is telling you that it tried to convert that column to a “bigint not null” column and found some data that no longer fit. You should to review the review assignments table. A review round id should not be null, for example, and it should be a valid integer.


1 Like

Hello Jason,
this seems to have been the problem.
After resetting the database to a backup, I ran:

update review_assignments SET review_round_id = 0 WHERE review_round_id IS NULL;

And afterwards the Command Line Update tool ran without breaking.
The update seems to have run.
Thanks for your help!

1 Like

Great, glad to hear it!