Announcement

Collapse
No announcement yet.

SQL Errors and can't rebuild schema

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

  • SQL Errors and can't rebuild schema

    Hey,

    after an upgrade marathon from 2.7.2 to 5.0.3, I get SQL Errors when trying to access contacts, todos, emails and many other areas, I get SQL errors like this:

    Code:
    Server side error 500: 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 'AS `accountType`, contact.created_at AS `createdAt`, contact.modified_at AS `mod' at line 1
    If I try to rebuild the database, I get the following error:
    Code:
    [2018-01-31 13:36:09] Espo.WARNING: E_WARNING: get_object_vars() expects parameter 1 to be object, array given {"code":2,"message":"get_object_vars() expects parameter 1 to be object, array given","file":"/application/Espo/Core/Utils/Metadata.php","line":291} []
    [2018-01-31 13:36:09] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/application/Espo/Core/Utils/Metadata.php","line":291} []
    [2018-01-31 13:36:09] Espo.DEBUG: Schema\Converter - Start: building schema [] []
    [2018-01-31 13:36:09] Espo.ERROR: Fault to rebuild database schema. Details: There is no column with name 'name' on table 'account'. [] []
    [2018-01-31 13:36:09] Espo.ERROR: API [POST]:/Admin/rebuild, Params:Array ( ) , InputData:  - Error while rebuilding database. See log file for details. [] []
    [2018-01-31 13:36:09] Espo.ERROR: Display Error: Error while rebuilding database. See log file for details., Code: 500 URL: /api/v1/Admin/rebuild [] []
    Any idea? Is there a way to log the whole queries?

    Best
    Christian

  • #2
    Hello
    Which version of EspoCRM is current?
    Did you customize EspoCRM? If yes - attach zipped custom/Espo/Custom/Resources/metadata
    What version of php do you use?
    Job Offers and Requests

    Find Developer
    Find Customer

    Comment


    • #3
      Hey,

      it's 5.0.3. I did not install the original installation, but it seems to be customized. Metadata attached.

      It's running with PHP 7.0.20. During the first upgrades, I had to switch to PHP 5.6.x

      Thanks!
      Christian
      Attached Files

      Comment


      • #4
        1. Remove Account.json
        2. in Opportunity.json remove
        Code:
        ,
            "0": {
                "fields": {
                    "stage": {
                        "probabilityMap": null
                    }
                }
            }
        3. Rebuild
        4. In Entity Managed > Opportunity > Fields > stage set Stage Probabilities (%)
        Job Offers and Requests

        Find Developer
        Find Customer

        Comment

        Working...
        X