Hi everybody,

I found that downloading large private files (> 40Mb at php.ini memory_limit = 128 MB) is impossible with UC.

Step by step:

  1. Install fresh Drupal 7 and configure default file download method as 'Private local files served by Drupal'. Private file system path: sites/default/files/private.
  2. Tune your front web-server properly. For nginx it's:
    location ^~ /sites/default/files/private/ {
        internal;
    }
  3. Configure some module that manages private files access rights. I use this one: https://www.drupal.org/project/private_files_download_permission. Configure it so that the root private files path (sites/default/files/private/) be accessible for e.g. admin.
  4. Download and enable UC:
    drush dl ultimate_cron && drush en -y ultimate_cron
  5. Go to your private directory and create two dummy files:
    cd <Drupal_Root>/sites/default/files/private/; dd if=/dev/zero of=test40.dat bs=1M count=40; dd if=/dev/zero of=test400.dat bs=1M count=400
  6. Try to download both (as an admin):
    http://your-site/system/files/test40.dat
    http://your-site/system/files/test400.dat

I cannot download the large file and PHP generates an error:
FastCGI sent in stderr: "PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 129761280 bytes) in /var/www/drupal/includes/file.inc on line 1968
Disabling Ultimate Cron helps to solve the problem.

It's quite major problem for me, could you please investigate it?

Thank you,
Alexander

CommentFileSizeAuthor
#4 private_file_system_is-2559429-4.patch543 bytesvurt

Comments

Chewits created an issue. See original summary.

Chewits’s picture

Issue summary: View changes
klapper’s picture

I guess, the reason is the following code in ultimate_cron.poorman.inc:

// Output buffering messes up Drush ...
if (ultimate_cron_poorman_capable()) {
ob_start('_ultimate_cron_poorman_page_flush');
}

The function ultimate_cron_poorman_capable should return FALSE for the path "system/files".

vurt’s picture

StatusFileSize
new543 bytes

Here is a patch implementing the finding of klapper. It is against version 7.x-2.x-dev from 2015-Sep-19.

  • arnested committed bd67352 on 7.x-2.x authored by vurt
    Issue #2559429 by vurt, Chewits, klapper: Private file system is not...
arnested’s picture

Status: Active » Fixed

Thank you for your contribution, everyone. I have added the patch to the 7.x-2.x branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.