First and foremost, thanks for everyone's incredible work on this module. It's revolutionizing Drupal!

Context

I am building a podcast website. I need to upload MP3 files that are typically about 75Mb in size.

Structure

I have a content type called 'Episode' and a file field called 'MP3'. This field's widget is the 'Media File Selector'. The field is set to upload the file to the standard public file system. Additionally, I have my php.ini file set with the following modifications:

upload_max_filesize = 100M
max_input_time = 1000
memory_limit = 100M
max_execution_time = 1000
post_max_size = 100M

Re-Creating Symptoms

1st method, via Submit:

  1. When creating or editing a node, find the 'MP3' field and click 'Select Media'. This brings up the Media modal as expected. You can browse for a local file as expected. The instruction text below the field says that files must be less than 100Mb (confirming that my PHP.ini settings are in effect).
  2. After browsing and selecting a large file (75Mb), click 'Submit'. The browser status shows the progress of the upload.
  3. Once the upload is complete, the browser waits for a response from the server for about 60 additional seconds. The modal window strangely shows the 'Media Browser' page as seen from within the administrative theme, complete with the rest of the page chrome and the Drupal admin tool bar. Drupal does not recognize the upload. The file never gets put in 'sites/default/files' and the Media module does not create a record for it. This problem does not occur with smaller files, such as images.

Error when selecting Submit.

2nd method, via Upload:

  1. When creating or editing a node, find the 'MP3' field and click 'Select Media'. This brings up the Media modal as expected. You can browse for a local file as expected. The instruction text below the field says that files must be less than 100Mb (confirming that my PHP.ini settings are in effect).
  2. After browsing and selecting a large file (75Mb), click 'Upload'. The browser status shows the progress of the upload. The modal window also has a progress bar for the file upload, but this does not seem to work, and the progress remains at 0% during the entirety of the upload.
  3. Once the upload is complete, the browser waits for a response from the server for about 60 additional seconds. Then, a browser error appears, stating that an AJAX request terminated abnormally, and that the server returned a 500 Internal Server Error. Drupal does not recognize the upload. The file never gets put in 'sites/default/files' and the Media module does not create a record for it. This problem does not occur with smaller files, such as images.

Error when selecting Upload.

NOTE: This problem did not occur when using the Media File Entity module, but is present now that File Entity is being used.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ParisLiakos’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

turn display_errors on in php. this will reveal the error and the reason for the 500 error

Fr0s7’s picture

The root of the problem is that my host (Dreamhost) doesn't allow uploads greater than 128mb to the root tmp directory. When this filter fails, it gets caught by mod_security and throws the 500 error.

More info here:
"An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (128 MB) that this server supports."

I have tried bypassing mod_security with an .htaccess rule, but it doesn't seem to work. I ended up turning mod_security off ("Extra web security" in Dreamhost's control panel) but the file still fails to upload, simply with a different, unspecified error. To date, I have not found a good workaround for this, and I'm shopping for a new host that doesn't put these kinds of restrictions on me.

G42’s picture

I believe this may be due to how Core handles file uploads that are too large. There are two checks that happen for file size. Drupal checks if the file is larger than the max limit set in the Drupal config, the other checks if the file is larger than the server PHP limit. I don't get the same errors as the OP but I'm working with the new rc releases.

For my site the upload widget is not properly rebuilt when the core file limit errors are called, can Media add its own handler?

joseph.olstad’s picture

Component: File entity » Code
Status: Postponed (maintainer needs more info) » Closed (won't fix)

Marking this as closed won't fix, because this is a server configuration issue. However, feel free to create a patch if you want to improve the file limit error handling for the media module, open a new issue and post the patch there , it'll get reviewed.

dheacock’s picture

I'm having a very similar problem with Drupal 7: I have created a content type intended to contain an MP3 file and up to three PDF documents, and I display the data with a View--the default display is a table that displays dates and titles, and the full display (displayed when the user clicks on the desired title) shows links to the PDFs and the MP3 file, displayed using a Mediaelement player.

The behavior you describe is what I'm seeing: I complete the content type form with the required data, click "Submit," and wait a minute or so, then instead of displaying the resultant page on my site, I'm presented with the content type editor. It's as though the MP3 file is not making it into the database, I think.

Could use some ideas on what to do.

Thanks, Doug

joseph.olstad’s picture

Check your php settings on your server, php.ini what is the max upload limit?