Bepress import error when doing a second import

Describe the issue or problem
I have two journals A and B on the test site and I am importing articles to the journals using Bepress import plugin using xmls I generated.

Import to journal A finishes without issue.

The second import to B fails with SQL error Integrity constraint violation: 1062 Duplicate entry ‘’ for key ‘sessions.sessions_pkey’ (SQL: INSERT INTO sessions.

I can import one publication and the error appears. If I remove an already imported publication from the Bepress import folder, I can import one more and then the error reappears.

If I recreate the database and start importing to journal B, that import finishes without error but the error appears when I import articles to journal A. Again, the import of the first article success and the second fails with the error.

OJS 3.3 TLS, Bepress 3.3.0.0

Any ideas about what could cause this and what to do to get around the issue?

The messages the importer throws:

#18 /home/lankoski/Desktop/ojs-3.3.0-15/tools/importExport.php(69): importExport->execute()
#19 {main}

Next Illuminate\Database\QueryException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘’ for key ‘sessions.sessions_pkey’ (SQL: INSERT INTO sessions
(session_id, ip_address, user_agent, created, last_used, remember, data, domain)
VALUES
(, , , 1695924038, 1695924038, 0, , )) in /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
Stack trace:
#0 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback()
#1 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(496): Illuminate\Database\Connection->run()
#2 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php(200): Illuminate\Database\Connection->affectingStatement()
#3 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/db/DAO.inc.php(140): Illuminate\Database\Capsule\Manager::__callStatic()
#4 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/session/SessionDAO.inc.php(72): DAO->update()
#5 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/session/SessionManager.inc.php(91): SessionDAO->insertObject()
#6 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/session/SessionManager.inc.php(131): SessionManager->__construct()
#7 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/security/Validation.inc.php(390): SessionManager::getManager()
#8 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/log/SubmissionLog.inc.php(42): Validation::isLoggedInAs()
#9 /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/classes/services/PKPSubmissionFileService.inc.php(339): SubmissionLog::logEvent()
#10 /home/lankoski/Desktop/ojs-3.3.0-15/plugins/importexport/bepress/BepressImportDom.inc.php(763): PKP\Services\PKPSubmissionFileService->add()
#11 /home/lankoski/Desktop/ojs-3.3.0-15/plugins/importexport/bepress/BepressImportDom.inc.php(394): BepressImportDom->_handlePDFGalleyNode()
#12 /home/lankoski/Desktop/ojs-3.3.0-15/plugins/importexport/bepress/BepressImportDom.inc.php(73): BepressImportDom->_handleArticleNode()
#13 /home/lankoski/Desktop/ojs-3.3.0-15/plugins/importexport/bepress/BepressImportPlugin.inc.php(198): BepressImportDom->importArticle()
#14 /home/lankoski/Desktop/ojs-3.3.0-15/tools/importExport.php(63): BepressImportPlugin->executeCLI()
#15 /home/lankoski/Desktop/ojs-3.3.0-15/tools/importExport.php(69): importExport->execute()
#16 {main}
thrown in /home/lankoski/Desktop/ojs-3.3.0-15/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671

After reading comments that 3rd party plugins might not be compatible with PHP 8 that I have been using. I tested with PHP 7.4 and the second import died with the same error after importing the first article.

If I comment out \SubmissionLog::logEvent in PKPSubmissionFileService.inc.php (L329) import seems to work.

It might be that the session key ends up being empty en starting import from the command line. Maybe the plugin, session manager or session login is causing the problem.

1 Like