UPDATING Problem from 3.2.1.3 to 3.3.0.2

Before you post your question, check out the user guides and video tutorials at PKP Docs and search the forum to see if someone else had the same question.

When you post your question give as much detail as possible, including the following:

  • Application Version - OJS 3.2.1.3
  • Description of issue - failed to update to 3.3.0.2 even freshly installed version too.
    journals.alambiblio.com is currently unable to handle this request.
    HTTP ERROR 500

Server Information

Server Info
|OS platform|Linux|
|PHP version|7.4.14|
|Apache version|Apache|
|Database driver|mysql|
|Database server version|10.3.27-MariaDB-log-cll-lve|

Error logs

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call to Smarty2 function get_template_vars in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 2296

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Notice: Deprecated call without request object. in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 1235

Fatal error: Uncaught Error: Call to a member function getConnection() on null in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php:74 Stack trace: #0 /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php(200): Illuminate\Database\Capsule\Manager::connection() #1 /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/db/DAO.inc.php(65): Illuminate\Database\Capsule\Manager::_callStatic(‘raw’, Array) #2 /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(106): DAO->retrieve('SELECT setting
’, Array) #3 /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(‘0’, ‘announcementfee
’) #4 /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ‘enabled’) #5 / in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php on line 74

  • Steps you took leading up to the issue
  • What you tried to resolve the issue
  • Screenshots
  • Error log messages if applicable

Hi @Ahm_Zahirul_Alam,

Please double-check your database connections settings.

I have tried from two different servers. I can install OJS 3.3.0.2 without any problems. But it failed during the update showing HTTP ERROR 500 Thanks. I also observed that few other people also reported at Issues · pkp/pkp-lib · GitHub . [OJS] update from 3.2 to 3.3 error · Issue #6709 · pkp/pkp-lib · GitHub Unable to upgrade 3.3.0.2: Call to a member function getConnection() on null · Issue #6703 · pkp/pkp-lib · GitHub are few mentioned

What environment are you using (OS, database, server)?
Can you also include information relevant to reproducing the issue?

Just to check, are you upgrading from a command line or web interface? If latter, can you try upgrading from a command line to narrow the problem?

I am uploading from the web interface. Let me check by command line

failed to update by command line too

[alamyhle@premium40 ojs330]$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.3.0.2]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::installDefaultNavigationMenus]

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[migration: PKPv3_3_0UpgradeMigration]
ERROR: Upgrade failed: DB: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘url’ in ‘field list’ (SQL: select url, navigation_menu_item_id from navigation_menu_items where context_id = 1)

Dear @Ahm_Zahirul_Alam
did you run the upgrade process in the web installer first and then on the command line? You should not!
After an upgrade process fails you should delete all tables in the database and re-populate it with a previously taken dump.
I prefer to delete the tables in phpmyadmin and then on the command line as root

mysql -p
use “database”
source “/path/to/sqldump.sql”

Then run php tools/upgrade.php upgrade

1 Like

I have deleted all the failed databases and create a new database with new names but failed to update.
tried several times in command mode but failed to update

same errors

/home/alamyhle/journals.alambiblio.com/ojs330
[alamyhle@premium40 ojs330]$ php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.3.0.2]

[code: Installer Installer::checkPhpVersion]

[code: Installer Installer::installDefaultNavigationMenus]

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[migration: PKPv3_3_0UpgradeMigration]
ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Can’t create table alamyhle_oj.submission_files (errno: 150 “Foreign key constraint is incorrectly formed”) (SQL: alter table submission_files add constraint submission_files_file_id_foreign foreign key (file_id) references files (file_id))
[alamyhle@premium40 ojs330]$

errors log
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] PHP Warning: Use of undefined constant SCHEMA_GALLEY - assumed ‘SCHEMA_GALLEY’ (this will throw an Error in a future version of PHP) in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/includes/functions.inc.php on line 224
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] PHP Warning: Use of undefined constant SCHEMA_AUTHOR - assumed ‘SCHEMA_AUTHOR’ (this will throw an Error in a future version of PHP) in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/includes/functions.inc.php on line 224
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] PHP Warning: Use of undefined constant SCHEMA_AUTHOR - assumed ‘SCHEMA_AUTHOR’ (this will throw an Error in a future version of PHP) in /home/alamyhle/journals.alambiblio.com/ojs330/lib/pkp/includes/functions.inc.php on line 224
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] WARNING: The NavigationMenu (ContextId: 2, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] WARNING: The NavigationMenu (ContextId: 2, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[03-Feb-2021 22:14:20 Asia/Kuala_Lumpur] WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[03-Feb-2021 22:14:21 Asia/Kuala_Lumpur] Removing orphaned submission_files entry ID 3 with submission_id 1

few update history of the same site

Version history

Version Major Minor Revision Build Date installed
3.2.1.3 3 2 1 3 2021-01-24
3.2.1.1 3 2 1 1 2020-08-19
3.2.0.2 3 2 0 2 2020-04-10
3.2.0.1 3 2 0 1 2020-04-03

also I have updated another site for many times

Version history

Version Major Minor Revision Build Date installed
3.2.1.3 3 2 1 3 2021-01-23
3.2.1.2 3 2 1 2 2020-11-19
3.2.1.1 3 2 1 1 2020-06-27
3.2.1.0 3 2 1 0 2020-06-22
3.2.0.3 3 2 0 3 2020-05-01
3.2.0.2 3 2 0 2 2020-04-10
3.2.0.1 3 2 0 1 2020-03-22
3.1.2.4 3 1 2 4 2019-12-09
3.1.2.3 3 1 2 3 2019-12-06
3.1.2.1 3 1 2 1 2019-06-03
3.1.2.0 3 1 2 0 2019-03-13
3.1.1.4 3 1 1 4 2018-10-03
3.1.1.2 3 1 1 2 2018-07-12
3.1.1.1 3 1 1 1 2018-06-02
3.1.1.0 3 1 1 0 2018-05-08

all from web.
This time trying to do through command line too

although command lines gives error but it seems that the site has been updated but the submission files are not visible. In the submission - infinite rolling without shown the files.

Current version: 3.2.1.3 (January 24, 2021 - 08:33 PM)

Check for updates

Version history

Version Major Minor Revision Build Date installed
3.2.1.3 3 2 1 3 2021-01-24
3.2.1.1 3 2 1 1 2020-08-19
3.2.0.2 3 2 0 2 2020-04-10
3.2.0.1 3 2 0 1 2020-04-03

Hmm, this message isn’t very specific. During the upgrade files table is being created; in submission_files table, which is being repopulated, file_id should correspond to values in the same column in files table. This error says that something is wrong here. I suspect the values of file_id in both tables have different types. Are you sure that the upgrade is run on an intact database, I mean on a one not affected by unsuccessful updates?

@Ahm_Zahirul_Alam,

I’ve noticed that the error message origins quite late in the script, probably, the upgrade failed earlier if it was done on partially upgraded database. Can you try the upgrade from a back-up one more time but double check that database/tables are in proper encoding before starting it. If all is looks good there but the error still appears - let me know.

Before applying the update I have checked the site based on OJS 3.2.1.3. And that looks fine. This is a new journal site with 7/8 papers only. But after applying update by command mode , failed to get it successful. Tried 2/3 times. Each time I dropped all the tables from the database. If failed, drop and use source sql file and update

Hello, our update from 3.1.2-1 to 3.3 fails with this message

ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Can’t create table revistas.submission_file_revisions (errno: 150 “Foreign key constraint is incorrectly formed”) (SQL: alter table submission_file_revisions add constraint submission_file_revisions_submission_file_id_foreign foreign key (submission_file_id) references submission_files (submission_file_id))

I have tried to add constraint manually, getting the same message

MariaDB [revistas]> alter table submission_file_revisions add constraint submission_file_revisions_submission_file_id_foreign foreign key (submission_file_id) references submission_files (submission_file_id);
ERROR 1005 (HY000): Can’t create table revistas.submission_file_revisions (errno: 150 “Foreign key constraint is incorrectly formed”)

There are not submission_file_id different between the 2 tables

MariaDB [revistas]> select submission_file_id from submission_file_revisions where submission_file_id not in (select submission_file_id from submission_files);
Empty set (0.00 sec)

MariaDB [revistas]> select submission_file_id from submission_files where submission_file_id not in (select submission_file_id from submission_file_revisions);
Empty set (0.10 sec)

Next constraint creation in the same table doesn’t fail

MariaDB [revistas]> alter table submission_file_revisions add constraint submission_file_revisions_file_id_foreign foreign key (file_id) references files (file_id);
Query OK, 83624 rows affected (5.87 sec)

Hi @Ahm_Zahirul_Alam,

I’m still unable to reproduce the error. Can you take a look at the partially upgraded database and see if files table exists there? It should be created during the upgrade.

Hi @lcmartinezru,

Thanks, looks like the same error and also MariaDB. Exploring


I’m able to trigger similar error message if changing the default database storage engine. @lcmartinezru or @Ahm_Zahirul_Alam, can you make another test upgrade attempt after adding in PKPApplication class after this line: pkp-lib/PKPApplication.inc.php at 88c9965b2f601b79e034ceaff59d8a809b72943d · pkp/pkp-lib · GitHub
Additional line with the content:

'engine'    => 'InnoDB',

and see if that makes any difference. This will ensure that only the engine that supports foreign key constraints is used.

1 Like

Hello all, I seem to be having this same problem when trying to update to 3.3.0.2 from 3.2.1.2: [05-Feb-2021 22:17:15 UTC] PHP Fatal error: Uncaught Error: Call to a member function getConnection() on null in /home/analisisfilos/public_html/20210204/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php:74 .
I have tried adding the line in PKPApplication.inc.php but I still get the same error.
I am using cPanel, PHP 7.3, MySQL
I’ll be following this thread. Thanks!

Hi @Super_Diseno_Web,

This is Unable to upgrade 3.3.0.2: Call to a member function getConnection() on null · Issue #6703 · pkp/pkp-lib · GitHub. OJS/OMP/OPS 3.3.0-3 have just been released, which include a fix.

Regards,
Alec Smecher
Public Knowledge Project Team

I just tried to upgrade to 3.3.0-3, from 3.2.1-1, using the link from the downloads page to https://pkp.sfu.ca/ojs/download/ojs-3.3.0-3.tar.gz

I got the same error.

Server: CentOS 7, nginx + fastcgi and mariadb.

2021/02/06 13:45:30 [error] 21320#0: *104415 FastCGI sent in stderr: "PHP message: PHP Fatal error:      Uncaught Error: Call to a member function getConnection() on null in /var/www/ojs-dev/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php:74
Stack trace:
#0 /var/www/ojs-dev/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php(200): Illuminate\Database\Capsule\Manager::connection()
#1 /var/www/ojs-dev/lib/pkp/classes/db/DAO.inc.php(65): Illuminate\Database\Capsule\Manager::__callStatic()
#2 /var/www/ojs-dev/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(106): DAO->retrieve()
#3 /var/www/ojs-dev/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings()
#4 /var/www/ojs-dev/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss()
#5 /var/www/ojs-dev/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get()
#6 /var/www/ojs-dev/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting()
#7 /var/www/ojs-dev/lib/pkp/classes" while reading response header from upstream, client: 123.123.123.123, server: dev.testinginstance.tld, request: "POST /index.php/index/install/installUpgrade HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "dev.testinginstance.tld", referrer: "https://dev.testinginstance.tld/"