Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#36758 closed defect (bug) (worksforme)

Have to grant www-data ownership to upgrade to 4.5.x?

Reported by: btrent98's profile btrent98 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.2
Component: Upgrade/Install Keywords:
Focuses: Cc:


I'm running several servers from end-user accounts under Debian Jessie/Apache2.4. The WP files are owned by <acctname>:www-data, with the www-data group having write access only to those few specifically required directories, such as wp-content/uploads.

After running in this configuration for years and many different versions/upgrades (of both WordPress and Debian), I was unable to upgrade from 4.4.2 to 4.5.x by using the built-in upgrade feature in the backend. Installation fails ("The update could not be unpacked"). I also noticed that, with 4.4.2 the .maintenance is not removed after updating plugins. It has to be removed manually.

I discovered that an effective workaround to both of these issues is to grant www-data ownership to all the files in the webroot directory (recursively) before performing the upgrade/update operations. When this is done the upgrade to 4.5.x succeeds and, when plugins are updated, the .maintenance file is successfully removed after the update. I change ownership back to <acctname> after the upgrade/updates are completed.

Is there a change to how WP determines upgradability at 4.4.2? Is this a bug or a feature? The undeleted .maintenance file seems like a bug to me for sure.

Change History (5)

#1 @btrent98
8 years ago

The problem remains with the update to 4.5.2. I had to switch file ownership to www-data again for the upgrade to complete successfully. I'm not the only one having this problem either. See this thread in the support forum:

#2 @crmb
8 years ago

I have the same issues since few weeks. I use php7-fpm and vsftpd (Debian Jessie)

My ftp user is the files' owner.
My fpm pool has write permission for upgrade/ and uploads/

#3 @Androkai
8 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

I figured it out now: The problem is a bug in vsftpd version 3.0.2 which is fixed in version 3.0.3. The package can be found in Debian unstable.

Here are basic instructions for an upgrade:

# add unstable to sources.list
echo -e "## unstable\ndeb unstable main contrib non-free" >> /etc/apt/sources.list
# set "stable" as default release to prevent system from updating packages to unstable @ apt-get upgrade
echo 'APT::Default-Release "stable";' > /etc/apt/apt.conf.d/99myDefaultRelease
# load new package-list
apt-get update
# force upgrade of vsftpd to version 3.0.3
apt-get install vsftpd=3.0.3-5
Last edited 8 years ago by Androkai (previous) (diff)

#4 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted

#5 @btrent98
8 years ago

I can confirm that this fixed the update/upgrade problem I was experiencing. I just upgraded seamlessly to WordPress 4.6. After installing the vsftp package from debian/unstable I rolled back the changes to my apt configuration so that no updates from unstable get installed later. Thanks!

Note: See TracTickets for help on using tickets.