Jump to content

[Solved]CSV Import time out


Major Bob

Recommended Posts

Hi,

 

I'm trying to import my combinations via CSV import but I continually get a 504 time out error. I've already imported my products and categories successfully.

There are up to 3000 combinations but I've reduced this to smaller files with only 500 to try and complete the process.

Every attempt I make times out at 300 seconds.

 

This is what I've tried so far:

I've changed the php.ini file, altering the time out value to 5400 seconds but it still times out after 300.

I've also looked into the config.php file and the files in the config folder to make sure nothing is overriding the php.ini file but it's not.

My host has increased the memory to 512 and made sure my PHP version isn't outdated.

Can anybody provide any insight as to what may be causing the process to time out at 300 seconds?

Edited by Major Bob (see edit history)
Link to comment
Share on other sites

please check if there is any where else that you have set timeout to 300 seconds that may override your PHP.ini file.

 

try to search all files contains "set_time_limit(300)", to see if you can find it.

 

or maybe your service provider does not allow you change the script timeout limit.

Link to comment
Share on other sites

Shokinro: Thank you for your input. I've tried to modify AdminImportController.php as you suggested but it had no effect. I've also downloaded every file and searched through them for "set_time_limit(300)" and other similar queries. There were no relevant results.

 

RuthMoore: Why do you suggest 3000 seconds? I've set it to 300,3000,5400 and there is no change whatever the value.

 

One thing I have noticed is that the time out has been 300 seconds one day and 600 seconds the next day. What could cause this? My hosting provider is looking into the issue but believes it is something to do with the prestashop script.

Link to comment
Share on other sites

My hosting provider has indicated that the server configuration will allow a longer time than 300 or even 3000 seconds.

 

I've searched for as small phrase as "time" and "300" and checked all PHP files. I've also been through each php.ini file and each one is set to a minimum of 5000.

 

What strikes me as strange is how it normally times out at 300s but timed out at 600s for one day.

Link to comment
Share on other sites

maybe you can write a very simple test PHP script to loop 1000 times, for each loop sleep 3 sec.

Place it under your store root and  run the script to see if it will timeout or not.

it is still times out, I think it is your server environment issue. nothing to do with PrestaShop.

Link to comment
Share on other sites

That's a good idea. I've written a similar script and run it multiple times over varying sleep lengths to see what's going on.

 

The script only finished in 5 cases out of 14 but the results showed that it didn't begin when I executed it, there was a delay before the script actually began(up to 215 seconds in one case).

In the other 9 cases, the script appeared to run for over 900 seconds in each case before eventually showing 'The connection has reset' error.

 

As it's not timing out at 300 seconds as before, I believe that Prestashop is at fault for the 300 second limit (rather than the server).

 

There is obviously a delay before my script begins though and I think that this is shortening the 300s time limit imposed by Prestashop.

 

Now I know a little bit more about the cause, but I have 2 problems instead of one.

Edited by Major Bob (see edit history)
Link to comment
Share on other sites

  • 5 months later...

After a LOT of trial and error and troubleshooting, my host has realised that there is a set limit restricting timeouts to 300 seconds. However, they are adamant that this should be plenty of time and that there is an underlying issue with the Prestashop import process.

Link to comment
Share on other sites

I've upgraded my store to 1.7.0.0 and tried to upload the exact same csv files again.

All files were uploaded quickly and correctly, so the problem was mostly with the uploading process in the 1.6 back office. On a side-note, there is a progress bar in 1.7 that shows the status of the upload and an email is sent to confirm that uploading is complete. Great improvement

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...