Forum

Thread tagged as: Problem, Error, Suggestions

Asset Upload Timeout

I'm unable to upload large-ish files through the Assets app as it keeps timing out after 30 seconds, and no response header is returned. Chrome Dev console just shows the network request as (cancelled).

My PHP INI max_execution_time is set to 180, and I've made sure the max upload and max post limits are well more than sufficient. I can see that you're using dropzone... is it possible the dropzone timeout setting is set to 30 seconds?

Also, as a UI suggestion, please bring back the upload progress bars that existed in Perch 2! It really helped shed light on whether things have crapped out or not. Perch 3 gives absolutely no feedback after timeout, so unless you dig into the network tab there's no way of knowing if the connection is still working or not.

Health check

 PHP 5.6.31 is up to date
 MySQL 5.6.38 is up to date
 Image processing available

Summary information

Perch: 3.0.10, PHP: 5.6.31, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: FreeBSD, cgi-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10)
App runtimes: <?php $apps_list = [ ];
PERCH_LOGINPATH: /perch
PERCH_PATH: [redacted]/perch
PERCH_CORE: [redacted]/perch/core
PERCH_RESFILEPATH: [redacted]/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 256M, Total max file upload: 32M
F1: 703afb4234a9c0c65acd4966a22795dd
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
HTTP_HOST: [redacted]
DOCUMENT_ROOT: [redacted]
REQUEST_URI: /perch/core/settings/diagnostics/
Chad Tiffin

Chad Tiffin 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you have control of the server?

I don't have SSH root access, but I can configure the PHP INI settings yes.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is there anything at the firewall level that might be terminating long connections?

Have you tried uploading the same assets in your dev environment?

Doubtful. I have a Perch 2.8 installation running on the same shared server, so I tried uploading the file on that, and it worked fine there...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you tried uploading the same assets in your dev environment?

I don't have a server environment running on my local machine, I'm developing directly on a development space on this remote server. I tried it on a separate Perch 3 install however and it also timed out. As I mentioned I also tried it on a Perch 2.8 install on the SAME server and it worked fine. To me that's a pretty clear indication that Perch 3 is causing the time out, for whatever reason. The fact that there is no response header being returned indicates that its a client side request issue.

I did some googling, and I found a post where someone else was experiencing the exact same symptoms (PHP settings fine, request cancelled with no response headers): https://github.com/enyo/dropzone/issues/1561. This was found to be an issue with dropzone. So I went poking into Perch and lo and behold you guys are also using dropzone. Dropzone has a timeout property in its init function (which I assume defaults at 30 seconds).

What is Perch's dropzone timeout set at for the ajax request?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think we're setting one, so yes, that's probably your problem.

Ok thanks... so maybe in a future release you can crank it up to a couple minutes or something so the uploader can handle larger files?

So just to confirm my findings for anyone else running into this problem (and hopefully to assist in fixing it future releases) -- the lack of defining a timeout setting is 100% the problem.

I dug through the JS in the Perch core and found where dropzone was being initialized (in 3 different places), added a timeout property of 300000ms for all of them, and voila my problem is solved and Perch can handle larger files!