Upgrade Error when Upgrading from 8.4.2 to 9.0.7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrisgood
    Junior Member
    • May 2022
    • 9

    Upgrade Error when Upgrading from 8.4.2 to 9.0.7

    Error encountered when running: php command.php upgrade on test instance of Espo: ERROR: Upgrade Error: Error: Unclosed '{' on line 23 does not match ')'.

    Have tried removing 3rd party plugins and retrying upgrade without success. I did find and remove a few old extensions that had previously been deleted from the Extensions GUI but were still in custom/Modules and/or client/custom/modules and re-ran upgrade but to no avail.

    PHP Version: 8.3.20
    No errors showing in Adminstration > System Requirements
    No custom entry points in /custom/Espo/Custom

    No issues caused by failed upgrade as upgrade successfully reverts. Logs show completed rebuild of entities - first line of log after this is always the same error.
  • item
    Active Community Member
    • Mar 2017
    • 1517

    #2
    Hi,
    in V9, there a new step before upgrade, he first check all files for see if there are any "php error". In your case, you have a bad file somewhere.
    it's hard to find where, but there are a solution :

    download the upgrade file.
    modify this file : BeforeUpgrade.php

    line 114 add : echo $file .'\n'; // just after : $file = $path[0];

    then rezip the file
    put the upgrade.zip on the server on /espocrm/here
    upgrade by command : php command.php upgrade -y --file="EspoCRM-upgrade.zip"

    so you will see wich file is bad.
    after correct all file in error, the process end.
    Now you can upgrade by recommanded way.

    And after, you can upgrade php too so you are ready when 8.3 will be obsolete


    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment


    • chrisgood
      chrisgood commented
      Editing a comment
      Thanks for this. I had already downloaded the zip file and looked at the script. I ascertained that there was an extra check of php issues for the upgrade and had already tried to exclude some modules to see if these contained the line causing the error.

      I'll add the line as suggested.
  • chrisgood
    Junior Member
    • May 2022
    • 9

    #3
    Having corrected a few syntax errors in custom PrimaryFilters, removed a few older 3rd party extensions that are using classes deprecated in 9.0.x, and removing an extension that is required (so will have to wait for 3rd party to update the extension to update my prod instance) I managed to get the upgrade to work.

    I am encountering an issue with any entity that has the stream enabled:

    ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'case.is_internal' in 'field list'
    ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'document.stream_updated_at' in 'field list'

    + Several other entities with same error.

    Comment


    • item
      item commented
      Editing a comment
      have you make a : rebuild ?
      make it from command line for me.
  • chrisgood
    Junior Member
    • May 2022
    • 9

    #4
    The Espo instance is now fully working. The rebuild simply took much longer than usual (a few hours). I've upgraded to 9.0.8 today without issue or significant delay and all is working ok, including stream-enabled entities. Thanks for your assistance.

    Comment

    Working...