Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. EspoCRM
  3. EspoCRM Extension Uninstall/Upgrade issue

EspoCRM Extension Uninstall/Upgrade issue

Scheduled Pinned Locked Moved EspoCRM
9 Posts 2 Posters 162 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    creative567145
    wrote last edited by
    #1

    We couldn't find any info on how to Upgrade an extension, so here is the process we have done:
    (Extension name: Advanced Pack)

    1. 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.

    2. In EspoCRM we tried to Uninstall the extension, but we got this error:
      Error 500
      Permission denied to delete files.

    3. 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
    
    1. 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?

    1 Reply Last reply
    0
    • jamesJ Offline
      jamesJ Offline
      james
      Staff
      wrote last edited by
      #2

      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.

      C 1 Reply Last reply
      1
      • jamesJ james

        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.

        C Offline
        C Offline
        creative567145
        wrote last edited by
        #3

        @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

        1 Reply Last reply
        1
        • jamesJ Offline
          jamesJ Offline
          james
          Staff
          wrote last edited by james
          #4

          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?

          1 Reply Last reply
          1
          • C Offline
            C Offline
            creative567145
            wrote last edited by creative567145
            #5

            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)

            1 Reply Last reply
            1
            • jamesJ james marked this topic as a regular topic
            • jamesJ Offline
              jamesJ Offline
              james
              Staff
              wrote last edited by
              #6

              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:654
              

              When 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 upload
              

              Since the color is missing in text here also a screenshot.

              cf07067f-de05-422b-896e-3e07b19668eb-image.png

              The red color on cache and logs indicate 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/logs
              

              Or even better start EspoCRM once and quit it with crtl+c.

              /app/pkg/start.sh
              

              Now I can run:

              php command.php extension -l
              
              Extensions:
              
               Name: Advanced Pack
               ID: 68ee1e8e777ab1217
               Version: 3.11.7
               Installed: yes
              

              and 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 directory
              

              Since client/custom and custom are 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 704 application/Espo/Core/Utils/File/Manager.php:

              # Open the file at line 704
              nano +704 application/Espo/Core/Utils/File/Manager.php
              

              Edit the if statement 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.

              1 Reply Last reply
              3
              • C Offline
                C Offline
                creative567145
                wrote last edited by
                #7

                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):

                1. Log in Cloudron + select EspoCRM + Click on the Repair tab: Enable Recovery Mode
                2. Click: Terminal
                3. Copy paste this:
                  nano +704 application/Espo/Core/Utils/File/Manager.php
                4. This is the original line:
                  if (is_dir($dirPath) && is_writable($dirPath)) {
                5. Change it to this:
                  if (is_dir($dirPath) && is_writable($dirPath) && is_link($dirPath) === false) {
                6. On the keyboard click: CTRL + X
                  Then click to confirm: Y
                7. Copy paste this:
                  mkdir -p /run/espocrm/cache
                  mkdir -p /run/espocrm/logs
                  php command.php extension -u --name="Advanced Pack"
                8. Close the Terminal window
                9. Click to Disable the Recovery mode
                  there is no need to Restart EspoCRM
                10. 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?

                1 Reply Last reply
                2
                • jamesJ Offline
                  jamesJ Offline
                  james
                  Staff
                  wrote last edited by
                  #8

                  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.

                  C 1 Reply Last reply
                  3
                  • jamesJ james

                    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.

                    C Offline
                    C Offline
                    creative567145
                    wrote last edited by
                    #9

                    Thank you @james , much appreciated

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Bookmarks
                    • Search