Trying to import issues/articles to OJS like other times, but now this happen:
We are using xml based on an exported article from another journal.
This is the console:
And this is the error log:
[23-Feb-2022 10:24:31 Europe/Budapest] PHP Notice: Undefined offset: 0 in /var/www/html/ojs-3.3.0-8/lib/pkp/classes/submission/PKPSubmission.inc.php on line 163
[23-Feb-2022 10:24:44 Europe/Budapest] PHP Notice: Undefined variable: newFileId in /var/www/html/ojs-3.3.0-8/lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFileFilter.inc.php on line 323
[23-Feb-2022 10:24:44 Europe/Budapest] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field 'file_id' doesn't have a default value in /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace:
#0 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)
#1 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(464): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}('insert into `su...', Array)
#3 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('insert into `su...', Array, Object(Closure))
#4 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connec in /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671
[23-Feb-2022 10:25:42 Europe/Budapest] ojs2: 404 Not Found
[23-Feb-2022 10:25:52 Europe/Budapest] PHP Notice: Undefined offset: 0 in /var/www/html/ojs-3.3.0-8/lib/pkp/classes/submission/PKPSubmission.inc.php on line 163
[23-Feb-2022 10:25:52 Europe/Budapest] PHP Notice: Undefined offset: 0 in /var/www/html/ojs-3.3.0-8/lib/pkp/classes/submission/PKPSubmission.inc.php on line 163
We have no idea that where should be this "Field ‘file_id’ doesn’t have a default value in "
Check how you’re specifying your files, and ensure that all of them are present where they’re supposed to be. (I understand that this is a pretty useless error message – if we can confirm that this is the problem, we can file an issue to improve it.)
Regards,
Alec Smecher
Public Knowledge Project Team
Thank you @asmecher,
At the previous versions we got experience in using this plugin for importing files and metadata. We have a multi-journal system, and the part of it came from archives by importing.
We have tried to import from another url and from base64 content too. I copy here the two samples which gives the error message.
XML importing from url:
I’m afraid that doesn’t give me much to go on; the XML looks OK but obviously a file is failing to import. Is it possible that the file permissions are set in your files directory such that the import is not able to place files there? The file permission details will depend on your server and how you’re attempting to import the files – e.g. web-based, or command line.
Regards,
Alec Smecher
Public Knowledge Project Team
I’m sorry.
There is a log line. It could still belong here.
[16-Mar-2022 09:33:27 UTC] PHP Notice: Undefined variable: newFileId in /path to ojs//lib/pkp/plugins/importexport/native/filter/NativeXmlSubmissionFileFilter.inc.php on line 323
And then he comes.
[16-Mar-2022 09:33:27 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field ‘file_id’ doesn’t have a default value in /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace: #0 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL) #1 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(464): Doctrine\DBAL\Driver\PDOStatement->execute() #2 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database{closure}(‘insert into su...', Array) #3 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('insert into su…’, Array, Object(Closure)) #4 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connec in /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671
At a glance, it looks like your XML is missing the filesize attribute to the <file> element; try specifying the file size there. That previously would have caused a more helpful warning message, but it appears that our addition of a FOREIGN KEY constraint is obscuring that warning with a fatal error; I’ll fix that for the next release.
Regards,
Alec Smecher
Public Knowledge Project Team