NOTE: I've managed to fix this. See tag at bottom for solution.

I really hope someone can help me with this one, because I have no idea how to resolve it.

In my Drupal 6 setup I use the CCK filefield module for two things:

1. Adding a graphic to various nodes--either an illustrative graphic for my site articles, or attaching a webcomic to one of my four webcomics.

2. Uploading a podcast to my podcast content type (in conjunction with filefield podcast to make it more itunes friendly).

For a long time I was running everything on an Ubuntu Lucid (10.04). A few weeks ago I upgraded to an Ubuntu Precise (12.04) server which in turn upgraded versions of Apache2, PHP, mySQL. It appeared to go without a hitch.

Since the upgrade, I have been able to use filefield for my images without any issues whatsoever. I create a node, use the filefield widget to select the graphic I want to upload, and it does. Boom. No problem.

However, I cannot upload any podcasts. Essentially the widget "crashes" -- in firefox the little swirly indicator just spins into infinity, but the mp3 never gets loaded into Drupal (I've ssh'd into the server to verify this). When I try it in the Chrome browser, Chrome actually tries to report the upload progress. It stops at 1% and the Chrome reports the page has crashed.

  • It doesn't appear to be an OS based problem--the problem occurs in Firefox and Chrome (at least), on both Linux and Windows 7.
  • It doesn't appear to be an ISP-based problem (for a while I thought my ISP was throttling my "upload" bandwidth to the point where it would time out) because I can move files on to the site using SFTP.
  • It doesn't appear to be something that prevents filefield from working at ALL, because I can upload graphics using filefield without any issue. However, the graphics are significantly smaller in size than the podcasts--the largest graphic is maybe over 100K, while the smallest podcast mp3 is about 5.5mb.

Also, I can upload podcasts using filefield on my test site, which is essentially a clone of my live site running on localhost on my laptop. My laptop is also running Ubuntu (well, Kubuntu) precise (12.04), so all of the server, php, and mysql versions are identical. The only difference is that it's running locally, which could very well be significant if there's some kind of latency problem or something like that.

I'm stumped. I haven't been able to figure out why this is suddenly not working. My only hypothesis at the moment was that during the upgrade from 10.04 to 12.04, a configuration file needed to be updated to allow filefield to continue working beyond a certain size. I've checked my php settings, and that shouldn't be an issue--it's allowing file sizes up to 128M, which far exceeds the size of the files in question.

Can anyone help me? I'm utterly lost at this point, and I don't know how else to load and manage my podcasts.

Thanks for any help you can provide...

SOLUTION

When Debian switched from Lenny to Squeeze, the changed the defaults of an apache module (fcgi). In Lenny it was 1gb, in Squeeze it's 128KB.

The link below shows you how to change the settings in that module to 2gb:

http://www.goeszen.com/request-length-exceeds-maxrequestlen-apache2-debi...

Do that, restart apache, and you're good.

Thanks everyone for your suggestions.

Comments

John_B’s picture

When adjusting file upload size in php remember also to set max_post_size

remember to restart apache after changing settings :-)

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ubersoft’s picture

I checked, and max_post_size is also 128M, both for the apache and the cgi ini file.

Anything else it could be?

John_B’s picture

run a phpinfo file to check you are editing the php.ini which is being loaded. There are often others, for example specific to each virtual host, depending on setup. Also you can read off it the correct settings are there, and check you are not encountering other problems like php running in safe mode (though seems unlikely as file size is the issue).

Bear in mind that the post size may have to be much larger than file size, but 128M should be enough to upload 5.5. MB.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

John_B’s picture

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ubersoft’s picture

Ran a phpinfo check and I verified that I had modified the correct files (it reported 128M on all relevant entries).

It also stated I was using suhosin, and I went over to the suhosin.ini file in /etc/php5/conf.d, made a few suggested changes, and restarted apache2.

phpinfo reported that the changes had been made (it displayed the new values) but I still have the same problem. I was tempted to reboot the virtual machine, but you shouldn't have to do that in Linux. The new values were reflected when I restarted apache so they should be live.

This is very curious. Thanks for all the help so far.

John_B’s picture

The PHP memory limit can also be a bottleneck. The first post here http://php.net/manual/en/features.file-upload.php mentions a couple of other variables to watch, and lower down a post refers to Apache's LimitRequestBody but it seems unlikely that is set by default.

I would be tempted to make a small audio file, of the size of an image which uploads, and attempt to upload it. Then a somewhat larger one....

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ubersoft’s picture

... and have discovered the problem occurs with any filefield I use, not just the podcasting one. It is triggered by size, not file format.

I uploaded a series of files of different sizes using chromium (so I could see at what % of the upload it stalled) here's what I found:

  • 1.1 mb mp3 (1 minute file) - stalled at 16%
  • 474.4 kb mp3 (30 sec file) - stalled at 43%
  • 239.7 kb mp3 (15 sec file) - stalled at 85%
  • 122.1 kb mp3 (7-8 sec file) - success
  • 114 kb jpg - success
  • 610.7 kb png - stalled at 31%
  • 260kb jpg - stalled at 66%

I never noticed it on the graphics side because I've never tried to upload a graphic much larger than 120k.

ubersoft’s picture

Finally, I just uploaded a 35mb database file into a test database created in phpmyadmin. That worked perfectly, so I don't think it's a php, apache or Suhosin limitation specifically. The problem is occurring within Drupal and has something to do with size.

Is there something within Drupal that can set a file size limitation on filefield?

ubersoft’s picture

... I was able to load all of these files on my local test site without any problems, running the same version of Lucid, Apache2, mySQL, PHP...

This is nuts.

John_B’s picture

Yes from memory I think you can set a limit under Manage Fields in Content Types.

Sometimes you also run into upload problems when you have set a quota for the account owner inadvertently (or had it set for you if you are on shared hosting). Then one may have filled the quota, or it may have got filled up without you noticing by bloated logs or undeleted automated backups or that kind of thing.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ubersoft’s picture

... and I set them to 128M just on the theory that maybe the default settings were screwed up. No dice, though. I still have the same problem.

It appears I don't have account quotas set on my site, so I don't think that's the issue. Besides, if it were, it should have also affected my attempt to upload a 35mb SQL file into phpmyadmin, which I was able to do without any difficulty.

Thanks for the pointers, though.

John_B’s picture

You marked as fixed. But you never found what was the problem?

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ubersoft’s picture

... I put the solution at the bottom of the original post. My apologies, I thought it would be clearer. I'll also add as a separate comment just to make it extra clear.

ubersoft’s picture

When Debian switched from Lenny to Squeeze, the changed the defaults of an apache module (fcgi). In Lenny it was 1gb, in Squeeze it's 128KB.

The link below shows you how to change the settings in that module to 2gb:

http://www.goeszen.com/request-length-exceeds-maxrequestlen-apache2-debi...

Do that, restart apache, and you're good.

Thanks everyone for your suggestions.