Import xml out of memory

I have an XML file, with a couple of articles (4) and when I try to upload it, the output show me:

Validation errors:
Memory allocation failed : growing buffer
Memory allocation failed : growing buffer
The document has no document element.

It doesn’t happen when I upload a smaller XML document, with just 3 articles

When I go to the PHP log I found this:

[16-Feb-2018 12:57:01 Europe/Berlin] PHP Fatal error: Out of memory (allocated 74711040) (tried to allocate 12908240 bytes) in C:\xampp\htdocs\ojs\lib\pkp\classes\xslt\XMLTypeDescription.inc.php on line 112

I have tried to upload the same data in different ojs installations but on the same server, and the result was the same.

A friend of me try it on a different server and it works for him.

I have to upload… 1200 articles!

If you go to OJS dashboard => Administration => System Information => Extended PHP Information then what is your memory_limit setting?

memory_limit 256000M

Are your sure it is that high? That would be 256 gigabytes? The usual amount you see there is 128M, 256M or 512M.

The amount of memory that created the out of memory error above was 12.8 megabytes, so something is not adding up here.

1 Like

Captura

This might be the case that PHP.INI was coded with this erroneous value. I cannot confirm, but would make an educated guess that the intent was 256 MegaBytes (256M). But since 256000M is ridiculously out of range, maybe PHP is resorting to some kind of badly calculated guess (or the result of an overflow).

Suggest that the PHP.INI file for the server environment be examined and corrected.

yes, right… someone else use the server for debug propouse, now i have a server for me, with 512M

I have a new setup for the same site, memory limit 512M.
But when i try to upload a file, i got this:

When i go to the php log i got this error:

[20-Feb-2018 23:42:17 America/Los_Angeles] PHP Parse error: syntax error, unexpected ‘{’ in C:\inetpub\wwwroot\Newsletter\ojs\lib\pkp\lib\vendor\slim\slim\Slim\App.php on line 299

which is the runner application:

  • Run application
    *This method traverses the application middleware stack and then sends the
  • resultant Response object to the HTTP client.

and this:

[20-Feb-2018 23:39:54 America/Los_Angeles] PHP Warning: DOMDocument::loadXML(): Premature end of data in tag issues line 2 in Entity, line: 88 in C:\inetpub\wwwroot\Newsletter\ojs\plugins\importexport\native\NativeImportExportPlugin.inc.php on line 133

In the line 133 of the import/export module is this function: $document->loadXml($xmlString);

You need at least PHP 5.6, you probably have 5.4

1 Like

I have discovered (by asking my question here) that Slim needs PHP 5.6 as line 299 is part of a try/catch/finally structure where the finally keyword made its appearance in PHP 5.5. There may be other parts of Slim that justifies it’s stated requirement for PHP 5.6. I have not yet found any other part of OJS3.1.0 that has PHP 5.6 specific coding - but still looking.

The XML error will need to have the document being imported examined where indicated.

1 Like

OKye, now is working… with a couple of row imported… but when the file is bigger, I have an other problem:

In the php log i got this:

[21-Feb-2018 13:17:19 Europe/Belgrade] PHP Strict Standards: Declaration of CategoryGridHandler::doSpecificFetchGridActions() should be compatible with GridHandler::doSpecificFetchGridActions($args, $request, $templateMgr) in C:\inetpub\wwwroot\Newsletter\ojs\lib\pkp\classes\controllers\grid\CategoryGridHandler.inc.php on line 493
[21-Feb-2018 13:17:19 Europe/Belgrade] PHP Strict Standards: Declaration of SystemInfoGridCategoryRow::initialize() should be compatible with GridRow::initialize($request, $template = NULL) in C:\inetpub\wwwroot\Newsletter\ojs\lib\pkp\controllers\grid\admin\systemInfo\SystemInfoGridCategoryRow.inc.php on line 43
[21-Feb-2018 13:17:19 Europe/Belgrade] PHP Strict Standards: Declaration of SystemInfoGridHandler::initialize() should be compatible with CategoryGridHandler::initialize($request, $args = NULL) in C:\inetpub\wwwroot\Newsletter\ojs\lib\pkp\controllers\grid\admin\systemInfo\SystemInfoGridHandler.inc.php on line 19
[21-Feb-2018 13:17:19 Europe/Belgrade] PHP Strict Standards: Declaration of SystemInfoGridHandler::loadCategoryData() should be compatible with CategoryGridHandler::loadCategoryData($request, &$categoryDataElement, $filter = NULL) in C:\inetpub\wwwroot\Newsletter\ojs\lib\pkp\controllers\grid\admin\systemInfo\SystemInfoGridHandler.inc.php on line 19

The QuickSubmit module is also broken!!

Hi @josuevalrob,

If this problem only appears for larger files, see this FAQ entry. If it’s for all uploads, check file permissions per this FAQ entry.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Thanks you so much!.
My file was 21MB
I update the php.ini

  • post_max_size
  • upload_max_filesize
  • memory_limit
    It’s working now.
1 Like

Now i have another problem, maybe i should open other post…

In my test OJS site the import is working, but in the production OJS site, (which is in the same server) the import is not working, maybe is for a configuration in the OJS site.

This is what i got:
d
And in the PHP error_log show me this:

[22-Feb-2018 08:52:25 Europe/Belgrade] PHP Strict Standards: Declaration of ExportableIssuesListGridHandler::initialize() should be compatible with IssueGridHandler::initialize($request, $args = NULL) in C:\inetpub\wwwroot\Newsletter\CEDEX\controllers\grid\issues\ExportableIssuesListGridHandler.inc.php on line 18
[22-Feb-2018 08:52:26 Europe/Belgrade] PHP Strict Standards: Declaration of SubmissionFileDAO::fromRow() should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in C:\inetpub\wwwroot\Newsletter\CEDEX\classes\article\SubmissionFileDAO.inc.php on line 23
[22-Feb-2018 08:52:41 Europe/Belgrade] PHP Strict Standards: Declaration of TemporaryFileManager::downloadFile() should be compatible with FileManager::downloadFile($filePath, $mediaType = NULL, $inline = false, $fileName = NULL) in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\file\TemporaryFileManager.inc.php on line 19
[22-Feb-2018 08:52:41 Europe/Belgrade] PHP Strict Standards: Declaration of TemporaryFileManager::deleteFile() should be compatible with FileManager::deleteFile($filePath) in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\file\TemporaryFileManager.inc.php on line 19
[22-Feb-2018 08:52:41 Europe/Belgrade] PHP Strict Standards: Only variables should be passed by reference in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\file\TemporaryFileManager.inc.php on line 99
[22-Feb-2018 08:52:41 Europe/Belgrade] PHP Strict Standards: Only variables should be passed by reference in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\core\PKPString.inc.php on line 447
[22-Feb-2018 08:52:44 Europe/Belgrade] PHP Strict Standards: Only variables should be assigned by reference in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\file\TemporaryFileDAO.inc.php on line 37
[22-Feb-2018 08:52:44 Europe/Belgrade] PHP Strict Standards: Declaration of TemporaryFileManager::downloadFile() should be compatible with FileManager::downloadFile($filePath, $mediaType = NULL, $inline = false, $fileName = NULL) in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\file\TemporaryFileManager.inc.php on line 19
[22-Feb-2018 08:52:44 Europe/Belgrade] PHP Strict Standards: Declaration of TemporaryFileManager::deleteFile() should be compatible with FileManager::deleteFile($filePath) in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\file\TemporaryFileManager.inc.php on line 19
[22-Feb-2018 08:52:44 Europe/Belgrade] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in C:\inetpub\wwwroot\Newsletter\CEDEX\plugins\importexport\native\NativeImportExportPlugin.inc.php on line 133
[22-Feb-2018 08:52:44 Europe/Belgrade] PHP Notice: Trying to get property of non-object in C:\inetpub\wwwroot\Newsletter\CEDEX\plugins\importexport\native\NativeImportExportPlugin.inc.php on line 134
[22-Feb-2018 08:52:44 Europe/Belgrade] PHP Warning: DOMDocument::loadXML(): Empty string supplied as input in C:\inetpub\wwwroot\Newsletter\CEDEX\lib\pkp\classes\xslt\XMLTypeDescription.inc.php on line 120

And with large xml files (35Mb) I got this:

[22-Feb-2018 10:03:12 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_pdo_firebird.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:12 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_interbase.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:12 Europe/Belgrade] PHP Warning: PHP Startup: Invalid library (appears to be a Zend Extension, try loading using zend_extension=php_opcache.dll from php.ini) in Unknown on line 0
[22-Feb-2018 10:03:12 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_sybase_ct.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:12 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_pdo_oci.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:12 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_oci8_12c.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:13 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_pdo_firebird.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:13 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_interbase.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:13 Europe/Belgrade] PHP Warning: PHP Startup: Invalid library (appears to be a Zend Extension, try loading using zend_extension=php_opcache.dll from php.ini) in Unknown on line 0
[22-Feb-2018 10:03:13 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_sybase_ct.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:13 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_pdo_oci.dll’ - The specified module could not be found.
in Unknown on line 0
[22-Feb-2018 10:03:13 Europe/Belgrade] PHP Warning: PHP Startup: Unable to load dynamic library ‘C:\Program Files (x86)\PHP\v5.6\ext\php_oci8_12c.dll’ - The specified module could not be found.
in Unknown on line 0