This morning I woke up to announcements of a security upgrade (3.0.4) for WordPress. It is highly recommended that everyone upgrade their installs.
I set to the task of upgrading this and a couple of other websites I look after. All of my sites are on 3.0, but not all of them have seen an update since. Nevertheless I know that upgrading is usually a one click job, and even if you have a more complex setup with massive plugins or theme frameworks like thematic where the order of updating can be important, it usually goes pretty smoothly.
So I was pretty shocked when my relatively uncomplicated wedding site failed to update from 3.0.1.
Fatal error: Call to undefined function update_core() in /blah/blah/blah/wp-admin/includes/class-wp-upgrader.php on line 895
The error message I received is pretty nonsensical – the site hadn’t been hacked (either by a hacker or my keen development skills) and there’s absolutely no reason why a WordPress function should be missing. I had already upgraded my blog from 3.0.3 successfully, but I know the WP team wouldn’t release an upgrade that only worked from the latest version.
I checked permissions on my upgrade folder were set to 777 – this wasn’t the problem, although it often is when receiving errors during automatic upgrade. After a bit of digging around, turns out the error message I got is one of a few error messages that can appear when you try to automatically update but don’t have enough disk space. Pretty simple problem to solve, but not an easy one to figure out when you’re staring at the WordPress admin screen!
Turns out, another version of this error – when it gets a bit further along this process – may also kick out the following error:
Incompatible Archive.: PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
Which makes a little more sense – the archive uploaded is never complete because there’s no room for the end of it.
I’ve had a scout around the internet to see if there are any other manifestations of this problem, not dug anything else up yet, but here are a few more articles on solving problems with automatic upgrades:




30th Dec
Philip Oakley says:
Thanks for the link and for writing up the solution for your problem, I will remember that if I get a similar issue on WordPress.
30th Dec
Abrishca says:
I had a similar issue with 3.02, but my problem wasn’t disk space, but memory. I just had to reset the memory_limit in php.ini with my host – all went smoothly after that.
1st Jan
Dion Hulse (dd32) says:
Hi,
Thanks for writing about the problem you encountered with the upgrade, Whilst I’m not entirely sure why you hit the undefined function call as it should’ve caught it before it got that far..
What I can report however, Is that you indeed did find a bug with the Zip extraction, It appears that WordPress is not ensuring the file is written to disk correctly, An error such as not having enough disk space would be enough to trigger that. I’ve opened a Trac ticket (#16057) to deal with that side of things, and will take a closer look at the core related to the fatal error at a later stage.
1st Jan
ErisDS says:
Hi Dion,
Thanks for taking the time to look into this. As far as I was concerned it was just an unfortunate side effect of a set of circumstances, rather than a bug, otherwise I’d have tried to fix it!
I just wanted to ensure other people knew how to resolve the issue if they came up against it.
Eris
3rd Jan
Dion Hulse (dd32) says:
In my opinion, Any time an unhelpful error is thrown up, Or WordPress attempts to do something it cannot, then it’s a bug :)
To a user who has absolutely no idea on what any programming terms mean, to be given a message that a function doesn’t exist doesn’t help them, they need to know why it’s happened, and how to correct that.
All in all, Reporting it as a bug is always the best method with things like this, While blogging is helpful and helps people who search for the error, raising a bug (or as in this case, one of your readers mentioning it to me) allows a code review to check that everything is operating the best it can, here, it is not working best as it could :)
3rd Jan
ErisDS says:
Lol, I can’t believe you referred to Nacin as “One of [my] readers”… I’m pretty sure that’s blasphemous. As far as I understand, Nacin has to always be referred to directly and with capitals? You know like.. when He says so…
3rd Jan
Dion Hulse (dd32) says:
Well the Nacin brigade can go either way, Personally I prefer his IRC version (nacin).
nacin has his fingers in so many pie’s sometimes you don’t even need to mention him by name for the world to know who you’re referring to! (That being said, yes, for the world: nacin strikes again)
23rd Feb
WordPress Automatic Upgrades - pitfalls and error messages ... tracked back:
WordPress Automatic Upgrades – pitfalls and error messages ……
[...]So I was pretty shocked when my relatively uncomplicated wedding site failed to update from 3.0.1. Fatal error: Call to undefined function update_core() in /blah/blah/blah/wp-admin/includes/class-wp-upgrader.php on line 895 … Comments. 7 Comment…