7.3.4 -> 7.4.x Upgrade from UI issue "Error occurred while EspoCRM rebuild"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlexYash
    Junior Member
    • Apr 2023
    • 3

    7.3.4 -> 7.4.x Upgrade from UI issue "Error occurred while EspoCRM rebuild"

    Hello,

    First, thank you for the great product.

    I have to use Upgrade from UI option (I don't have shell on my hosting) and I stuck with this error:

    "Error 500
    Error occurred while EspoCRM rebuild. Please see the log for more detail."​


    Here are some lines from the log file (DEBUG log level enforced):

    [2023-04-07 15:04:28] DEBUG: Schema\Converter - End: building schema [] []
    [2023-04-07 15:04:28] INFO: Installation process [643030e1a12d69fe7]: End "rebuild" step. [] []
    [2023-04-07 15:04:28] INFO: Installation process [643030e1a12d69fe7]: Start "copy" step. [] []
    [2023-04-07 15:04:39] INFO: Installation process [643030e1a12d69fe7]: End "copy" step. [] []
    [2023-04-07 15:04:39] INFO: Installation process [643030e1a12d69fe7]: Start "rebuild" step. [] []
    [2023-04-07 15:04:40] DEBUG: Schema\Converter - Start: building schema [] []
    [2023-04-07 15:04:40] ERROR: Failed to rebuild database schema. Details: There is no column with name "entity_type" on table "array_value". at /var/www/vhosts/ -------/vendor/doctrine/dbal/src/Schema/Exception/ColumnDoesNotExist.php:16 [] []
    [2023-04-07 15:04:40] ERROR: Database rebuild failure, details: Error while rebuilding database. See log file for details.. [] []

    [2023-04-07 15:05:05] DEBUG: Schema\Converter - End: building schema [] []
    [2023-04-07 15:05:05] ERROR: Database rebuild failure, details: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away. [] []
    [2023-04-07 15:05:05] DEBUG: API (500) Error occurred while EspoCRM rebuild. Please see the log for more detail.; POST /Admin/action/runUpgrade; Input data: {"id":"643030e1a12d69fe7"}; Route pattern: /{controller}/action/{action}; Route params: Array ( [controller] => Admin [action] => runUpgrade ) [] []
    [2023-04-07 15:05:05] ERROR: (500) Error occurred while EspoCRM rebuild. Please see the log for more detail.; POST /Admin/action/runUpgrade; line: 288, file: /var/www/vhosts/ ----------------- /application/Espo/Core/Upgrades/Actions/Base.php [] []

    It looks like the process is reverting back to 7.3.4 version after this error. I've checked the DB "entity_type" column in "array_value" table is in place. Though the table is empty.

    I've added custom ​​fields to Account and Contact entities (via Entity Manager) and to their layouts respectively. Previous upgrades went well. I've tried all EspoCRM-upgrade-7.3.4-to-7.4.x.zip to no avail.

    I guess it's not critical since everything keeps working well on 7.3.4 but I'll be happy to help with debugging this issue.

    Best regards,
    Alex​
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi,

    It's because upgrade is running in a single process. https://github.com/espocrm/espocrm/issues/2689

    You can try to upgrade manually. Replace files. Then run rebuild.

    But I highly recommend to use a hosting provider with CLI access.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • AlexYash
      AlexYash commented
      Editing a comment
      Thank you for the hint. Wiil try and report here results.

      Yes, I'm thinking about switching to VPS but a bit later.

    • AlexYash
      AlexYash commented
      Editing a comment
      Reporting as I promised. It hasn't worked out. I've replaced files by overwriting 7.3.4 installation with 7.4.3 files from full distributive and got "Error 500" on loading. Configs are in place and correct.

      There is this repeating error in the log file:

      [2023-04-07 21:27:01] WARNING: E_WARNING: Undefined array key "adjustedRoute" {"code":2,"message":"Undefined array key "adjustedRoute"","file":"/var/www/vhosts/ -------------- /application/Espo/Core/Utils/Route.php","line":79}
      [2023-04-07 21:27:01] ERROR: Uncaught Exception TypeError: "Espo\Core\Api\Route::__construct(): Argument #3 ($adjustedRoute) must be of type string, null given, called in /var/www/vhosts/ ----------- /application/Espo/Core/Utils/Route.php on line 82" at /var/www/vhosts/ ------------ /application/Espo/Core/Api/Route.php line 40 {"exception":"[object] (TypeError(code: 0): Espo\\Core\\Api\\Route::__construct(): Argument #3 ($adjustedRoute) must be of type string, null given, called in /var/www/vhosts/ ---------- /application/Espo/Core/Utils/Route.php on line 82 at /var/www/vhosts/ ---------------- /application/Espo/Core/Api/Route.php:40)"}

      I wasn't able to run rebuild without CLI. I've disabled .htaccess and tried to load rebuild.php, but got an error saying it can be run via CLI only.

      Since it's a not supported upgrade path I haven't reported it as an issue on GitHub. Restoring back 7.3.4.
  • czv
    Junior Member
    • Aug 2021
    • 8

    #3
    me too failed to upgrade.
    [2023-04-09 03:23:42] DEBUG: DBAL: Table [entity_team] exists. [] []
    [2023-04-09 03:23:42] DEBUG: Schema\Converter - End: building schema [] []
    [2023-04-09 03:23:42] ALERT: Rebuild database fault: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user.default_team' in 'field list' in /home/espocrm/public_html/application/Espo/ORM/SqlExecutor.php:70 Stack trace: #0 /home/espocrm/public_html/application/Espo/ORM/SqlExecutor.php(70): PDO->query() EspoCRM Forum /home/espocrm/public_html/application/Espo/ORM/SqlExecutor.php(59): Espo\ORM\SqlExecutor->executeSqlWithDeadlockHandling() Forum /home/espocrm/public_html/application/Espo/ORM/Mapper/BaseMapper.php(784): Espo\ORM\SqlExecutor->execute() #3 /home/espocrm/public_html/application/Espo/ORM/Mapper/BaseMapper.php(108): Espo\ORM\Mapper\BaseMapper->executeSql() #4 /home/espocrm/public_html/application/Espo/ORM/Repository/RDBRepository.php(116): Espo\ORM\Mapper\BaseMapper->selectOne() Groups /home/espocrm/public_html/application/Espo/ORM/EntityManager.php(232): Espo\ORM\Repository\RDBRepository->getById() Uncategorized Groups /home/espocrm/public_html/application/Espo/Core/Utils/Database/Schema/rebuildActions/AddSystemUser.php(43): Espo\ORM\EntityManager->getEntity() Special /home/espocrm/public_html/application/Espo/Core/Utils/Database/Schema/Schema.php(330): Espo\Core\Utils\Database\Schema\rebuildActions\Add SystemUser->afterRebuild() Visitor Messages /home/espocrm/public_html/application/Espo/Core/Utils/Database/Schema/Schema.php(228): Espo\Core\Utils\Database\Schema\Schema->executeRebuildActions() Private Messages /home/espocrm/public_html/application/Espo/Core/Utils/Database/Schema/SchemaProxy.php(58): Espo\Core\Utils\Database\Schema\Schema->rebuild() Albums /home/espocrm/public_html/application/Espo/Core/DataManager.php(145): Espo\Core\Utils\Database\Schema\SchemaProxy->rebuild() #11 /home/espocrm/public_html/application/Espo/Core/DataManager.php(110): Espo\Core\DataManager->rebuildDatabase() #12 /home/espocrm/public_html/application/Espo/Core/Upgrades/Actions/Base.php(1033): Espo\Core\DataManager->rebuild() CSS Examples /home/espocrm/public_html/application/Espo/Core/Upgrades/Actions/Base.php(285): Espo\Core\Upgrades\Actions\Base->systemRebuild() #14 /home/espocrm/public_html/application/Espo/Core/Upgrades/Actions/Base/Install.php(347): Espo\Core\Upgrades\Actions\Base->throwErrorAndRemovePackage() General Discussion /home/espocrm/public_html/application/Espo/Core/Upgrades/Actions/Base/Install.php(215): Espo\Core\Upgrades\Actions\Base\Install->throwErrorAndRemovePackage() Announcements /home/espocrm/public_html/application/Espo/Core/Upgrades/Base.php(193): Espo\Core\Upgrades\Actions\Base\Install->stepRebuild() Feature Requests /home/espocrm/public_html/application/Espo/Core/Upgrades/Base.php(168): Espo\Core\Upgrades\Base->runActionStep() Installation and Upgrade Help /home/espocrm/public_html/application/Espo/Core/Console/Commands/Upgrade.php(338): Espo\Core\Upgrades\Base->runInstallStep() Extensions /home/espocrm/public_html/application/Espo/Core/Console/Commands/Upgrade.php(321): Espo\Core\Console\Commands\Upgrade->runStepsInSingleProcess() Developer Help /home/espocrm/public_html/application/Espo/Core/Console/Commands/Upgrade.php(158): Espo\Core\Console\Commands\Upgrade->runUpgradeProcess() Bug Reports /home/espocrm/public_html/application/Espo/Core/Console/CommandManager.php(95): Espo\Core\Console\Commands\Upgrade->run() Unminify assets or how to recreate t...o.min.js file? /home/espocrm/public_html/application/Espo/Core/ApplicationRunners/Command.php(51): Espo\Core\Console\CommandManager->run() /home/espocrm/public_html/application/Espo/Core/Application/RunnerRunner.php(87): Espo\Core\ApplicationRunners\Command->run() #24 /home/espocrm/public_html/application/Espo/Core/Application.php(78): Espo\Core\Application\RunnerRunner->run() /home/espocrm/public_html/command.php(35): Espo\Core\Application->run() how to upgrade ? {main} [] []
    [2023-04-09 03:23:42] ERROR: Database rebuild failure, details: Error while rebuilding database. See log file for details.. [] []
    [2023-04-09 03:23:42] ERROR: Upgrade Error: Error occurred while EspoCRM rebuild. Please see the log for more detail. [] []

    please help
    Attached Files

    Comment

    • yuri
      Member
      • Mar 2014
      • 8440

      #4
      As an option to upgrade w/o CLI access, install a new 7.4 instance, then copy custom and data folders. Then run rebuild. But I highly recommend not use hosting providers that don't allow CLI access.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      • AlexYash
        Junior Member
        • Apr 2023
        • 3

        #5
        Originally posted by yuri
        As an option to upgrade w/o CLI access, install a new 7.4 instance, then copy custom and data folders. Then run rebuild. But I highly recommend not use hosting providers that don't allow CLI access.
        Hi yuri ,

        Do I correctly understand the order of such upgrade:
        1. Make a backup of current 7.3.4 EspoCRM instance.
        2. Clean install 7.4.3 EspoCRM instance.
        3. Copy with overwrite /custom and /data folders from 7.3.4 backup (Do we need /data/cache folder, btw?) to the new 7.4.3 deployment.
        4. Run rebuild from Administration page.​

        Comment


        • AlexYash
          AlexYash commented
          Editing a comment
          Still no luck. "Error 500" on reload, no chance to run Rebuild from UI. Looks like 7.4.x has a bit different DB structure or tables' fields.

          [2023-04-10 15:25:56] WARNING: E_WARNING: Undefined array key "adjustedRoute" {"code":2,"message":"Undefined array key "adjustedRoute"","file":"/var/www/vhosts/ -------- /application/Espo/Core/Utils/Route.php","line":79}
          [2023-04-10 15:25:56] ERROR: Uncaught Exception TypeError: "Espo\Core\Api\Route::__construct(): Argument #3 ($adjustedRoute) must be of type string, null given, called in /var/www/vhosts/ -------- /application/Espo/Core/Utils/Route.php on line 76" at /var/www/vhosts/ -------- /application/Espo/Core/Api/Route.php line 40 {"exception":"[object] (TypeError(code: 0): Espo\\Core\\Api\\Route::__construct(): Argument #3 ($adjustedRoute) must be of type string, null given, called in /var/www/vhosts/ -------- /application/Espo/Core/Utils/Route.php on line 76 at /var/www/vhosts/ -------- /application/Espo/Core/Api/Route.php:40)"}
      • yuri
        Member
        • Mar 2014
        • 8440

        #6
        Correct.

        data/cache is not needed.

        You can do this as a test, to check whether it works. While keep using your current 7.3 instance. Then after you make sure the test 7.4 instance is working, do it again.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment


        • yuri
          yuri commented
          Editing a comment
          From data, you need only upload, config.php, config-internal.php.

        • AlexYash
          AlexYash commented
          Editing a comment
          yuri well, this time it has worked out. I've run Rebuild and everything is working fine. Though "About" page displays "Version 7.3.4".%)

          Are there any visual differences between 7.4.3 and 7.3.4?
      • AlexYash
        Junior Member
        • Apr 2023
        • 3

        #7
        So, these steps suggested by Yuri worked for me. Be aware that this might damage your EspoCRM instance and cause data loss, so make a full backup of your EspoCRM instance including the whole site structure and the database before following these steps:

        1. Make a FULL backup of your current 7.3.4 EspoCRM instance.
        2. Clean install 7.4.3 EspoCRM instance in-place.
        3. Copy with overwrite /custom and /data folders from 7.3.4 backup to the new 7.4.3 deployment.
        4. Delete from /data folder everything except .data, config.php and config-internal.php files. Alternatively, you can copy only those files from /data folder in step 3.
        4. Run rebuild from Administration page.​​
        Last edited by AlexYash; 04-11-2023, 12:27 PM.

        Comment


        • AlexYash
          AlexYash commented
          Editing a comment
          esforim Yep, "nuclear" is a precise description for this option. I'll correct my post a bit to warn people about possible consequences.

        • esforim
          esforim commented
          Editing a comment
          For anyone else, here another guide:

          Reset and Restore server - Nuclear option by telecastg - https://forum.espocrm.com/forum/inst...1187#post61187

        • AlexYash
          AlexYash commented
          Editing a comment
          esforim Thank you. I would just added there config-internal.php file together with config.php. Looks like there were changes in the config files structure since then.
      • Sab0tajue
        Senior Member
        • Jul 2019
        • 315

        #8
        Error 500

        Comment


        • AlexYash
          AlexYash commented
          Editing a comment
          DEBUG log?
      • TCM
        Junior Member
        • Apr 2023
        • 1

        #9
        Dear all,

        we have the same problem and are trying several solutions that didn't work. It doesn't matter eighter we use "php command.php upgrade" or try to upgrade over the frontend. We found that all the errors we get are related to entities we added years ago using the entity-manager. All updates upto 7.3.4 worked well over cli.

        Are there any minor update steps we could test?!
        7.3.4-to-7.4.3 is what can be downloaded is there any 7.3.4-to-7.4.0 update available to test??

        Many thanks!

        Comment


        • AlexYash
          AlexYash commented
          Editing a comment
          Which PHP and MySQL versions do you use?
      • muulox
        Member
        • Jan 2022
        • 31

        #10
        I have the same problem to update from 7.3.4 from CLI.
        [root@cloud424 erp.muulox.ro]# php command.php upgrade -y
        Current version is 7.3.4.
        This may take a while. Do not close the terminal.
        Downloading...
        Upgrading...
        Initialization...
        Copying before upgrade files...
        Rebuilding...
        Before upgrade script execution...
        Rebuilding...
        Copying files...
        Rebuilding...
        Reverting...
        Error occurred while EspoCRM rebuild. Please see the log for more detail.

        php version 8.1​

        error log:
        [29-Apr-2023 15:01:01 Europe/Bucharest] PHP Fatal error: Uncaught Error: Failed opening required '/home/muuloxro/erp.muulox.ro/vendor/composer/../phpseclib/phpseclib/phpseclib/bootstrap.php' (include_path='/home/muuloxro/erp.muulox.ro') in /home/muuloxro/erp.muulox.ro/vendor/composer/autoload_real.php:53
        Stack trace:
        #0 /home/muuloxro/erp.muulox.ro/vendor/composer/autoload_real.php(36): composerRequirec582c099b9965c70f73f0740d5a93fdc('d ecc78cc4436b12...', '/home/muuloxro/...')
        EspoCRM Forum /home/muuloxro/erp.muulox.ro/vendor/autoload.php(25): ComposerAutoloaderInitc582c099b9965c70f73f0740d5a9 3fdc::getLoader()
        Forum /home/muuloxro/erp.muulox.ro/bootstrap.php(33): require_once('/home/muuloxro/...')
        #3 /home/muuloxro/erp.muulox.ro/cron.php(30): include('/home/muuloxro/...')
        #4 {main}
        thrown in /home/muuloxro/erp.muulox.ro/vendor/composer/autoload_real.php on line 53
        [29-Apr-2023 12:08:02 UTC] PHP Deprecated: Optional parameter $user declared before required parameter $labelName is implicitly treated as a required parameter in /home/muuloxro/erp.muulox.ro/application/Espo/Modules/Voip/Core/Helpers/VoipEvent.php on line 119
        [29-Apr-2023 12:08:05 UTC] PHP Deprecated: Optional parameter $where declared before required parameter $templateId is implicitly treated as a required parameter in /home/muuloxro/erp.muulox.ro/application/Espo/Modules/Advanced/Services/Report.php on line 5062​
        Last edited by muulox; 04-29-2023, 12:34 PM.

        Comment


        • AlexYash
          AlexYash commented
          Editing a comment
          Which PHP and MySQL versions do you use?
      • Kevin
        Junior Member
        • Jul 2022
        • 5

        #11
        Hello
        Same here. I cannot upgrade. Please help. Many thanks

        Hi lazovic, could you help me please? I have no idea about what is happening. Thanks

        Can I ask about the reason why I am being ignored by ESPOCRM support? Could someone tell me where to ask about my problem? Thanks
        Last edited by Kevin; 05-18-2023, 09:41 PM.

        Comment

        • Christian Lietzke
          Junior Member
          • Jul 2021
          • 14

          #12
          Hi, same problem here.

          Update via UI doesn't work, neither does via CLI but for other reasons I think.
          When I try to update via UI, I get the same error message as OP.

          When I use the CLI, I first got the message that my PHP Version (7.4.3) is outdated and I should update to a newer version, which is something I don't understand because there were four different versions of PHP installed on the server (7.4.3 / 8.0.28 / 8.1.18 / 8.2.3). As the oldest version seemed to be a problem I removed it from the system.
          Now, when I type "php -version" I get:

          PHP 8.2.3 (cli) (built: Feb 14 2023 16:57:50) (NTS)
          Copyright (c) The PHP Group
          Zend Engine v4.2.3, Copyright (c), by Zend Technologies

          When I try to update espoCRM by "php command.php upgrade" from the directory espo is installed in, nothing happens.​

          Comment

        • esforim
          Active Community Member
          • Jan 2020
          • 2204

          #13
          CLI PHP and server running PHP is different. You must change the PHP in your CPanel to PHP 8.1 as well.

          Secondly, what do you mean nothing happens, is there no question/text when you use the commands? If so my guess is that you are not in the right folder, you have use "dir" and "cd" to change to where the command.php file is located (usually it is in the EspoCRM folder)

          Comment

          • Christian Lietzke
            Junior Member
            • Jul 2021
            • 14

            #14
            The server is configured via Plesk. Server (cli) installed PHP Versions are 8.0.28, 8.1.18 and 8.2.3
            Plesk has 7.4.3 (outdated), 8.0.28, 8.1.18 and 8.2.5 installed and running. No problem there...

            "Nothing happens" means I enter the command (in the correct folder) and I just get a new prompt.
            it looks like this:

            root@h0000000:/var/www/vhosts/webservername/espoCRM# php command.php upgrade
            root@h0000000:/var/www/vhosts/webservername/espoCRM#_

            The cli accepts the command, no error message, just an new prompt...
            Nothing else happens.

            Comment

            • lazovic
              Super Moderator
              • Jan 2022
              • 809

              #15
              Hi Christian Lietzke,

              Please send your server error logs and EspoCRM error logs. There should be more information there.

              Comment

              Working...