Announcement

Collapse
No announcement yet.

Error updating to v8.0

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

  • Error updating to v8.0

    Error log after trying to upgrade from 7.5.6 using CLI

    Code:
    [2023-09-08 21:28:36] WARNING: E_WARNING: Undefined array key "attributes" {"code":2,"message":"Undefined array key \"attributes\"","file":"/application/Espo/ORM/Defs/EntityDefs.php","line":79}
    [2023-09-08 21:28:36] ERROR: Failed to rebuild database schema. Details: array_keys(): Argument #1 ($array) must be of type array, null given at /application/Espo/ORM/Defs/EntityDefs.php:79
    [2023-09-08 21:28:36] ERROR: Database rebuild failure, details: Error while rebuilding database. See log file for details..
    [2023-09-08 21:28:37] WARNING: E_WARNING: Undefined array key "attributes" {"code":2,"message":"Undefined array key \"attributes\"","file":"/application/Espo/ORM/Defs/EntityDefs.php","line":79}
    [2023-09-08 21:28:37] ERROR: Failed to rebuild database schema. Details: array_keys(): Argument #1 ($array) must be of type array, null given at /application/Espo/ORM/Defs/EntityDefs.php:79
    [2023-09-08 21:28:37] ERROR: Database rebuild failure, details: Error while rebuilding database. See log file for details..
    [2023-09-08 21:28:37] ERROR: Upgrade Error: Error: Error occurred while EspoCRM rebuild. Please see the log for more detail.

    Click image for larger version

Name:	image.png
Views:	351
Size:	24.7 KB
ID:	97197​​​​
    Attached Files

  • #2
    Maybe you have a custom entity without "fields" in entityDefs. I'll fix it so it won't produce an error. The code screenshot is from the previous version which is not actual.

    Comment


    • yuri
      yuri commented
      Editing a comment
      Or maybe it's some PHP cache issue. Old metadata is read from a cached file.

  • #3
    Thanks for replying.
    I checked every custom entity and all have the "fields" key.
    Also tried deleting the data/cache folder with no success.

    The error in the logs implies that $this->data is null.

    Code:
    Details: array_keys(): Argument #1 ($array) must be of type array, null given at /application/Espo/ORM/Defs/EntityDefs.php:79
    Any other ideas to where should I look?
    Thank you!

    Comment


    • #4
      The "data" cannot be null as it has an 'array' type hint. The error occurs with the new code. See the screenshot. After the error the code is reverted back to v7.5.6.

      Click image for larger version  Name:	image.png Views:	1 Size:	13.2 KB ID:	97214

      Comment


      • #5
        azidevnom,

        Before Upgrade, disable all extensions you have -> Upgrade your instance to 8.0.0 via CLI -> Enable all your extensions again.

        I have reproduced and resolved your error on a old test instance exactly as described above. Interestingly, the upgrade started with 7.4.6 and successfully upgraded to 7.5.6. The problem occurred when upgrading from 7.5.6 to 8.0.0. The cause of the problem was the fields used by one of the extensions (in my case it was VoIP: https://docs.espocrm.com/extensions/voip-integration/customization/#add-click-to-call-feature-to-a-custom-entity).​
        Last edited by victor; 09-11-2023, 10:25 AM.

        Comment


        • #6
          Originally posted by victor View Post
          azidevnom,

          Before Upgrade, disable all extensions you have -> Upgrade your instance to 8.0.0 via CLI -> Enable all your extensions again.

          I have reproduced and resolved your error on a old test instance exactly as described above. Interestingly, the upgrade started with 7.4.6 and successfully upgraded to 7.5.6. The problem occurred when upgrading from 7.5.6 to 8.0.0. The cause of the problem was the fields used by one of the extensions (in my case it was VoIP: https://docs.espocrm.com/extensions/voip-integration/customization/#add-click-to-call-feature-to-a-custom-entity).​
          Thank you, you are absolutely right.
          After I uninstalled the Google extension (1.5.5) the upgrade to v8.0 completed succesfully. But now I am no longer able to install it back.

          What i could catch in the logs:
          Code:
           ERROR: Failed to rebuild database schema. Details: Incomplete or invalid index definition `primary` on table google_calendar_event at /vendor/doctrine/dbal/src/Platforms/AbstractPlatform.php:2473
          Tried to rename the table "google_calendar_event", then:
          Code:
          ERROR: Failed to rebuild database schema. Details: No columns specified for table google_calendar_event at /vendor/doctrine/dbal/src/Exception.php:102
          There is no "GoogleCalendarEvent.json" file at entityDefs folder, so I guess the problem is in:
          Code:
          /application/Espo/Modules/Google/Core/Utils/Database/Schema/tables/googleCalendarEvent.php
          Please help, yuri, I beg you.

          Comment


          • #7
            azidevnom,

            Please try this solution https://forum.espocrm.com/forum/exte...4703#post94703

            Comment


            • #8
              Originally posted by victor View Post
              victor thank you again. I tried it but it did not work. I tested it on a clean instance and did not even created any tables.

              Saw this in the logs though...
              Code:
              NOTICE: E_USER_DEPRECATED: Definitions in Database\Schema\tables are deprecated and will be remove in v8.0. {"code":16384,"message":"Definitions in Database\\Schema\\tables are deprecated and will be remove in v8.0.","file":"/application/Espo/Core/Utils/Database/Schema/Builder.php","line":492}

              Comment


              • #9
                azidevnom,

                Install Google Integration extension 1.6.0 - it installs without problems on EspoCRM 8.0.0.
                Although when trying to install Google Integration extension 1.5.5 on EspoCRM 8.0.0, we get an error in the browser:​
                Code:
                Error 500
                Error occurred while EspoCRM rebuild. Please see the log for more detail.​
                in logs with Debug mode enabled:
                Code:
                ​[2023-09-13 11:30:10] WARNING: E_WARNING: Undefined array key "attributes" {"code":2,"message":"Undefined array key \"attributes\"","file":"/var/www/html/delme/application/Espo/ORM/Defs/EntityDefs.php","line":79}
                [2023-09-13 11:30:10] ERROR: Failed to rebuild database schema. Details: array_keys(): Argument #1 ($array) must be of type array, null given at /var/www/html/delme/application/Espo/ORM/Defs/EntityDefs.php:79
                [2023-09-13 11:30:10] ERROR: Database rebuild failure, details: Error while rebuilding database. See log file for details..
                [2023-09-13 11:30:10] INFO: Installer: Restore previous files.​
                Code:
                [2023-09-13 11:30:13] DEBUG: API (500) Error occurred while EspoCRM rebuild. Please see the log for more detail.; POST /Extension/action/install; Input data: {"id":"65019d39be049db7f"}; Route pattern: /{controller}/action/{action}; Route params: Array ( [controller] => Extension [action] => install )
                [2023-09-13 11:30:13] ERROR: (500) Error occurred while EspoCRM rebuild. Please see the log for more detail.; POST /Extension/action/install; line: 282, file: /var/www/html/delme/application/Espo/Core/Upgrades/Actions/Base.php​
                also in the logs is the following:
                Code:
                NOTICE: E_USER_DEPRECATED: Definitions in Database\Schema\tables are deprecated and will be remove in v8.0. {"code":16384,"message":"Definitions in Database\\Schema\\tables are deprecated and will be remove in v8.0.","file":"/var/www/html/delme/application/Espo/Core/Utils/Database/Schema/Builder.php","line":494}
                This information in the logs most likely indicates an incompatibility Google Integration extension 1.5.5 on EspoCRM 8.0.0​.
                yuri can confirm or deny my assumption.
                Attached Files
                Last edited by victor; 09-13-2023, 11:56 AM.

                Comment


                • #10
                  Correct. Google Integration v1.5 is not compatible with v8.0. We will add an additional check to prevent error message on upgrade and show a message prompting to upgrade the extension.

                  Comment

                  Working...
                  X