Announcement

Collapse
No announcement yet.

Rebuild backend not working - Error while rebuilding database

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

  • Rebuild backend not working - Error while rebuilding database

    Running version 5.2.5 on CentOS 7 with MariaDB 5.5.56

    I added a custom entity, then add a custom link to that entity in another entity. Somehow the custom entity disappeared from the EntityManager (but is still in the MySQL database as a table) and thereafter the link field cannot be removed in the EntityManager (there is no "remove" link).

    Now, "rebuild backend" does not work. Adding/removing any field from any entity throws the same error ("Error while rebuilding database")
    I have not done any modification to the database itself or any code, only worked from within the UI with Entity Manager / Layout Manager.

    This problem should never occur this way.

    In my case, the custom entity added was "Cont", and a link named "cont" was added to Accounts.
    A table "cont" is present in MySQL. It is not present in the Entity Manager. The custom field "cont" (of type LINK) is still present in the Entity Manager for the Accounts entity. In MySQL, there is a field called "cont_id" which might represent that field (or not?)

    When I try to add an integer field to ANY entity, the log file shows:
    ERROR: Fault to rebuild database schema. Details: Unknown database type bit requested, Espo\Core\Utils\Database\DBAL\Platforms\MySqlPlatf orm may not support it.

    I know that the MySQL (actually MariaDB) version I use (5.5.56) does support the "bit" data type. I have installed "adminer" on the same server and connect to the Espo database and I can create a new table easily which has the "bit" data type. So there should be no error here.
    The error could be related to one of the custom entities I created but I have no way to say when this started to be a problem (well, I am not the only admin ... so I am not sure what was done exactly at what point).

    (I am not even trying to add a "bit" field - it's an integer field, so no idea where the "bit" problem comes from)

    So I enabled DEBUG mode for the log.
    Shows the same error plus two additional lines:

    Espo.NOTICE: E_NOTICE: Undefined index: Cont {"code":8,"message":"Undefined index: Cont","file":"/var/www/html/espocrm/field/application/Espo/Core/Utils/Database/Orm/RelationManager.php","line":111,"context":{"linkNa me":"cont","linkParams":{"type":"belongsTo","for ei gn":"accounts","entity":"Cont","audited":false," is Custom":true},"entityName":"Account" .... snip ...

    Espo.ERROR: API [POST]:/Admin/fieldManager/:scope, Params:Array ( [scope] => Case ) , InputData: {"type":"int","required":false,"dynamicLogicVis ibl e":null,"dynamicLogicRequired":null,"dynamicLogicR eadOnly":null,"name":"test" ... (snip) ...

    The first error shows that there is something wrong with that link field "Cont", pointing from Accounts to an entity "Cont".
    The 2nd error is probably the failure message for adding the test integer field to the "Case" entity.

    Interestingly, when I go into the editing screen of the "cont" field, I cannot select a default value - there is a dropdown but trying to use it
    results in a 404 NOT FOUND error. (Doing the same in the "campaign" field is fine - it brings up a new window to enter data).

    Last edited by pschulz; 11-25-2018, 08:44 AM.
Working...
X