WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 8 months ago

Last modified 8 months ago

#22881 closed defect (bug) (duplicate)

upgrade fails when disk space is exhausted due to quotas

Reported by: list2010@… Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

The upgrade from wordpress 3.4.2 to 3.5 failed due to a disk space limitation:

Downloading update from http://wordpress.org/wordpress-3.5-new-bundled.zip…

Unpacking the update…

The package could not be installed.: PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

Installation Failed

A similar bug occurs if the space for the files themselves is exhausted. On the same installation, functions.php was truncated at 112k, leaving the installation in a non-functional state.

This kind of behaviour can be avoided with an upgrade function of the form:

# test for 64k free disk space ...
dd if=/dev/zero of=biggish-test-file bs=1024 count=64 && 
rm biggish-test-file &&
wget -O - http://wordpress.org/latest.tar.gz | tar -zvx --strip-components=1

Streaming the download imposes no additional disk space requirements for the intermediate .zip file, but does require a change in the extraction code. Streaming an update cannot be done with zip files, since the index is at the end. ZIP files have to be complete, since the tag is at the end. 'tar' files are more suitable for streaming.

Change History (4)

comment:1 nacin8 months ago

  • Milestone changed from Awaiting Review to 3.7

comment:2 dd328 months ago

A function i just spotted (that I wasn't aware actually worked cross-platform) is disk_free_space() which returns the number of KB's available in a specific directory. I have no idea if that respects user quota's or can be relied upon when a FS is remote.

A patch on #16057 should prevent half-written-to-disk zip files attempting to be processed.

Last edited 8 months ago by dd32 (previous) (diff)

comment:3 dd328 months ago

Incoming commit for a covering cases where the WP_Filesystem classes do not correctly check files are written properly.

Noting it here, the Filesystem classes will have issues with mbstring.func_overload overloading strlen() after this change. A follow up change will be required to cover that case.

Last edited 8 months ago by dd32 (previous) (diff)

comment:4 dd328 months ago

  • Milestone 3.7 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Actually, This ticket was a duplicate of #16057

I've opened #25237 for tracking of Filesystem write errors.

Note: See TracTickets for help on using tickets.