EspoCRM Extension Uninstall/Upgrade issue
-
We couldn't find any info on how to Upgrade an extension, so here is the process we have done:
(Extension name: Advanced Pack)-
We tried to upload it (the new version on top of the already installed version) directly in EspoCRM, and we got this error:
Error 500
Permission denied to delete files. -
In EspoCRM we tried to Uninstall the extension, but we got this error:
Error 500
Permission denied to delete files. -
We followed the steps listed here:
https://docs.cloudron.io/packages/espocrm/#uninstalling-extension
Command:
php command.php extension -u --name="Advanced Pack"
and we got this error:
PHP Warning: mkdir(): File exists in /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php on line 517 PHP Warning: mkdir(): No such file or directory in /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php on line 517 PHP Fatal error: Uncaught Espo\Core\Utils\File\Exceptions\PermissionError: Permission denied: unable to create a folder on the server data/cache/application in /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php:654 Stack trace: #0 /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php(298): Espo\Core\Utils\File\Manager->checkCreateFile() #1 /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php(412): Espo\Core\Utils\File\Manager->putContents() #2 /app/code/9.2.2/application/Espo/Core/Utils/DataCache.php(82): Espo\Core\Utils\File\Manager->putPhpContents() #3 /app/code/9.2.2/application/Espo/Core/Utils/Module.php(101): Espo\Core\Utils\DataCache->store() #4 /app/code/9.2.2/application/Espo/Core/Utils/Module.php(71): Espo\Core\Utils\Module->init() #5 /app/code/9.2.2/application/Espo/Core/Utils/Module.php(120): Espo\Core\Utils\Module->get() #6 [internal function]: Espo\Core\Utils\Module->Espo\Core\Utils\{closure}() #7 /app/code/9.2.2/application/Espo/Core/Utils/Module.php(119): usort() #8 /app/code/9.2.2/application/Espo/Core/Binding/EspoBindingLoader.php(42): Espo\Core\Utils\Module->getOrderedList() #9 /app/code/9.2.2/application/Espo/Core/Container/ContainerBuilder.php(210): Espo\Core\Binding\EspoBindingLoader->__construct() #10 /app/code/9.2.2/application/Espo/Core/Application.php(66): Espo\Core\Container\ContainerBuilder->build() #11 /app/code/9.2.2/application/Espo/Core/Application.php(57): Espo\Core\Application->initContainer() #12 /app/code/9.2.2/command.php(35): Espo\Core\Application->__construct() #13 {main} thrown in /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php on line 654- We tried to do it with the Recovery turned off and here is the result:
php command.php extension -l Extensions: Name: Advanced Pack ID: 68daa3e8f1907e629 Version: 3.11.7 Installed: yes root@a039099f-5cea-4d45-9e1a-b2ddf13a2a71:/app/code/9.2.2# php command.php extension -u --name="Advanced Pack" Uninstalling... Do not close the terminal. This may take a while... Permission denied to delete files. root@a039099f-5cea-4d45-9e1a-b2ddf13a2a71:/app/code/9.2.2#Currently we aren't able to Uninstall or Upgrade the current Extension.
Perhaps there is some bug with the current EspoCRM version or some other reason? -
-
Hello @creative567145
Thanks for reporting, I will look into it.
Can you please share your current Cloudron Version, Cloudron App Version of EspoCRM and the Extension with its Version.@james Thank you for the fast response
Cloudron version: v8.3.2 (Ubuntu 24.04.3 LTS) (I have included the OS for just in case)
EspoCRM version: Espo CRM 9.2.2
Package Version: com.espocrm.cloudronapp@2.19.1
Advanced Pack - Extension version: advanced-pack-3.11.7 -
Hello @creative567145
Since Advanced Pack is a paid extension I am unable to start reproducing the issue with this extension.
Do you have another extension for EspoCRM that is free and has the same issues? -
Since only the person that has paid for it is able to get updates, I'll send the file to you in the private chat (for testing purposes)
-
J james marked this topic as a regular topic
-
Hello @creative567145
I was able to reproduce this issue.Reproduction
When the app is in recovery mode some symlinks that filled on runtime are missing.
The error gave the right detail:
PHP Fatal error: Uncaught Espo\Core\Utils\File\Exceptions\PermissionError: Permission denied: unable to create a folder on the server data/cache/application in /app/code/9.2.2/application/Espo/Core/Utils/File/Manager.php:654When you start the recovery mode and go into the web terminal and do:
ls -lah data/ total 36K drwxr-xr-x 5 www-data www-data 4.0K Oct 14 10:06 . drwxr-xr-x 8 www-data www-data 4.0K Oct 14 09:44 .. drwxrwxr-x 3 www-data www-data 4.0K Oct 14 09:57 .backup lrwxrwxrwx 1 www-data www-data 18 Oct 14 10:06 cache -> /run/espocrm/cache -rw-r--r-- 1 www-data www-data 1.3K Oct 14 10:06 config-internal.php -rw-r--r-- 1 www-data www-data 9.9K Oct 14 10:06 config.php lrwxrwxrwx 1 www-data www-data 17 Oct 14 10:06 logs -> /run/espocrm/logs drwxrwxr-x 2 www-data www-data 4.0K Oct 14 10:06 tmp drwxrwxr-x 3 www-data www-data 4.0K Oct 14 09:57 uploadSince the color is missing in text here also a screenshot.

The red color on
cacheandlogsindicate that the target of the symlink does not exist.
So we need to create this manually with:mkdir -p /run/espocrm/cache mkdir -p /run/espocrm/logsOr even better start EspoCRM once and quit it with
crtl+c./app/pkg/start.shNow I can run:
php command.php extension -l Extensions: Name: Advanced Pack ID: 68ee1e8e777ab1217 Version: 3.11.7 Installed: yesand uninstall it with:
php command.php extension -u --name="Advanced Pack" Uninstalling... Do not close the terminal. This may take a while... Permission denied to delete files.Another error
Permission denied to delete files.
Let's see the log:cat /run/espocrm/logs/espo-2025-10-14.log [2025-10-14 10:23:35] WARNING: E_WARNING: rmdir(client/custom): Not a directory [2025-10-14 10:23:36] WARNING: E_WARNING: rmdir(custom): Not a directorySince
client/customandcustomare symlinks and not directories maybe the php code fails here.
And after some PHP code debugging I found the offender.Solution - manual patching in recovery mode
You need to edit the following file at line
704application/Espo/Core/Utils/File/Manager.php:# Open the file at line 704 nano +704 application/Espo/Core/Utils/File/Manager.phpEdit the
ifstatement to:if (is_dir($dirPath) && is_writable($dirPath) && is_link($dirPath) === false)Save and close the file and now you can run:
mkdir -p /run/espocrm/cache mkdir -p /run/espocrm/logs php command.php extension -u --name="Advanced Pack"Disable the recovery mode and when checking the Admin UI for Extensions it is uninstalled.
-
Thank you @james
We have performed the steps and it's working
Here are the steps in detail (for noobs like me to replicate it):
- Log in Cloudron + select EspoCRM + Click on the Repair tab: Enable Recovery Mode
- Click: Terminal
- Copy paste this:
nano +704 application/Espo/Core/Utils/File/Manager.php - This is the original line:
if (is_dir($dirPath) && is_writable($dirPath)) { - Change it to this:
if (is_dir($dirPath) && is_writable($dirPath) && is_link($dirPath) === false) { - On the keyboard click: CTRL + X
Then click to confirm: Y - Copy paste this:
mkdir -p /run/espocrm/cache
mkdir -p /run/espocrm/logs
php command.php extension -u --name="Advanced Pack" - Close the Terminal window
- Click to Disable the Recovery mode
there is no need to Restart EspoCRM - Log in EspoCRM as admin >>> extensions
- 1 more step to update the Extension:
Since the old Extension version was uninstalled, now we upload the new version + click Install
@james We noticed that the change in the Manager.php file is not permanent.
So this means that we would have to go through all these steps each time an Extension update is required.Business-wise, this will reduce the client-retention rate of the Cloudron userbase. Especially those that aren't tech experienced.
Ideally the extension updates would be performed by the EspoCRM admin just uploading the new version inside EspoCRM (UI) and it replaces the old version.
Is it possible for the Cloudron team some day to push an update to the EspoCRM package that applies this change permanently? -
Hello @creative567145
We have already given notice to upstream about the issue and a discussion was started how to handle symlinks.
So there might be a solid solution comming from upstream.Thank you @james , much appreciated