Upgrade 8.4.2 to 9.0.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stefan
    Member
    • Jul 2021
    • 66

    Upgrade 8.4.2 to 9.0.2

    Hi!

    Im getting following error if I try to update espocrm:

    Code:
    Error: Failed opening required 'lib/byte_safe_strings.php'

    I'm using PHP 8.2.
  • lazovic
    Super Moderator
    • Jan 2022
    • 851

    #2
    Hi Stefan,

    Please tell me how you upgraded your EspoCRM instance? Through UI or through CLI? Perhaps you use a Docker or Docker Compose installation?

    We would be grateful for additional information.

    Comment

    • Stefan
      Member
      • Jul 2021
      • 66

      #3
      From commandline. I don't use Docker.

      Code:
      php82 command.php upgrade
      I've also tried it with PHP8.3 and file:
      Code:
      php83 command.php upgrade -y --file="EspoCRM-upgrade-8.4.2-to-9.0.2.zip"
      Same result.

      Comment

      • lazovic
        Super Moderator
        • Jan 2022
        • 851

        #4
        Stefan,

        Do you have any third-party extensions installed? Unofficial ones that are not listed on the site: https://www.espocrm.com/extensions.

        Comment

        • Stefan
          Member
          • Jul 2021
          • 66

          #5
          Yes, I have installed some third-party extensions:
          • Link Button 1.6.0
          • Ebla Multiple Link Pro 3.48.0
          • Ebla Enum Plus 3.0.1
          • Stream pro 2.5.0
          • File Sharing 1.0.0
          • Dynamic Checklist Field Type 2.2.2
          • Advanced Settings 1.0.2
          • Modern Theme 1.2.4
          • Ebla Labels 1.4.1
          • Dubas Custom Formulas 0.0.2

          Comment

          • Stefan
            Member
            • Jul 2021
            • 66

            #6
            They only thing I've foud related to 'lib/byte_safe_strings.php' is a library called paragonie/random_compat.

            Does espocrm use that?

            Comment

            • lazovic
              Super Moderator
              • Jan 2022
              • 851

              #7
              Stefan,

              These files are currently not in vanilla EspoCRM at all, and I'm not sure that they ever were.

              In any case, this concerns at least one of the listed extensions. You can try to uninstall them, successfully upgrade the version of your instance, and then enable them one by one. Important: Please make a backup of the instance and database before doing this to avoid problems: https://docs.espocrm.com/administrat...up-and-restore.

              You can also disable them and just wait until the developers of these extensions adjust the code to the new version of EspoCRM.

              Comment

              • Stefan
                Member
                • Jul 2021
                • 66

                #8
                I have just checked: paragonie/random_compat is inside the upgrade zip, under vendorFiles and inside this there is a file psalm-autoload.php which requires the lib, that causes the error:

                Code:
                require_once 'lib/byte_safe_strings.php';

                Could it be related to this in any way?


                Or is there a way to narrow down the problem more precisely. With loglevel DEBUG, unfortunately I did not get any more information
                Last edited by Stefan; Today, 01:13 PM.

                Comment

                • lazovic
                  Super Moderator
                  • Jan 2022
                  • 851

                  #9
                  Stefan,

                  I had no problems upgrading EspoCRM from v8.4.2 to v9.0.2 using the upgrade package. Please try at least temporarily disabling extensions and retrying the upgrade of your instance.

                  Comment

                  • Stefan
                    Member
                    • Jul 2021
                    • 66

                    #10
                    How do i temporarily disable extensions?

                    Sorry but if I look at the upgrade zip, in which the mentioned file listed in the error message is called
                    Code:
                    require_once “lib/byte_safe_strings.php
                    And also in the called folder (lib) in the upgrade package I find no byte_safe_strings.php, so exaclty what the error message says, is it not more likely that this is where the problem lies?

                    Comment


                    • victor
                      victor commented
                      Editing a comment
                      - First, remove all unofficial extensions from your instance.
                      - Then try to update the instance via CLI.
                      - Reinstall your extensions in EspoCRM 9.0.+.
                  • Stefan
                    Member
                    • Jul 2021
                    • 66

                    #11
                    victor lazovic So I removed all extensions, except:

                    Advanced Pack 3.6.3
                    Tcpdf 0.1.1
                    Google Integration 1.7.6
                    Outlook Integration 1.3.6

                    Same error, as I thought.

                    Comment

                    • Stefan
                      Member
                      • Jul 2021
                      • 66

                      #12
                      So I have spent some more time investigating this issue in more detail.

                      It seems that the problem is caused by my custom entry points located in custom/Espo/Custom/EntryPoints/

                      I also have a vendor directory with a composer file inside this folder. When I modify BeforeUpgrade.php to skip this directory ('^custom\/Espo\/Custom\/EntryPoints\/vendor') in $skipPathRegexList, like other vendor directories, the upgrade process gets a step further.

                      However, the next issue appears because other PHP files inside custom/Espo/Custom/EntryPoints/ are being loaded by the function loadFromDir().

                      This results in the following error message:

                      "Cannot modify header information - headers already sent by"
                      I think the reason for this is that my custom entry points generate HTML output, which naturally includes headers.

                      Could you confirm whether this is the intended behavior, or can the custom/Espo/Custom/EntryPoints/ directory also be excluded from being loaded during the upgrade?

                      Comment

                      Working...