(865) 584-3355

Apple Certified Macintosh Experts
Serving East Tennessee since 1994
 

Knowledge Base

Package Update: There was an error installing an extension

Joomla is usually great when it comes to performing self-updates, but on occasion the error messages don't provide enough information to remedy the problem. This trick will give you the full path to the problem file.

Here is an example while trying to update Akeeba:

Warning
Joomla\Filesystem\File::delete: Failed deleting inaccessible file 01.basic.ini
Package Update: There was an error installing an extension: com_akeeba-core.zip
Before updating ensure that the update is compatible with your Joomla! installation.
You are strongly advised to make a backup of your installation before you start updating.

So where exactly is this mystery file and what do I do about it?

Tracking it down

I searched the site to find where the exception was being thrown:

[root@www cms]# grep -rnw '/var/www/www.mysite.com' -e 'Failed deleting inaccessible file'
/var/www/www.mysite.com/libraries/vendor/joomla/filesystem/src/File.php:126: throw new FilesystemException(__METHOD__ . ': Failed deleting inaccessible file ' . $filename);

Now I know exactly where this error is occurring.

Improving the error message

Here's the function throwing the exception:

public static function delete($file)
  {
                $files = (array) $file;

          foreach ($files as $file)

                {
                        $file = Path::clean($file);
                        $filename = basename($file);   

                        if (!Path::canChmod($file))

                        {
                                throw new FilesystemException(__METHOD__ . ': Failed deleting inaccessible file ' . $filename);
                        }

                        // Try making the file writable first. If it's read-only, it can't be deleted
                // on Windows, even if the parent folder is writable

                        @chmod($file, 0777);

                        // In case of restricted permissions we zap it one way or the other
                        // as long as the owner is either the webserver or the ftp
                        if (!@ unlink($file))
                        {
                                throw new FilesystemException(__METHOD__ . ': Failed deleting ' . $filename);
                        }
                }

                return true;
        } 
 
The full file path is available right there, so I simply changed the variable from $filename to $file :
throw new FilesystemException(__METHOD__ . ': Failed deleting inaccessible file ' . $file);

 So now my error is meaningful:

Warning
Joomla\Filesystem\File::delete: Failed deleting inaccessible file /var/www/www.mysite.com/administrator/components/com_akeeba/BackupPlatform/Joomla3x/Config/Pro/01.basic.ini
Package Update: There was an error installing an extension: com_akeeba-core.zip
Before updating ensure that the update is compatible with your Joomla! installation.
You are strongly advised to make a backup of your installation before you start updating.

 

I kept getting errors when attempting to update the Extension, although permissions were correct the entire tree down.
Keeping the Joomla extensions update page up,
I eventually just:

> rm -rf /var/www/www.mysite.com/administrator/components/com_akeeba/

... and then the update went through with no problem.
Didn’t have to reinstall.