Slim Application Error when uploading a file in submission page OJS 3.3.0.10

Slim application error when the author try to upload the file of his submission. Here is the content of the error log file:

[26-Jun-2022 16:41:31 America/New_York] Slim Application Error:
Type: Illuminate\Database\QueryException
Code: 23000
Message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mscienc2_msc2022`.`submission_files`, CONSTRAINT `submission_files_file_id_foreign` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`)) (SQL: insert into `submission_files` (`created_at`, `file_id`, `file_stage`, `submission_id`, `updated_at`, `uploader_user_id`) values (2022-06-26 16:41:31, 281, 2, 283, 2022-06-26 16:41:31, 5))
File: /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php
Line: 671
Trace: #0 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('insert into `su...', Array, Object(Closure))
#1 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(465): Illuminate\Database\Connection->run('insert into `su...', Array, Object(Closure))
#2 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(417): Illuminate\Database\Connection->statement('insert into `su...', Array)
#3 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2795): Illuminate\Database\Connection->insert('insert into `su...', Array)
#4 /home/mscienc2/public_html/lib/pkp/classes/db/SchemaDAO.inc.php(75): Illuminate\Database\Query\Builder->insert(Array)
#5 /home/mscienc2/public_html/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php(91): SchemaDAO->insertObject(Object(SubmissionFile))
#6 /home/mscienc2/public_html/classes/submission/SubmissionFileDAO.inc.php(24): PKPSubmissionFileDAO->insertObject(Object(SubmissionFile))
#7 /home/mscienc2/public_html/lib/pkp/classes/services/PKPSubmissionFileService.inc.php(302): SubmissionFileDAO->insertObject(Object(SubmissionFile))
#8 /home/mscienc2/public_html/lib/pkp/api/v1/submissions/PKPSubmissionFileHandler.inc.php(331): PKP\Services\PKPSubmissionFileService->add(Object(SubmissionFile), Object(Request))
#9 [internal function]: PKPSubmissionFileHandler->add(Object(Slim\Http\Request), Object(APIResponse), Array)
#10 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(APIResponse), Array)
#11 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(APIResponse), Array)
#12 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(APIResponse))
#13 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#14 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(APIResponse))
#15 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.inc.php(77): Slim\App->__invoke(Object(Slim\Http\Request), Object(APIResponse))
#16 [internal function]: ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#17 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiAuthorizationMiddleware), Array)
#18 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#19 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#20 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.inc.php(46): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#21 [internal function]: ApiCsrfMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#22 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiCsrfMiddleware), Array)
#23 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#24 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#25 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.inc.php(131): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#26 [internal function]: ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#27 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiTokenDecodingMiddleware), Array)
#28 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#29 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#30 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(68): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#31 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#32 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#33 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#34 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#35 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(127): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#36 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#37 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#38 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#39 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#40 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#41 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#42 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#43 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#44 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#45 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#46 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#47 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(124): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))
#48 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#49 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#50 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#51 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#52 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#53 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#54 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#55 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#56 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#57 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#58 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#59 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))
#60 /home/mscienc2/public_html/lib/pkp/classes/core/APIRouter.inc.php(115): Slim\App->run()
#61 /home/mscienc2/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): APIRouter->route(Object(Request))
#62 /home/mscienc2/public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#63 /home/mscienc2/public_html/index.php(68): PKPApplication->execute()
#64 {main}
Previous error:
Type: Doctrine\DBAL\Driver\PDO\Exception
Code: 23000
Message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mscienc2_msc2022`.`submission_files`, CONSTRAINT `submission_files_file_id_foreign` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`))
File: /home/mscienc2/public_html/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php
Line: 18
Trace: #0 /home/mscienc2/public_html/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
#1 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(464): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into `su...', Array)
#3 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('insert into `su...', Array, Object(Closure))
#4 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(465): Illuminate\Database\Connection->run('insert into `su...', Array, Object(Closure))
#5 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(417): Illuminate\Database\Connection->statement('insert into `su...', Array)
#6 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2795): Illuminate\Database\Connection->insert('insert into `su...', Array)
#7 /home/mscienc2/public_html/lib/pkp/classes/db/SchemaDAO.inc.php(75): Illuminate\Database\Query\Builder->insert(Array)
#8 /home/mscienc2/public_html/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php(91): SchemaDAO->insertObject(Object(SubmissionFile))
#9 /home/mscienc2/public_html/classes/submission/SubmissionFileDAO.inc.php(24): PKPSubmissionFileDAO->insertObject(Object(SubmissionFile))
#10 /home/mscienc2/public_html/lib/pkp/classes/services/PKPSubmissionFileService.inc.php(302): SubmissionFileDAO->insertObject(Object(SubmissionFile))
#11 /home/mscienc2/public_html/lib/pkp/api/v1/submissions/PKPSubmissionFileHandler.inc.php(331): PKP\Services\PKPSubmissionFileService->add(Object(SubmissionFile), Object(Request))
#12 [internal function]: PKPSubmissionFileHandler->add(Object(Slim\Http\Request), Object(APIResponse), Array)
#13 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(APIResponse), Array)
#14 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(APIResponse), Array)
#15 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(APIResponse))
#16 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#17 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(APIResponse))
#18 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.inc.php(77): Slim\App->__invoke(Object(Slim\Http\Request), Object(APIResponse))
#19 [internal function]: ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#20 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiAuthorizationMiddleware), Array)
#21 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#22 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#23 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.inc.php(46): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#24 [internal function]: ApiCsrfMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#25 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiCsrfMiddleware), Array)
#26 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#27 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#28 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.inc.php(131): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#29 [internal function]: ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#30 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiTokenDecodingMiddleware), Array)
#31 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#32 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#33 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(68): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#34 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#35 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#36 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#37 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#38 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(127): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#39 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#40 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#41 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#42 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#43 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#44 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#45 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#46 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#47 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#48 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#49 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#50 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(124): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))
#51 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#52 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#53 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#54 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#55 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#56 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#57 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#58 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#59 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#60 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#61 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#62 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))
#63 /home/mscienc2/public_html/lib/pkp/classes/core/APIRouter.inc.php(115): Slim\App->run()
#64 /home/mscienc2/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): APIRouter->route(Object(Request))
#65 /home/mscienc2/public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#66 /home/mscienc2/public_html/index.php(68): PKPApplication->execute()
#67 {main}
Previous error:
Type: PDOException
Code: 23000
Message: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`mscienc2_msc2022`.`submission_files`, CONSTRAINT `submission_files_file_id_foreign` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`))
File: /home/mscienc2/public_html/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php
Line: 115
Trace: #0 /home/mscienc2/public_html/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)
#1 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(464): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into `su...', Array)
#3 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('insert into `su...', Array, Object(Closure))
#4 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(465): Illuminate\Database\Connection->run('insert into `su...', Array, Object(Closure))
#5 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(417): Illuminate\Database\Connection->statement('insert into `su...', Array)
#6 /home/mscienc2/public_html/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2795): Illuminate\Database\Connection->insert('insert into `su...', Array)
#7 /home/mscienc2/public_html/lib/pkp/classes/db/SchemaDAO.inc.php(75): Illuminate\Database\Query\Builder->insert(Array)
#8 /home/mscienc2/public_html/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php(91): SchemaDAO->insertObject(Object(SubmissionFile))
#9 /home/mscienc2/public_html/classes/submission/SubmissionFileDAO.inc.php(24): PKPSubmissionFileDAO->insertObject(Object(SubmissionFile))
#10 /home/mscienc2/public_html/lib/pkp/classes/services/PKPSubmissionFileService.inc.php(302): SubmissionFileDAO->insertObject(Object(SubmissionFile))
#11 /home/mscienc2/public_html/lib/pkp/api/v1/submissions/PKPSubmissionFileHandler.inc.php(331): PKP\Services\PKPSubmissionFileService->add(Object(SubmissionFile), Object(Request))
#12 [internal function]: PKPSubmissionFileHandler->add(Object(Slim\Http\Request), Object(APIResponse), Array)
#13 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(40): call_user_func(Array, Object(Slim\Http\Request), Object(APIResponse), Array)
#14 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(281): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(APIResponse), Array)
#15 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->__invoke(Object(Slim\Http\Request), Object(APIResponse))
#16 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/Route.php(268): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#17 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(503): Slim\Route->run(Object(Slim\Http\Request), Object(APIResponse))
#18 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiAuthorizationMiddleware.inc.php(77): Slim\App->__invoke(Object(Slim\Http\Request), Object(APIResponse))
#19 [internal function]: ApiAuthorizationMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#20 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiAuthorizationMiddleware), Array)
#21 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#22 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Slim\App))
#23 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiCsrfMiddleware.inc.php(46): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#24 [internal function]: ApiCsrfMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#25 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiCsrfMiddleware), Array)
#26 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#27 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#28 /home/mscienc2/public_html/lib/pkp/classes/security/authorization/internal/ApiTokenDecodingMiddleware.inc.php(131): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#29 [internal function]: ApiTokenDecodingMiddleware->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#30 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(ApiTokenDecodingMiddleware), Array)
#31 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#32 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#33 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(68): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#34 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#35 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#36 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#37 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#38 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(127): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#39 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#40 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#41 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#42 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#43 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#44 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#45 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#46 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#47 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#48 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#49 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#50 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(124): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))
#51 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#52 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#53 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#54 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#55 /home/mscienc2/public_html/lib/pkp/classes/handler/APIHandler.inc.php(132): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#56 [internal function]: APIHandler->{closure}(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#57 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/DeferredCallable.php(57): call_user_func_array(Object(Closure), Array)
#58 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#59 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(APIResponse), Object(Closure))
#60 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(APIResponse))
#61 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(392): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(APIResponse))
#62 /home/mscienc2/public_html/lib/pkp/lib/vendor/slim/slim/Slim/App.php(297): Slim\App->process(Object(Slim\Http\Request), Object(APIResponse))
#63 /home/mscienc2/public_html/lib/pkp/classes/core/APIRouter.inc.php(115): Slim\App->run()
#64 /home/mscienc2/public_html/lib/pkp/classes/core/Dispatcher.inc.php(144): APIRouter->route(Object(Request))
#65 /home/mscienc2/public_html/lib/pkp/classes/core/PKPApplication.inc.php(362): Dispatcher->dispatch(Object(Request))
#66 /home/mscienc2/public_html/index.php(68): PKPApplication->execute()
#67 {main}
View in rendered output by enabling the "displayErrorDetails" setting.

I wish any body help me to solve this issue. Thanks.

1 Like

Hi!
My team is currently experiencing the same issue after an upgrade from 3.2.1 to 3.3.0.
We have not yet able to pinpoint the cause and are quite stuck. (we checked the DB engine - InnoDB, collation and they’re ok)

One possibility is that during the upgrade (which was quite messy in itself), some permissions have been messed up, but this is just a hypothesis.

If anyone has a clue what this might be, it would be great.

EDIT: after a bit more time spent looking at the db, I’ve seen that on the table ‘files’, the auto increment is working, since after trying to upload and getting the error it goes up, but there is no new row inserted, thus the submission_files constraint fails. Upon reading a bit more, I think it might have to do with a deadlock in the transaction. We are still trying to figure this out

EDIT2:

[07-Jul-2022 11:54:46 UTC] Database query
insert into `files` (`path`, `mimetype`) values (?, ?)
["journals\/2\/articles\/12111\/46346346346.pdf","application\/pdf"]
[07-Jul-2022 11:54:46 UTC] Database query
SELECT * FROM genres
			WHERE	enabled = ? AND context_id = ?
			ORDER BY seq
[1,2]
[07-Jul-2022 11:54:46 UTC] Database query
SELECT * FROM genre_settings WHERE genre_id = ?
["1"]
[07-Jul-2022 11:54:46 UTC] Database query
SELECT * FROM genre_settings WHERE genre_id = ?
["14"]
[07-Jul-2022 11:54:46 UTC] Database query
select `file_id` as `id`, `path`, `mimetype` from `files` where `file_id` = ? limit 1
[27722]
[07-Jul-2022 11:54:46 UTC] Database query
select `file_id` as `id`, `path`, `mimetype` from `files` where `file_id` = ? limit 1
[27722]
[07-Jul-2022 11:54:46 UTC] Database query
delete from `files` where `file_id` = ?
["27722"]
[07-Jul-2022 11:54:46 UTC] Slim Application Error:
Type: Illuminate\Database\QueryException
Code: 23000

It seems that OJS deletes the row very soon after it creates it

[07-Jul-2022 11:54:46 UTC] Database query
delete from `files` where `file_id` = ?
["27722"]