Jump to content

1.5.2 CSV Import - Internal Server Error


Recommended Posts

Hi,

 

I have installed a new copy of prestashop and I managed to import 1000 products (split into 3 files) and the combinations.

 

I am having a problem when I go to update/add more products.

 

I have a list with 200 new or updated entried and am ticking "Use product reference as key". It fails after around 100 seconds. I have increased max execution time by php.ini to 300 seconds.

 

If i try and import 5 of this list it works, but if I try more such as 50 it fails with Internal Server Error 500. There is nothing in the error logs of the server.

 

Anyone got any ideas? I really need to be able to update products by CSV import as they change daily from the suppliers. Is there any way I can see whats going on?

 

Thanks in advace

 

Jason

Link to comment
Share on other sites

  • 2 weeks later...

Ulises Ramos, your solution was not helpful for me. I still cannot import combinations. As I understand if you have more then 100 rows in a file you will see this error and it is not depend on what you are importing (products, combonations ...).

Link to comment
Share on other sites

During my investigation I have found that it is a bug in classes\Product.php file line 1366.

try to add the line :

$id_shop_list = array();

 

as you can see in the code:

 $combination->default_on = (int)$default;
 $combination->minimal_quantity = (int)$minimal_quantity;
 // if we add a combination for this shop and this product does not use the combination feature in other shop,
 // we clone the default combination in every shop linked to this product
 if ($default && !$this->hasAttributesInOtherShops())
 {
  $id_shop_list_array = Product::getShopsByProduct($this->id);
  $id_shop_list = array();
  foreach ($id_shop_list_array as $array_shop)
   $id_shop_list[] = $array_shop['id_shop'];
 }
 if (count($id_shop_list))
  $combination->id_shop_list = $id_shop_list;
 $combination->add();

 

It helps for me.

Link to comment
Share on other sites

Hi guys,

 

I upgraded the shop to 1.5.3.1 and have managed to get the products to import sucessfully. I just clicked back and import csv 3 or 4 times and eventually it did the import properly. I have done this 3 times now and it has worked eventually by just keep trying. Not ideal but at least it works eventually.

 

I also managed to import a combination list of 4000 and that went straight in with no probems.

 

Thanks

 

Jason

Link to comment
Share on other sites

  • 4 months later...

If you get error 500 after X seconds, it is 99% a timeout issue.

 

To be sure, you can check the main error log.

 

Even if you increase the php timeout in your php.ini, you host may ignore it, or there could be another timeout setting (in Apache or FastCGI).

 

?Best to ask your host how to increase the timeout settings,

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Go to SEARCH and disable INDEXING.

 

After import just go to that page and index the products on the link provided

 

I confirm that this seems to do the trick. At first I managed to import only 80 products (out of 377) until it stopped, now after temporarily disabling the search indexing it is already at 200 products and counting - no error so far.

 

Edit: it stopped after 250 products because I ran out of disk space. I resumed uploading after increasing the disk space and it did go through the end without problems.

Edited by outlet.ee (see edit history)
Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...