This page short URL: kpyw

What happens?

Due to some changes in Joomla 3.9.0, under some circumstances updating extensions can fail with an error message similar to:

Unable to update extensions: Joomla\Filesystem\File::delete Failed deleting inaccessible file

This causes the update to fail in the middle and possibly has some very negative side-effects with some needed files missing. Note this error is not specific to sh404SEF and has been found to happen with several other well-known extensions.

When does it happen?

This will happen only on Joomla 3.9.0 and more recent. The underlying cause is a problem in files and folders permissions. This specific problem will occur if your server allows files/folders deletion but does not allow chmod them, that is changing their permissions.

Note that if your server does not allow deletion at all, the error message may be different but the update will still fail. Any update requires that Joomla can add/copy/delete files and folders.

It has been reported this issue might be more frequent after a site has been copied from one server to another - likely because files ownership may be different on the new server (different users or same user but different user id for instance)

How to fix?

This is a hosting-related problem. It's probably best that you talk to your hosting company first and ask them to fix the problem, or provide the required information to do so.

Set files ownership

First you'll need to know under which user your PHP is running. That's when your hosting company can help, unless you set up your server yourself. Using SSH access, and from the root folder of the site, you can then run the commands:

chown -R your_php_user:your_php_user *
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

In this command, replace your_php_user with your actual PHP user.

This should be enough to fix the problem permanently. If not, please see next option:

Suppress failing Joomla check

As a last resort, you can temporarily modify a Joomla file to disable the failing check, to allow an update.

We do not recommend playing with Joomla files at all. This issue is a server issue, that should be fixed on your server. Joomla has nothing to do with it.

Here are the steps:

  1. Using FTP, open the file {your_site_root_folder}/libraries/vendor/joomla/filesystem/src/File.php
  2. At line 124, you'll see:
    if (!Path::canChmod($file))
    throw new FilesystemException(__METHOD__ . ': Failed deleting inaccessible file ' . $filename);
  3. Modify those lines as follows:
    //if (!Path::canChmod($file))
    //    throw new FilesystemException(__METHOD__ . ': Failed deleting inaccessible file ' . $filename);
  4. Save the file
  5. Perform the update
  6. Revert the file to what it was at step 2 (ie: remove the // at the start of each line and save again)

Note: even if you do not revert those changes immediately, Joomla itself will install back the orginal version during its next update.