Install and Upgrade Problems
Last updated: 16 June 2022"Unable to update extensions: Joomla\Filesystem\File::delete Failed deleting inaccessible file xxx"
This is problem introduced on Joomla 3.9.0. Joomla now makes use of the File class available on the Framework repository which is different from the old one that was available in the CMS repository. This new class performs a chmod check over the file and refuses to proceed with the delete in case of failure, even if permissions allow for the file to be deleted.
More often than not, this error is thrown because of an ownership issue on that particular file. To overcome this issue, you may try to repair the ownerships on your whole Joomla filesystem by issuing the next commands while sitting on the site root folder:
chown -R apache:apache * find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \;
Here we assume that PHP is running under the apache, this might be different on your server setup so please adjust accordingly.
Another option to solve this problem would be to temporarily disable this new behavior in the Joomla class directly. For this end open the file located at libraries/vendor/joomla/filesystem/src/File.php and comment lines 124 to 127. You should end up having something like this:
/*if (!Path::canChmod($file)) {throw new FilesystemException(__METHOD__ . ': Failed deleting inaccessible file ' . $filename); }*/
Removing those lines would also work.
The problem should be solved after applyting one of the fixes.