Failed to remove directory "/var/www/html/SuiteCRM": rmdir(/var/www/html/..gHn): Directory not empty on upgrade to 8.4

Hi everyone,

when we try to upgrade to 8.4, i get this message;

11:58:08 CRITICAL  [console] Error thrown while running command "suitecrm:app:upgrade -t 'SuiteCRM-8.4.0'". Message: "Failed to remove directory "/var/www/html/SuiteCRM": rmdir(/var/www/html/..gHn): Directory not empty" ["exception" => Symfony\Component\Filesystem\Exception\IOException^ { …},"command" => "suitecrm:app:upgrade -t 'SuiteCRM-8.4.0'","message" => "Failed to remove directory "/var/www/html/SuiteCRM": rmdir(/var/www/html/..gHn): Directory not empty"]

In Filesystem.php line 200:
                                                                                                        
  Failed to remove directory "/var/www/html/SuiteCRM": rmdir(/var/www/html/..gHn): Directory not empty  
                                                                                                        

Upgrade fails.

Permission checked.

Environment is the following:
PHP: 8.2
OS: Ubuntu server 22.04 LTS

Solved by manually remove /var/www/html/SuiteCRM directory.

I can try and help with the following…

It’s trying to remove it - and it’s failing because the directory isn’t empty and looking at the Filesystem.php file it’s not set to remove it recursively (so will throw the error as in linux terms rmdir will not work if the directory isn’t empty)

What’s in /var/www/html/suitecrm

Can you move it to a different location and try again? Or copy the contents of this directory to somewhere else

cp /var/www/html/suitecrm /var/www/html/backup

and then do rmdir -r /var/www/html/suitecrm

that should do it :slight_smile:

Thanks for your answers @dhuntress.

I had a folder called “SuiteCRM” containing a log folder called “prod” in the project installation root. Having the same name, it was easy to get confused. By deleting it, I solved the problem.