Hi PKP Team,
I currently manage a book portal using OMP 3.3.0-16. Server specs are Ubuntu Linux 24.04.3, MariaDB version 11.8.2, PHP versions 8.3.25, Apache version 2.4.58.
After learning that the Crossref plugin was released for OMP 3.4.0-9, I tried to upgrade. After completing all the checks, I received the following error during the command-line upgrade. Previously, the publisher’s secretary would also upload the book chapters, but when the confusion arose, I deleted the chapters.
How can we find a solution? Thank you for your help.
books@ns1:~/public_html$ php tools/upgrade.php upgrade
2025-09-10 11:47:17 [pre-install]
2025-09-10 11:47:17 [load: upgrade.xml]
2025-09-10 11:47:17 [version: 3.4.0.9]
2025-09-10 11:47:17 [code: Installer Installer::checkPhpVersion]
2025-09-10 11:47:17 [code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
2025-09-10 11:47:17 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
2025-09-10 11:47:18 [migration: PKP\migration\upgrade\v3_4_0\I10249_FixProfileImageDataLoss]
2025-09-10 11:47:18 [migration: APP\migration\upgrade\v3_4_0\PreflightCheckMigration]
2025-09-10 11:48:14 [Cleaning orphaned entries from "publications" with an invalid value for the column "primary_contact_id". The following IDs do not exist at the reference table "authors" and will be reset to NULL:
2482, 3886, 4208, 5183, 5321, 5559, 5763, 6102, 6299, 6661, 6695, 6955, 7241, 7693, 8840, 9102, 9114, 9124, 9130, 9147, 9674, 9702, 9722, 9723, 9892, 9893, 9894, 9915, 9921, 9923, 9924, 10711, 11011, 11532, 11533, 11702, 12095, 12099, 12201, 12217, 12218, 12261, 12263, 12602, 12620, 12622, 12624, 12648, 12650, 12652, 12654, 12725, 12802, 12814, 12827, 12856, 12893, 13031, 13330, 13405, 13578, 14149, 14151, 14318, 14386, 14500, 14636, 14834, 15088, 16040, 23362, 24670, 24879, 31909, 36486, 39353, 39481, 41228, 41275, 42027, 45731, 46566, 52034]
2025-09-10 11:48:14 [83 entries updated]
2025-09-10 11:48:14 [Removing orphaned entries from "publication_formats" with an invalid value for the required column "publication_id". The following IDs do not exist at the reference table "publications":
63, 204, 305, 370, 437, 451, 465, 516, 543, 852, 1821]
2025-09-10 11:48:14 [11 entries removed]
2025-09-10 11:48:14 [Removing orphaned entries from "publication_format_settings" with an invalid value for the required column "publication_format_id". The following IDs do not exist at the reference table "publication_formats":
78, 212, 309, 371, 446, 458, 471, 531, 548, 852, 1851]
2025-09-10 11:48:14 [11 entries removed]
2025-09-10 11:48:14 [Removing orphaned entries from "publication_dates" with an invalid value for the required column "publication_format_id". The following IDs do not exist at the reference table "publication_formats":
78, 212, 309, 371, 446, 458, 471, 531, 548, 852, 1851]
2025-09-10 11:48:14 [11 entries removed]
2025-09-10 11:48:14 [Removing orphaned entries from "identification_codes" with an invalid value for the required column "publication_format_id". The following IDs do not exist at the reference table "publication_formats":
78, 212, 309, 371, 446, 458, 471, 531, 548, 852, 1851]
2025-09-10 11:48:14 [11 entries removed]
2025-09-10 11:48:16 [Cleaning orphaned entries from "submission_files" with an invalid value for the column "source_submission_file_id". The following IDs do not exist at the reference table "submission_files" and will be reset to NULL:
11389, 11390, 11391, 11392, 11393, 11394, 11395, 11396, 11397, 11398, 11399, 11400, 11401, 11402, 11403, 11404, 11405, 11406, 11407, 11408, 11409, 11410, 11411, 11412, 11413, 22185, 22186, 22187, 22188, 22189, 22190, 22191, 22192, 22193, 22194, 22195, 22196, 22197, 22198, 26620, 26621, 26622, 26623, 26624, 26625, 26626, 28204, 49695, 68082]
2025-09-10 11:48:16 [49 entries updated]
2025-09-10 11:48:26 [Removing orphaned entries from "author_settings" with an invalid value for the required column "author_id". The following IDs do not exist at the reference table "authors":
1960]
2025-09-10 11:48:26 [12 entries removed]
2025-09-10 11:48:27 [Removing orphaned entries from "email_log_users" with an invalid value for the required column "email_log_id". The following IDs do not exist at the reference table "email_log":
42, 119, 171, 173, 175, 177, 245, 272, 307, 309, 311, 353, 357, 522, 620, 737, 758, 780, 865, 897, 1299, 2333, 2335]
2025-09-10 11:48:27 [23 entries removed]
2025-09-10 11:48:40 [Removing orphaned entries from "navigation_menu_item_assignment_settings" with an invalid value for the required column "navigation_menu_item_assignment_id". The following IDs do not exist at the reference table "navigation_menu_item_assignments":
0]
2025-09-10 11:48:40 [1 entries removed]
2025-09-10 11:48:41 [Removing orphaned entries from "stage_assignments" with an invalid value for the required column "submission_id". The following IDs do not exist at the reference table "submissions":
161]
2025-09-10 11:48:41 [1 entries removed]
2025-09-10 11:48:49 [Removing orphaned entries from "submission_search_object_keywords" with an invalid value for the required column "object_id". The following IDs do not exist at the reference table "submission_search_objects":
186872, 186981, 187544, 187874, 186553, 186835, 187398, 187865]
2025-09-10 11:48:52 [77953 entries removed]
2025-09-10 11:49:02 [migration: PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull]
2025-09-10 11:49:02 [migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-09-10 11:49:02 [migration: APP\migration\upgrade\v3_4_0\I3573_AddPrimaryKeys]
2025-09-10 11:54:22 [migration: APP\migration\upgrade\v3_4_0\I6093_AddForeignKeys]
2025-09-10 12:01:00 [migration: APP\migration\upgrade\v3_4_0\MergeLocalesMigration]
2025-09-10 12:04:01 [migration: PKP\migration\upgrade\v3_4_0\FailedJobsMigration]
2025-09-10 12:04:01 [migration: PKP\migration\upgrade\v3_4_0\UpgradeMigration]
2025-09-10 12:04:02 [migration: APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces]
2025-09-10 12:04:02 [migration: APP\migration\upgrade\v3_4_0\I6807_SetLastModified]
2025-09-10 12:04:02 [migration: APP\migration\upgrade\v3_4_0\I7132_AddSourceChapterId]
2025-09-10 12:04:02 [migration: APP\migration\upgrade\v3_4_0\I7264_UpdateEmailTemplates]
2025-09-10 12:04:03 [migration: APP\migration\upgrade\v3_4_0\I7014_DoiMigration]
2025-09-10 12:04:39 [migration: APP\migration\upgrade\v3_4_0\I7265_EditorialDecisions]
2025-09-10 12:04:42 [migration: PKP\migration\upgrade\v3_4_0\I7624_StrftimeDeprecation]
2025-09-10 12:04:42 [migration: PKP\migration\upgrade\v3_4_0\I7592_RemoveUnusedEmailTemplates]
2025-09-10 12:04:42 [migration: APP\migration\upgrade\v3_4_0\I7190_RemoveOrphanFilters]
2025-09-10 12:04:42 [migration: PKP\migration\upgrade\v3_4_0\I7190_UpdateFilters]
2025-09-10 12:04:42 [migration: PKP\migration\upgrade\v3_4_0\I8073_RemoveNotesWithoutQueriesAndRelatedObjects]
2025-09-10 12:05:05 [Removing orphaned note entry ID 1 with nonexistent query 1]
2025-09-10 12:05:05 [Removing orphaned note entry ID 2 with nonexistent query 2]
2025-09-10 12:05:05 [Removing orphaned note entry ID 9 with nonexistent query 9]
2025-09-10 12:05:05 [migration: PKP\migration\upgrade\v3_4_0\I2890_EmailTemplatesVarcharLengthUpdate]
2025-09-10 12:05:05 [migration: PKP\migration\upgrade\v3_4_0\I2890_AddSetNullForOnDeleteToReviewRoundIdForeign]
2025-09-10 12:05:05 [migration: PKP\migration\upgrade\v3_4_0\I6895_CreateNewInstitutionsTables]
2025-09-10 12:05:06 [migration: APP\migration\upgrade\v3_4_0\I6782_OrphanedMetrics]
2025-09-10 12:08:37 [migration: PKP\migration\upgrade\v3_4_0\I6782_UsageStatsSettings]
2025-09-10 12:08:37 [migration: APP\migration\upgrade\v3_4_0\I6782_CreateNewMetricsTables]
2025-09-10 12:08:42 [migration: APP\migration\upgrade\v3_4_0\I6782_MetricsContext]
2025-09-10 12:08:57 [migration: APP\migration\upgrade\v3_4_0\I6782_MetricsSeries]
2025-09-10 12:09:10 [migration: APP\migration\upgrade\v3_4_0\I6782_MetricsSubmission]
2025-09-10 12:10:32 [revert migration: APP\migration\upgrade\v3_4_0\I6782_MetricsSeries]
2025-09-10 12:10:32 [downgrade for "APP\migration\upgrade\v3_4_0\I6782_MetricsSeries" unsupported: Downgrade not supported]
ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`books`.`metrics_submission`, CONSTRAINT `metrics_submission_chapter_id_foreign` FOREIGN KEY (`chapter_id`) REFERENCES `submission_chapters` (`chapter_id`) ON DELETE CASCADE) (SQL: insert into `metrics_submission` (`load_id`, `context_id`, `submission_id`, `chapter_id`, `representation_id`, `submission_file_id`, `file_type`, `assoc_type`, `date`, `metric`) select m.load_id, m.context_id, m.submission_id, CAST(sfs.setting_value AS UNSIGNED), m.representation_id, m.assoc_id, m.file_type, m.assoc_type, DATE_FORMAT(STR_TO_DATE(m.day, '%Y%m%d'), '%Y-%m-%d'), m.metric from `metrics` as `m` left join `submission_file_settings` as `sfs` on `m`.`assoc_id` = `sfs`.`submission_file_id` and `m`.`assoc_type` = 515 and `sfs`.`setting_name` = chapterId where `m`.`assoc_type` = 515 and `m`.`metric_type` = omp::counter)