0

So I have this odd problem and not sure how to overcome it...

I have a script that deals with importing data into mysql from a .csv file. Due to the size of the data, and the data cleansing and consolidation that takes place in the script it can take a few minutes to complete.

About 60 seconds in to the execution (if its a large file) the page redirects to the home page, however the script continues to run in the background and it does complete successfully.

My question is why would the page be going back to the home page, when the script hasn't completed? There are no page redirects in the script its self (not until its completed anyway and this is not to the home page), and there are no logged errors, like exhausted memory or over run the max allowed time.

If I upload a small .csv file (say 6MB) the script completes and redirects to a success page as it should, however larger .csv files (say 50MB+) redirect to the home page after about 60 seconds, however the script is still running in the background and does complete about 2-3 mins later without error.

Any idea what could be causing this, I am at a loss. The data is uploading and saving etc fully and correctly its just the redirect to the home page on larger files that it making it look like it has failed and then the user tries to upload again, but the original request is still running in the background so the data then gets duplicated.

Any help is appreciated :o)

  • Anything useful in the error logs? – RiggsFolly Apr 16 '20 at 17:15
  • @RiggsFolly - No... No errors are logged, it does not fail because of the upload size or execution time ect. – Dean HIll Apr 16 '20 at 17:17
  • increase the timeout., after the timeout the script produces an errror, so it gets back to watever. – nbk Apr 16 '20 at 17:18
  • So you have no errors logged at all, even something you dont think is relevant – RiggsFolly Apr 16 '20 at 17:22
  • @nkk - the timeout is set to 600 which is more than enough time, and as I said the script does complete successfully and without error, if just redirects the user to the homepage halfway through on large files. – Dean HIll Apr 16 '20 at 17:25
  • That really does not make sense, thats why we are struggling to believe – RiggsFolly Apr 16 '20 at 17:27
  • look at this answer please there also a file limit https://stackoverflow.com/a/3829437/5193536 – nbk Apr 16 '20 at 17:28
  • I assume you are logging error and have not turned them off completely – RiggsFolly Apr 16 '20 at 17:28
  • Beside from PHP timeout, several other timeouts may be involved. Especially when no traffic is on the wire, loadbalancers or proxies tend to drop the TCP connection after a very short ammount of time (like 60 seconds..). Usually that comes with "502 - Bad gateway" – Honk der Hase Apr 16 '20 at 18:03

0 Answers0