Announcement

Collapse
No announcement yet.

Error occurred while EspoCRM rebuild:

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

  • #16
    MATO,

    Okay, we can leave tables call1 and contact1 alone. But table call-_contact seems to me not quite correct. If it were called call1_contact1, it would be more correct.
    Also, in the call-_contact table, I do not see the status column.

    Comment


    • MATO
      MATO commented
      Editing a comment
      we created a status column and can Rebuild from Admin but still get the upgrade error

  • #17
    MATO,

    The problem, unfortunately, will not be solved if you add a certain column to the table. I meant that the table is wrong in itself. And it's not very good. Your error log just pointed to an issue in it.

    By the way, can you send the error log for today?
    Perhaps there are some changes after editing the table.

    Comment


    • #18
      How can we remove the Call-_Contact in a clean way to allow the Rebuild?

      Logfile attached although to me it looks the same
      Attached Files

      Comment


      • #19
        Drop table call-_contact in database
        do a php rebuild.php by command
        see if table call-_contact is recreated ?

        if yes, attach here your custom/metadata directory here

        for me, there are somewhere in theses files for create this table

        Comment


        • #20
          Update

          The upgrade works if we rename the Custom folder - This means we have an issue in the folder and not the DB as thought.

          Comment


          • MATO
            MATO commented
            Editing a comment
            Getting a 404 error: Not Found atm

          • item
            item commented
            Editing a comment
            You can not do what you have do
            Upgrade process check custom folder for make special think ..

        • #21
          I agree but it does show that we have something in the "custom" folders, I have resolved the 404 and with custom renamed can rebuild the database, with it back to custom we get the same errors as before.

          I will work thru the Custom folder to see where the problem could be.

          Am I going down the right path?

          Comment


          • item
            item commented
            Editing a comment
            yes, this is somewhere in files :
            maybe in call.json and contact.json entity metadata certainly

          • MATO
            MATO commented
            Editing a comment
            the only file that is affecting Custom is Contact.json - I am going to run a new upgrade test without that one file to see the end result

        • #22
          Post here the files in metadata

          have you try this ? https://forum.espocrm.com/forum/inst...0587#post80587

          Comment


          • MATO
            MATO commented
            Editing a comment
            Link is this post

          • item
            item commented
            Editing a comment
            yes but this is important before upgrade

            Drop table call-_contact in database
            do a php rebuild.php by command
            see if table call-_contact is recreated ?

        • #23

          Location - /ESPO/custom/Espo/Custom/Resources/metadata/entityDefs/contact.json

          Nothing has changed in this file since the last upgrade in Jan 2022
          Attached Files

          Comment


          • #24
            your problem is here :

            "calls2": {
            "type": "hasMany",
            "relationName": "call-Contact",
            "foreign": "contacts2",
            "entity": "Call",
            "audited": false,
            "isCustom": true
            },


            but i don't know really how this must be writed...

            maybe contacts
            maybe callcontacts
            maybe call2Contact
            maybe ...delete all what i have "posted" ? do you think you use this ?

            This is responsible of your rebuild issue ! do not upgrade, try php rebuild.php alone

            you must check call.json too..

            If someone can say how must be writed
            Last edited by item; 05-19-2022, 07:30 PM.

            Comment


            • #25
              Have cleaned up Contact.json by removing the links in Entity Manager - see attached
              Checked call.json and can not see any issues - see attached

              Ran a php rebuild.php that complete successfully

              Ran the Upgrade and had the same error with Call-_Contact

              I guess we have come back to the same point of how to rename or delete Call-_Contact so that a php Rebuild.php does not error.
              Attached Files

              Comment


              • #26
                in Call.json, i don't see any "strange"

                in Contact.json :

                "calls2": {

                "type": "linkMultiple",

                "layoutDetailDisabled": true,

                "layoutMassUpdateDisabled": true,

                "importDisabled": true,

                "noLoad": true,

                "isCustom": true

                },

                maybe remove this too..

                then delete table in database call-_Contact
                php clearCache.pho
                php rebuild.php

                so check if in database call-_contact exist ? if yes .. problem not resolved.
                if no .. i think upgrade process must work.

                Check other directory .. for find if Call2 or Call-_ exist in file.. (scopes, .. )

                Comment


                • MATO
                  MATO commented
                  Editing a comment
                  Removed "calls2"

                  Ran the following

                  (uiserver):username:~/ESPOCRM$ /usr/bin/php7.4-cli clear_cache.php
                  (uiserver):username:~/ESPOCRM$ /usr/bin/php7.4-cli rebuild.php - No Errors in SSH but we get an Error 500 when using Admin/Rebuild
                  (uiserver):username:~/ESPOCRM$ /usr/bin/php7.4-cli command.php upgrade
                  Current version is 6.1.10.
                  EspoCRM will be upgraded to version 7.0.10 now. Enter [Y] to continue.
                  y
                  Downloading...
                  Upgrading... This may take a while....
                  Error: Rebuild is failed. Fix all errors before upgrade.

                  Log Error is the same as the upgrade error

                  ALERT: Rebuild database fault: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'call-_contact (id INT AUTO_INCREMENT NOT NULL COLLATE `utf8mb4_unicode_ci`, dele' at line 1

              • #27
                Dropped the "Call-_Contact" from the DB

                I removed everyfile in /ESPOCRM/custom/Espo/Custom/Resources/metadata/entityDefs

                ran Admin/Rebuild and watched it Rebuilt successfully

                Added 3 files at a time back in and went thru the same procedure until all files were added back in and all worked.

                I came to old versions of Contact named "contact1,contact2.json" added them back in to test and had a Rebuild Error 500 for the "DB Error for Call-_Contact"

                Have now deleted all old version files.

                Ran a Rebuild

                Ran a command.php upgrade

                UPGRADE WORKED!!!

                We have an issue with 404 but that is because it changes the .htcaccess file params and is an easy fix

                Comment


                • #28
                  A quick note on the above.

                  It was "item" that fixed the solution with the following
                  your problem is here :

                  "calls2": {
                  "type": "hasMany",
                  "relationName": "call-Contact",
                  "foreign": "contacts2",
                  "entity": "Call",
                  "audited": false,
                  "isCustom": true
                  },

                  deleted the above from contact.json

                  then dropped the Call-_Contact in the DB

                  ran Admin/Rebuild

                  Thank you to everyone that helped me on this issue "BIG RESPECT"

                  Comment

                  Working...
                  X