UPDATING Problem from 3.2.1.3 to 3.3.0.2

I have initially tried to update the new version OJS 3.3.0.3 from OJS 3.2.1.3 without adding the quoted 'engine' => 'InnoDB', line but failed by command line or by web.

However, by adding the quoted line, I have managed to update by command line but I have not tried through web installation.

Thanks for the support.
Zahirul

Hi @Vitaliy .
I had the same error

Removing orphaned review_files entry with review_id ID 7425 and submission_file_id 24432
ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Can't create table `ojs33`.`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 added to https://github.com/pkp/pkp-lib/blob/88c9965b2f601b79e034ceaff59d8a809b72943d/classes/core/PKPApplication.inc.php#L210

But the same error.

Removing orphaned review_files entry with review_id ID 7425 and submission_file_id 24432
ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Can't create table `ojs33`.`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`))

Itā€™s Debian 10, MariaDB 10.3.27. Innodb by default (barracuda, i think)

Perhaps, do i need before upgradeā€¦

ALTER TABLE ************* ENGINE=InnoDB;

?
I think that ā€˜submission_filesā€™ is ā€œMyIsamā€

Thanks

I have tried to update another journal from OJS 3.2.1.3 to OJS 3.3.0.3 but failed through the command line adding as well as web based even ā€˜engineā€™ => ā€˜InnoDBā€™,

Server Information

Setting Name Setting Value
OS platform Linux
PHP version 7.4.15
Apache version Apache/2.4.6 (CentOS)
Database driver mysqli
Database server version 5.5.60-MariaDB

Command line update Errors

A submission file was expected but not found at journals/1/articles/1381/submission/1381-1-7929-1-2-20200304.docx.
Removing orphaned review_files entry with review_id ID 1817 and submission_file_id 6048
Removing orphaned review_files entry with review_id ID 1857 and submission_file_id 6048
ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (ejournal3303b.#sql-16c9_4c412d, CONSTRAINT review_files_submission_file_id_foreign FOREIGN KEY (submission_file_id) REFERENCES submission_files (submission_file_id)) (SQL: alter table review_files add constraint review_files_submission_file_id_foreign foreign key (submission_file_id) references submission_files (submission_file_id))

web based installation errors
Fatal error : Uncaught Error: Call to a member function getConnection() on null in /home/ojs/feb7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php:74 Stack trace: #0 /home/ojs/feb7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php(200): Illuminate\Database\Capsule\Manager::connection() #1 /home/ojs/feb7/lib/pkp/classes/db/DAO.inc.php(65): Illuminate\Database\Capsule\Manager::__callStatic() #2 /home/ojs/feb7/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(106): DAO->retrieve() #3 /home/ojs/feb7/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings() #4 /home/ojs/feb7/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss() #5 /home/ojs/feb7/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(57): GenericCache->get() #6 /home/ojs/feb7/lib/pkp/classes/plugins/Plugin.inc.php(463): PluginSettingsDAO->getSetting() #7 /home/ojs/feb7/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(68): Plugin->getSetting() #8 in /home/ojs/feb7/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php on line 74

Hi,
I get exactly the same error when I try to upgrade my OJS site from 3.2.1-3 to 3.3.0.3. installed via Github.

ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (upgrade.#sql-468_3211, CONSTRAINT review_files_submission_file_id_foreign FOREIGN KEY (submission_file_id) REFERENCES submission_files (submission_file_id)) (SQL: alter table review_files add constraint review_files_submission_file_id_foreign foreign key (submission_file_id) references submission_files (submission_file_id))

Before starting the upgrade, I applied the query on https://github.com/pkp/pkp-lib/issues/6474#issuecomment-743484217 page and get similar results

SELECT DISTINCT rf.file_id FROM review_files rf LEFT JOIN submission_files sf ON (rf.file_id = sf.file_id) WHERE sf.file_id IS NULL;

9581
9582
9583
9584
9585

Then I removed these rows by;

DELETE FROM review_files WHERE file_id IN (9581, 9582, 9583, 9584, 9585);

The last few lines of php-error.log file are as follows and contain no errors;

[07-Feb-2021 22:07:01 Europe/Istanbul] A submission file was expected but not found at journals/1/articles/1421/submission/proof/1421-16-7997-1-10-20200530.pdf.
[07-Feb-2021 22:07:01 Europe/Istanbul] A submission file was expected but not found at journals/1/articles/1421/submission/proof/1421-16-7998-1-10-20200530.pdf.
[07-Feb-2021 22:09:05 Europe/Istanbul] A submission file was expected but not found at journals/1/articles/1507/submission/review/revision/1507-17-9900-1-15-20210207.docx.
[07-Feb-2021 22:09:49 Europe/Istanbul] Removing orphaned review_files entry with review_id ID 1156 and submission_file_id 8013
[07-Feb-2021 22:09:49 Europe/Istanbul] Removing orphaned review_files entry with review_id ID 1162 and submission_file_id 8048
[07-Feb-2021 22:09:49 Europe/Istanbul] Removing orphaned review_files entry with review_id ID 1167 and submission_file_id 8192
[07-Feb-2021 22:09:49 Europe/Istanbul] Removing orphaned review_files entry with review_id ID 1168 and submission_file_id 8025
[07-Feb-2021 22:09:49 Europe/Istanbul] Removing orphaned review_files entry with review_id ID 1171 and submission_file_id 8325

I try to understand whether the issue is specific to my database, or some other people has experienced the same error eventhough after applying the SQL command above. But I still get the same error during upgrade via command line.

Although not urgent, I am looking for a solution as I am considering to upgrade soon.

Regards,

Hi @drugurkocak

Hi @juanito
Thank you for your suggestion. Unfortunately, when I run the SQL query on that page (on a clean database), I get an error message.

SQL query;

SELECT submission_file_id FROM review_round_files LEFT JOIN submission_files USING (submission_file_id) WHERE submission_files.submission_file_id IS NULL

Result:

Error
SQL query:

SELECT submission_file_id FROM review_round_files LEFT JOIN submission_files USING (submission_file_id) WHERE submission_files.submission_file_id IS NULL LIMIT 0, 25
MySQL said:

#1054 - Unknown column ā€˜submission_file_idā€™ in ā€˜from clauseā€™

So, I canā€™t go further. I will keep on watching the forum and Github topics till I find a solution.
Regards,

ALTER TABLE submission_files ENGINE = InnoDB;

Hi @juanito
I wish it would help, but all tables are already InnoDB for a long time.
Nevertheless, I will retry with your suggestion tomorrow and share the result.
Regards,
Screen Shot 2021-02-09 at 01.47.31

Hi @juanito,

Perhaps, do i need before upgradeā€¦

ALTER TABLE ************* ENGINE=InnoDB;

?
I think that ā€˜submission_filesā€™ is ā€œMyIsamā€

Thanks

Yes, in this case, it should work.

1 Like

Hi @drugurkocak,

This is a different error. Can you open a new forum thread and tag me there?

Hello! Iā€™m very sorry for the delay. I just tried upgrading to the new version and still get the same error:

[10-Feb-2021 21:50:16 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
Stack trace:
#0 /home/analisisfilos/public_html/20210204/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php(200): Illuminate\Database\Capsule\Manager::connection()
#1 /home/analisisfilos/public_html/20210204/lib/pkp/classes/db/DAO.inc.php(65): Illuminate\Database\Capsule\Manager::_callStatic(ā€˜rawā€™, Array)
#2 /home/analisisfilos/public_html/20210204/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(106): DAO->retrieve('SELECT setting
ā€¦ā€™, Array)
#3 /home/analisisfilos/public_html/20210204/lib/pkp/classes/plugins/PluginSettingsDAO.inc.php(86): PluginSettingsDAO->getPluginSettings(ā€˜0ā€™, ā€˜htmlarticlegallā€¦ā€™)
#4 /home/analisisfilos/public_html/20210204/lib/pkp/classes/cache/GenericCache.inc.php(63): PluginSettingsDAO->_cacheMiss(Object(FileCache), ā€˜enabledā€™)
#5 /home/analisisfilos/public_html in /home/analisisfilos/public_html/20210204/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php on line 74

Best regards,
Rose

Hi @Super_Diseno_Web,

See: Unable to upgrade 3.3.0.2: Call to a member function getConnection() on null Ā· Issue #6703 Ā· pkp/pkp-lib Ā· GitHub

Regards,
Alec Smecher
Public Knowledge Project Team

Tried to fix by applying the patch
Application::get()->initializeDatabaseConnection();

but could not managed to update.

Command line errors

ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1005 Canā€™t create table ā€˜ejournal3303a.#sql-16c9_4f2370ā€™ (errno: 150) (SQL: alter table review_round_files add constraint review_round_files_submission_file_id_foreign foreign key (submission_file_id) references submission_files (submission_file_id))

web site update = > server errors

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.6 (CentOS) Server at journals.iium.edu.my Port 443webUpdateError

Server Information

Setting Name Setting Value
OS platform Linux
PHP version 7.4.15
Apache version Apache/2.4.6 (CentOS)
Database driver mysqli
Database server version 5.5.60-MariaDB