Announcement

Collapse
No announcement yet.

Upgrading from version 5.7 using PHP 8.0 fails

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Upgrading from version 5.7 using PHP 8.0 fails

    Hi,

    We have one instance of Espocrm version 5.7.11 which we could not upgrade to latest version as we needed to setup a new server with higher capacity. We setup the new server with PHP 8.0, Mariadb 10.3 and Centos 7. We restored the app and database and on loading the app we got "Error 500". We checked the error.log we found that PHP 8 detected an unsupported code relating to strings in Espocrm 5.7.11. We could not load the CRM 5.7.11

    We did another test using php 7.4 and performed the upgrade. Everything worked well.

    Please help and advise. Thank you.

  • #2
    Hi, could you post the error log?

    Comment


    • #3
      Hi shalmaxb

      The error log is attached. This is from the error.log file in the root directory.
      Attached Files

      Comment


      • #4
        There is obviously the mentioned file, that stems from the older version of espoCRM, which causes the error. I did not investigate that, but you could try to exchange that file with the same file of a newer version and try the update again. Though, it is not guaranteed, that this will work.

        Comment


        • #5
          Hi shalmaxb ,

          Thank you for the update. I will try your suggestion. I notice that the next version after 5.7.11 appears to have the code corrected. Will update after testing.

          Comment


          • #6
            Hi shalmaxb ,

            I tried your suggestion. It did not work as there may other errors in versionb 5.7.11. I got this one trying:

            [2022-03-01 12:12:06] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/home/crmemast/public_html/emasconfig/application/Espo/Core/Utils/Database/Schema/Converter.php","line":300,"context":{"entityName": "Case","relationParams":{"type":"manyMany","en tity ":"Account","foreignKey":"id","foreign":null," rela tionName":"caseAccount"},"tables":{"ActionHistoryR ecord":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","ArrayValue":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Attachment":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","AuthLogRecord":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","AuthToken":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Currency":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","DashboardTemplate":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Email":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","EmailAccount":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","EmailAddress":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","EmailFilter":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","EmailFolder":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","EmailTemplate":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","EmailTemplateCategory " :"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Extension":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","ExternalAccount":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Import":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","InboundEmail":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Integration":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Job":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","LeadCapture":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","LeadCaptureLogRecord" : "[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","NextNumber":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Note":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","Notification":"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","PasswordChangeRequest " :"[object] (Espo\\Core\\Utils\\Database\\DBAL\\Schema\\Table: {"_idGeneratorType":0})","PhoneNumber":"[object] (Espo\\Co

            Looks like i have to set php 7.3, the upgrade, then move the version to PHP 8.0. I tried this already and it worked but was tedious. Thank you anyway.

            Comment


            • #7
              Hi shalmaxb ,

              Good morning to you. I managed to upgrade to version 6.1.10 using php 7.3. Then i switched to php 8.0 and the instance works fine. We had to change the UID and GID in config.php as these change with different php versions.

              After upgrading to version 6.1.10, i tried upgrading to version 7.0.9 (the lastest) and it failed. The error i got was as memory problem as below


              HTML Code:
              01-Mar-2022 22:16:34 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12993188 bytes) in /home/emasapps1/public_html/emasconfig/application/Espo/Core/Console/Commands/Upgrade.php on line 253
              I could fix this but the message seems to be less specific. I do not know which memory here. There are so many memory parameters in php and mysql. Appreciate you help on which memory this one is.

              Comment


              • #8
                Hi shalmaxb ,

                Manage to resolve the memory problem. Its the "memory_limit" parameter in php.ini. After i did a retry, the upgrade started but could not complete the rebuild. It gave error:


                [2022-03-01 22:35:27] ALERT: Rebuild database fault: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/emasapps1/public_html/emasconfig/application/Espo/ORM/SqlExecutor.php:70 Stack trace: #0 /home/emasapps1/public_html/emasconfig/application/Espo/ORM/SqlExecutor.php(70): PDO->query('SELECT user.id ...') #1 /home/emasapps1/public_html/emasconfig/application/Espo/ORM/SqlExecutor.php(59): Espo\ORM\SqlExecutor->executeSqlWithDeadlockHandling('SELECT user.id ...', 1) #2 /home/emasapps1/public_html/emasconfig/application/Espo/ORM/Mapper/BaseMapper.php(737): Espo\ORM\SqlExecutor->execute('SELECT user.id ...', false) #3 /home/emasapps1/public_html/emasconfig/application/Espo/ORM/Mapper/BaseMapper.php(128): Espo\ORM\Mapper\BaseMapper->executeSql('SELECT user.id ...') #4 /home/emasapps1/public_html/emasconfig/application/Espo/ORM/Repository/RDBRepository.php(130): Espo\ORM\Mapper\BaseMapper->selectOne(Object(Espo\ORM\Query\Select)) #5 /home/emasapps1/public_html/emasconfig/application/Espo/ORM/EntityManager.php(272): Espo\ORM\Repository\RDBRepository->getById('system') #6 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Utils/Database/Schema/rebuildActions/AddSystemUser.php(40): Espo\ORM\EntityManager->getEntity('User', 'system') #7 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Utils/Database/Schema/Schema.php(339): Espo\Core\Utils\Database\Schema\rebuildActions\Add SystemUser->afterRebuild() #8 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Utils/Database/Schema/Schema.php(243): Espo\Core\Utils\Database\Schema\Schema->executeRebuildActions('afterRebuild') #9 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Utils/Database/Schema/SchemaProxy.php(53): Espo\Core\Utils\Database\Schema\Schema->rebuild() #10 /home/emasapps1/public_html/emasconfig/application/Espo/Core/DataManager.php(146): Espo\Core\Utils\Database\Schema\SchemaProxy->rebuild(NULL) #11 /home/emasapps1/public_html/emasconfig/application/Espo/Core/DataManager.php(115): Espo\Core\DataManager->rebuildDatabase(NULL) #12 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Upgrades/Actions/Base.php(807): Espo\Core\DataManager->rebuild() #13 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Upgrades/Actions/Base/Install.php(181): Espo\Core\Upgrades\Actions\Base->systemRebuild() #14 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Upgrades/Base.php(129): Espo\Core\Upgrades\Actions\Base\Install->stepRebuild(Array) #15 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Upgrades/Base.php(112): Espo\Core\Upgrades\Base->runActionStep('install', 'Rebuild', Array) #16 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Console/Commands/UpgradeStep.php(96): Espo\Core\Upgrades\Base->runInstallStep('Rebuild', Array) #17 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Console/Commands/UpgradeStep.php(76): Espo\Core\Console\Commands\UpgradeStep->runUpgradeStep('Rebuild', Array) #18 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Console/CommandManager.php(90): Espo\Core\Console\Commands\UpgradeStep->run(Object(Espo\Core\Console\Command\Params), Object(Espo\Core\Console\IO)) #19 /home/emasapps1/public_html/emasconfig/application/Espo/Core/ApplicationRunners/Command.php(55): Espo\Core\Console\CommandManager->run(Array) #20 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Application/RunnerRunner.php(85): Espo\Core\ApplicationRunners\Command->run() #21 /home/emasapps1/public_html/emasconfig/application/Espo/Core/Application.php(78): Espo\Core\Application\RunnerRunner->run('Espo\\Core\\Appli...', NULL) #22 /home/emasapps1/public_html/emasconfig/command.php(35): Espo\Core\Application->run('Espo\\Core\\Appli...') #23 {main} [] []

                I am not sure how to interpret this error. Please help.

                Comment


                • #9
                  Hi, now you ran into a database problem (don`t worry, this is happening). I guess, it has to do with your server configuration (maybe the Apache Server or the MySQL server). Not specifically for espoCRM, but perhaps the possible steps described here could help: https://bobcares.com/blog/2006-mysql...-away-magento/

                  Comment


                  • #10
                    Hi, shalmaxb ,

                    I checked all the parameters and they exceed the recommended requirements and it still failed. So i reverted to PHP 7.4 and tested and there was no problem. I do not know what to make of it. I have also set all the parameters for mysql as well and still get the "database went away problem... " for php 8.0.

                    When i tested version 6.1.10 with PHP 8.1, i could not login. It keeps giving me id and password error even though it is correct. When, I tried to upgrade, nothing happen. There was no log or error.log entries. The "php command.php upgrade" command resulted in an empty prompt line.
                    Last edited by murugappan; 03-02-2022, 05:36 AM. Reason: update

                    Comment


                    • #11
                      I guess, 6.1.10 perhaps is not prepared to work with PHP 8.1. Could you update to espo 7.0.9 to see, if that works?

                      Comment


                      • #12
                        Hi shalmaxb

                        The following is my update:

                        (1) Upgraded to version 7.0.9 with PHP 7.4 works great.
                        (2) Upgraded to version 7.0.9 with PHP 8.0 works great.
                        (3) Upgraded to version 7.0.9 with PHP 8.,1 --- crashes with database went away.

                        Its odd, when i used version 6.1.10 with PHP 8.0 everything works fine but i did the same with PHP 8.1 i could not even login to the app! See the attachments. I am going to try this:

                        (1) upgrade from 5.7.11 to 5.8 using php 7.4 due to a bug in version 5.7.11
                        (2) then use php 8.1 to upgrade from there.

                        Lets see how this works.

                        Click image for larger version

Name:	Screenshot_1.png
Views:	456
Size:	51.2 KB
ID:	78996
                        Click image for larger version

Name:	Screenshot_2.png
Views:	366
Size:	25.0 KB
ID:	78997Click image for larger version

Name:	Screenshot_3.png
Views:	392
Size:	21.7 KB
ID:	78998

                        Comment


                        • #13
                          i think, the username/password thing is because of not rebuilding the whole database. The user credentials are in the table user, nearly at the end of all tables.
                          What else you could do is upgrading until the error and after that have a look into your database. You might see the tables, that are missing by comparing to the source database. Then you could import the missing tables from the working database to the new one, that might not be complete.
                          Its worth a try, only to see, if espoCRM works with PHP 8.1.

                          Comment


                          • #14
                            Hi shalmaxb ,

                            This is what i did:

                            (1) I upgraded until Version 6.1.5 using Php 7.4. It worked fine.
                            (2) Switched to Php 8.0. This also worked fantastic.
                            (3) Switched to Php 8.1. The Login pages loaded but the login failed due to invalid credentials. No log errors.
                            (4) Switched back to 8.0. Did not do anything else. The app worked fine.


                            4th March 2022
                            ===========

                            I installed a fresh vanilla version of Espocrm 7.0.9 under Php 8.1 and it seems to work fine.

                            The final conclusion i can draw here is that Espocrm has problem with Php 8.1 when we upgrade from previous versions.. Please advise.
                            Last edited by murugappan; 03-03-2022, 09:21 PM. Reason: Update findings on 4th March 2022

                            Comment


                            • #15
                              Hi shalmaxb ,

                              We have started to migrate from version 5.7.11 to 7.0.9. Everything went on fine until i did the upgrade from 6.1.10 to 7,0,9. I now getting this error:


                              [2022-03-11 22:31:51] ALERT: Rebuild database fault: PDOException: SQLSTATE[HY000]: General error: 1878 Temporary file write failure in /home/crmemast/public_html/emascrmx/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:82 Stack trace: #0 /home/crmemast/public_html/emascrmx/vendor/doctrine/dbal/src/Driver/PDO/Connection.php(82): PDO->query('ALTER TABLE ema...') #1 /home/crmemast/public_html/emascrmx/vendor/doctrine/dbal/src/Connection.php(1035): Doctrine\DBAL\Driver\PDO\Connection->query('ALTER TABLE ema...') #2 /home/crmemast/public_html/emascrmx/application/Espo/Core/Utils/Database/Schema/Schema.php(233): Doctrine\DBAL\Connection->executeQuery('ALTER TABLE ema...') #3 /home/crmemast/public_html/emascrmx/application/Espo/Core/Utils/Database/Schema

                              I checked for the error.log and there was no error.log created. I have attached the app log file. Please help.
                              Attached Files

                              Comment

                              Working...
                              X