Magento Forum

Exporting products to CSV results in “Invalid entity model” error
 
cre8ve123
Jr. Member
 
Total Posts:  1
Joined:  2012-06-18
 

Hi,

Can anyone explain why this might be happening?

I have two similar websites, one basically a clone of the other but with different products.

One website works fine when exporting to CSV
The other throws up this error: Invalid entity model

No other information available. The var directory is CHMOD 777 so it should be able to write to it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Estigy
Jr. Member
 
Total Posts:  6
Joined:  2012-05-17
 

Hi, cre8ve123.

I’m experiencing exactly the same thing here. The chmod settings seem to be ok.

Oh, and I’m using Magento CE 1.7.

Hoping for answers, too wink

Regards, E

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yanith
Jr. Member
 
Total Posts:  22
Joined:  2011-09-21
 

Same problem using Magento ver. 1.5.0.1

Log Error

2012-10-09T15:56:27+00:00 ERR (3): 
exception \'Mage_Core_Exception\' with message \'Destination file path must be a string\' in /var/www/vhosts/site.com/httpdocs/app/Mage.php:550
Stack trace
:
#0 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php(64): Mage::throwException(\'Destination fil...\')
#1 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/Core/Model/Config.php(1254): Mage_ImportExport_Model_Export_Adapter_Abstract->__construct(Array)
#2 /var/www/vhosts/site.com/httpdocs/app/Mage.php(432): Mage_Core_Model_Config->getModelInstance(\'importexport/ex...\', Array)
#3 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/ImportExport/Model/Export.php(119): Mage::getModel(\'importexport/ex...\')
#4 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/ImportExport/Model/Export.php(251): Mage_ImportExport_Model_Export->_getWriter()
#5 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php(86): Mage_ImportExport_Model_Export->getFileName()
#6 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_ImportExport_Adminhtml_ExportController->exportAction()
#7 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch(\'export\')
#8 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /var/www/vhosts/site.com/httpdocs/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
#10 /var/www/vhosts/site.com/httpdocs/app/Mage.php(627): Mage_Core_Model_App->run(Array)
#11 /var/www/vhosts/site.com/httpdocs/index.php(80): Mage::run(\'\', \'store\')
#12 {main}

Folder \"var\" and everything inside it has the right CHMOD 777
The TMP folder had to be defined on the Zend Framework here /lib/Zend/Cache/Backend/File.php

Everything else is identical to the staging server

Any thoughts?

 
Magento Community Magento Community
Magento Community
Magento Community
 
epvicky
Member
 
Total Posts:  59
Joined:  2011-07-28
 

I think it occurs because of file permission problems and then checkout the tmp folder path in File.php of zend library

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pardeep Kumar
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2011-03-02
 

To resolve it open
app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php

around line no. 60

replace
$destination = tempnam(sys_get_temp_dir(), ‘importexport_’);

to
$destination = tempnam(Mage::getBaseDir() . ‘/var/tmp/’ , ‘importexport_’);

 
Magento Community Magento Community
Magento Community
Magento Community
 
guillemweb
Jr. Member
 
Total Posts:  8
Joined:  2011-09-05
 

Thanks pardeep! Good solution! grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
shareef_sts
Jr. Member
 
Avatar
Total Posts:  2
Joined:  2013-05-08
New Jersey
 

I don’t know why, but this solution didn’t work for me.

I’m running Magento 1.7.0.2

Invalid entity model Error still appears and I can’t export products

any help is appreciated.

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
lapongua
Jr. Member
 
Total Posts:  9
Joined:  2010-01-28
 

Same Isue on magento 1.7.0.2. has someone solved?

thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
udayaugustin
Jr. Member
 
Total Posts:  3
Joined:  2011-07-13
 

I am using magento version 1.7.0.2. .It is worked perfectly for me.

Did you create the folder tmp under var folder?.

Thanks!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
cemalden
Jr. Member
 
Total Posts:  7
Joined:  2013-12-15
 

Create a ‘tmp’ file under magento root > var >
and open Abstract.php file and replace below codes at line 60

//$destination = tempnam(sys_get_temp_dir(), ‘importexport_’);
$destination = tempnam(Mage::getBaseDir() . ‘/var/tmp/’ , ‘importexport_’);

it should work

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
goughie27
Jr. Member
 
Total Posts:  1
Joined:  2012-05-15
 

Hi Guys,

I have changed the code at line 60 and now the following error is generated

Parse error: syntax error, unexpected T_VAR in /home/content/h/i/p/hipp5651/html/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php on line 60

here is my code:
final public function __construct($destination = null)
{
if (!$destination) {
Line 60 $destination = tempnam(sys_get_temp_dir(), ‘importexport_’);
Line 61 $destination = tempnam(Mage::getBaseDir() . ‘/var/tmp/’ , ‘importexport_’);
}
if (!is_string($destination)) {
Mage::throwException(Mage::helper(’importexport’)->__(’Destination file path must be a string’));
}
$pathinfo = pathinfo($destination);

if (empty($pathinfo[’dirname’]) || !is_writable($pathinfo[’dirname’])) {
Mage::throwException(Mage::helper(’importexport’)->__(’Destination directory is not writable’));
}
if (is_file($destination) && !is_writable($destination)) {
Mage::throwException(Mage::helper(’importexport’)->__(’Destination file is not writable’));
}
$this->_destination = $destination;

$this->_init();
}

Any ideas what the problem could be?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
reindercompany
Jr. Member
 
Total Posts:  1
Joined:  2013-01-10
 
goughie27 - 20 February 2014 10:43 AM

Parse error: syntax error, unexpected T_VAR in /home/content/h/i/p/hipp5651/html/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php on line 60

I was having this same error. This came from copying this:

$destination = tempnam(Mage::getBaseDir() . ‘/var/tmp/’ , ‘importexport_’);

directly from the thread. The single quotes got copied over incorreclty. To fix this I just deleted the quotes and replace them with ones I typed myself.

Hope this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooltide
Jr. Member
 
Total Posts:  1
Joined:  2014-02-10
 

Thanks to cemalden and reindercompany.

Saved me hours. The original solution worked once the single speech marks were changed.

Bob on!

cheese

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top