Make WordPress Core

Opened 3 years ago

Last modified 5 days ago

#22041 reopened enhancement

Importer dies silently when multisite upload limit is reached

Reported by: danielbachhuber Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version:
Component: Import Keywords: needs-patch needs-testing
Focuses: multisite Cc:


The scenario: You're importing a WXR file into a site on a multisite network and the WXR includes a number of large attachments. For whatever reason, the upload capacity for each site is set at 100MB.

If the upload capacity is reached during the import process, the import will look like it's hanging forever. Instead, it would be nice to show an alert that the upload capacity was reached or similar.

Change History (8)

#1 @SergeyBiryukov
3 years ago

  • Milestone changed from Awaiting Review to WordPress.org

#2 @jeremyfelt
20 months ago

  • Focuses multisite added
  • Keywords needs-patch added
  • Milestone changed from WordPress.org to Future Release

I haven't verified yet, but fixing this makes sense if it's still a present issue.

Would this be the import plugin's job or is there something we can do to throw the notice in core?

#3 follow-up: @danielbachhuber
20 months ago

I tried to reproduce this morning and couldn't. As far as I can tell, the import process gets no where near is_upload_space_available().

The rundown is this:

  • In WP_Importer::process_attachment(), the importer calls WP_Importer::fetch_remote_file() to pull down the remote file. ::process_attachment() also calls wp_insert_attachment(), but that just performs the database interaction.
  • WP_Importer::fetch_remote_file() uses wp_upload_bits() to create an empty file, and then wp_get_http() to write the contents of the remote file to the local file.
  • WP_Importer::fetch_remote_file()also checks against WP_Importer::max_attachment_size(), which is filterable and defaults to 0. I wish I had reported which environment I experienced this in, because this may have been the cause of the bug I saw.

Based on my debugging today, this ticket could become that the importer should respect the blog's max storage limit value.

#4 @SergeyBiryukov
20 months ago

  • Milestone changed from Future Release to WordPress.org

#5 @chriscct7
9 days ago

  • Milestone WordPress.org deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix based on comment:3 and the complete lack of interest on the ticket over the last 2 years. Feel free to reopen when more interest re-emerges (particularly if there's a patch)

This ticket was mentioned in Slack in #core by danielbachhuber. View the logs.

9 days ago

#7 @jeremyfelt
9 days ago

  • Keywords needs-testing added
  • Milestone set to WordPress.org
  • Resolution wontfix deleted
  • Status changed from closed to reopened

This ticket needs some more investigation before we can close it. I have a suspicion there is a sneaky bug in there somewhere and will take some time for someone to dig in and confirm (or un-confirm).

#8 in reply to: ↑ 3 @thomaswm
5 days ago

Replying to danielbachhuber:

I tried to reproduce this morning and couldn't. As far as I can tell, the import process gets no where near is_upload_space_available().

Perhaps the problem isn't the upload limit, but PHP's memory limit. If there's a file which is bigger than the memory limit, then fetching that file in wp_get_http() will fail because the HTTP response from the remote server is stored in memory before the file content gets extracted and written to the hard disk.

Last edited 5 days ago by thomaswm (previous) (diff)
Note: See TracTickets for help on using tickets.