Hello, I have looked at the 4 other relevant threads on the forum and tried the recommendations and I think that I have a different issue. The closest threads are:
-
Upgrade OJS 3.3.0-3 errors
… and the referenced GitHub issue … - Upgrade to 3.3: default database engine doesn't support foreign key constraint · Issue #6732 · pkp/pkp-lib · GitHub
I am using OJS hosted by Kualo using softaculous. When I try to upgrade from OJS 3.2.1.1 to 3.3.0.6 I get this error:
ERROR: Upgrade failed: DB: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `submission_files` add constraint `submission_files_file_id_foreign` foreign key (`file_id`) references `files` (`file_id`))
Here’s what I suspect is happening:
- The OJS upgrade is run (either by the Softaculous upgrade button, or from the command line)
- The script creates a new table ‘files’
- Since the default table engine for mysql is pre-set to MyISAM by Kualo, files is created with as MyISAM
- The script fails with an error because the MyISAM engine cannot be mixed with the InnoDB engine for foreign key constraints (Upgrade to 3.3: default database engine doesn't support foreign key constraint · Issue #6732 · pkp/pkp-lib · GitHub)
Problem is that Kualo cannot/will not change the mysql engine default to InnoDB due to others on the same infrastructure.
Therefore, I would like to follow the advice in the github issue It seems that forcing to use InnoDB engine by passing additional setting to a database connection ('engine' => 'InnoDB') solves the issue.
Please can someone explain the best way to pass this setting as part of the OJS database connection? Can it be set in config.inc.php?
~Steve
PS. There is nothing Fatal / obvious in the error_log, which contains:
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 2, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 3, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 3, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 8, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 8, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 5, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 5, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 7, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 7, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:43 UTC] WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 2 with submission_id 1
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 3 with submission_id 1
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 4 with submission_id 1
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 6 with submission_id 2
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 8 with submission_id 3
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 9 with submission_id 3
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 10 with submission_id 3
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 22 with submission_id 11
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 23 with submission_id 11
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 24 with submission_id 11
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 25 with submission_id 11
[13-May-2021 09:11:56 UTC] Removing orphaned submission_files entry ID 1950 with submission_id 1955```