Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22881 closed defect (bug) (duplicate)

upgrade fails when disk space is exhausted due to quotas

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


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

Downloading update from…

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 - | 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)

#1 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.7

#2 @dd32
11 years 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 11 years ago by dd32 (previous) (diff)

#3 @dd32
11 years 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 11 years ago by dd32 (previous) (diff)

#4 @dd32
11 years 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.