Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Memory size exception when importing
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

I have created a simple profile to import data in Magento, but I allways get a memory size exception :

Fatal errorAllowed memory size of 134217728 bytes exhausted (tried to allocate 393216 bytesin C:\xampp\htdocs\magento\lib\Varien\Convert\Container\Abstract.php on line 137

I put the memory_limit in the php.ini file at 128Mo, but it’s allways the same.

Here is the XML file of the Profile Action

<action type="varien/convert_adapter_io" method="load">
    <var 
name="type">file</var>
    <var 
name="path">C:\xampp\htdocs\magento\var\import</var>
    <var 
name="filename"><![CDATA[3_suisses.csv]]></var>
</
action>

<
action type="varien/convert_parser_csv" method="parse">
    <var 
name="delimiter"><![CDATA[\t]]></var>
    <var 
name="enclose"><![CDATA["]]></var>
    <var name="
fieldnames">true</var>
</action>

<action type="
varien/convert_mapper_column" method="map">
    <var name="
Sku"><![CDATA[entity_id]]></var>
    <var name="
Nom"><![CDATA[name]]></var>
</action>

<action type="
catalog/convert_parser_product" method="parse">
    <var name="
store"><![CDATA[0]]></var>
</action>

<action type="
catalog/convert_adapter_product" method="save">
    <var name="
store"><![CDATA[0]]></var>
</action>

Anyone can help me ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

Okay, I know why I got this memory size exception.
It seemes that my import file size was too heavy.
I truncated it and now it works, except that I got another error now :

Missing SKUskipping the record (Line1)

And here is my CSV file :

Sku    Nom
1005    Parka AIGLE
.
1006    La veste en lin majoritaire 3SUISSES COLLECTIONS.
1012    Parka Pipe Spring COLOMBIA.
1013    Parka COLOMBIA
1014    Parka Sugarloaf COLOMBIA
.
1017    Coupe-vent AROKANIA.
1021    La veste en gabardine 3SUISSES COLLECTIONS.
1024    Le blouson Bowing ENERGIE.
1029    Parka Ã¢â‚¬Å“3 en 1â€ HENRY WILLIAMS
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

use “sku” attribute instead of “entity_id”.

what was the size of original file?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

I don’t know what was the file size.
But I will tell you as soon as I try the import module with my full original data file which is about 12,2 Mo.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

Hi Moshe !

This is the file I try to import

"SKU"    "NOM"
"a1005"    "Parka AIGLE."
"a1006"    "La veste en lin majoritaire 3SUISSES COLLECTIONS."
"a1012"    "Parka Pipe Spring COLOMBIA."
"a1013"    "Parka COLOMBIA"
"a1014"    "Parka Sugarloaf COLOMBIA."
"a1017"    "Coupe-vent AROKANIA."
"a1021"    "La veste en gabardine 3SUISSES COLLECTIONS."
"a1024"    "Le blouson Bowing ENERGIE."
"a1029"    "Parka  HENRY WILLIAMS"

And here is the mapping file that I got from Magento

<action type="varien/convert_adapter_io" method="load">
    <var 
name="type">file</var>
    <var 
name="path">C:\xampp\htdocs\magento\var\import\</var>
    <var 
name="filename"><![CDATA[3_suisses.csv]]></var>
</
action>

<
action type="varien/convert_parser_csv" method="parse">
    <var 
name="delimiter"><![CDATA[\t]]></var>
    <var 
name="enclose"><![CDATA["]]></var>
    <var name="
fieldnames">true</var>
</action>

<action type="
varien/convert_mapper_column" method="map">
    <var name="
NOM"><![CDATA[name]]></var>
    <var name="
SKU"><![CDATA[sku]]></var>
</action>

<action type="
catalog/convert_parser_product" method="parse">
    <var name="
store"><![CDATA[0]]></var>
</action>

<action type="
catalog/convert_adapter_product" method="save">
    <var name="
store"><![CDATA[0]]></var>
</action>

And this is what I get when trying to import the file to the Magento database :
    * 
Starting profile executionplease wait...

    * 
Starting Varien_Convert_Adapter_Io :: load
    
Loaded successfullyC:\xampp\htdocs\magento\var\import\/3_suisses.csv [361 byte(s)]
    
Starting Varien_Convert_Parser_Csv :: parse
    
Starting Varien_Convert_Mapper_Column :: map
    
Starting Mage_Catalog_Model_Convert_Parser_Product :: parse
    
Missing SKUskipping the record (Line1)
    * 
Missing SKUskipping the record (Line2)
    * 
Missing SKUskipping the record (Line3)
    * 
Missing SKUskipping the record (Line4)
    * 
Missing SKUskipping the record (Line5)
    * 
Missing SKUskipping the record (Line6)
    * 
Missing SKUskipping the record (Line7)
    * 
Missing SKUskipping the record (Line8)
    * 
Missing SKUskipping the record (Line9)
    * 
Starting Mage_Catalog_Model_Convert_Adapter_Product :: save
    
No product collections found
    
Finished profile execution.

Any hint ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Yes, looks like the attribute code and alias are swapped

<action type="varien/convert_mapper_column" method="map">
    <var 
name="NOM"><![CDATA[name]]></var>
    <var 
name="SKU"><![CDATA[sku]]></var>
</
action>
should be
<action type="varien/convert_mapper_column" method="map">
    <var 
name="name"><![CDATA[NOM]]></var>
    <var 
name="sku"><![CDATA[SKU]]></var>
</
action>
I remember clearly that was ok in tests.. Will check again.

Try to use ‘sku’ and ‘name’ as headings in import file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

Hi,
It doesn’t work with nom and sku in lowercase either.
I will try it again by removing the quotation marks around the fields headers

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

Is there a way to send you the file I try tio import ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

did you try with “sku” and “name” ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

Yes, I inverted the datas like this :

<action type="varien/convert_mapper_column" method="map">
    <var 
name="sku"><![CDATA[SKU]]></var>
<var 
name="name"><![CDATA[NOM]]></var>
</
action>

Is this what you meant I should do ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

No, i’m trying to simplify the issue, and have a mapping same as attribute name.
sku => sku
name => name

and also change 1st line in file to be:
“sku”, “name”

If it doesn’t work, please paste the error message

 
Magento Community Magento Community
Magento Community
Magento Community
 
Capitaine Commerce
Member
 
Avatar
Total Posts:  68
Joined:  2007-09-01
Lille, France
 

All right Moshe !
I eventually manage to import my first products in Magento.

First, you don’t have to invert the field keys as you told me in the XML action profile file.

Second, it looked like my CSV file was corrupted in some way.
All I did was to put the sku field not in the first column of my file, but in the second column, and it worked !
Well, the import worked but the products don’t appear in the Products manager module. I guess I have to import all the correct fields for it to work.

Thanks for your help anyway !

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