Announcement

Collapse
No announcement yet.

Cannot Hard Rebuild

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

  • Cannot Hard Rebuild

    When attempting a hard rebuild I am getting these errors:

    [2023-09-07 19:30:11] ERROR: Uncaught Exception PDOException: "SQLSTATE[HY000] [2002] Connection refused" at /opt/bitnami/espocrm/application/Espo/ORM/PDO/MysqlPDOFactory.php line 73 {"exception":"[object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /opt/bitnami/espocrm/application/Espo/ORM/PDO/MysqlPDOFactory.php:73)"}
    [2023-09-07 19:35:21] ALERT: Rebuild database error: An exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'parent_id' at row 20
    [2023-09-07 19:35:21] ALERT: Rebuild database error: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'contact_id' at row 23


    Any suggestions?

    I have a lot of records and am having trouble locating the records causing these issues.

  • #2
    Hi,
    make a backup first with hard rebuild ! (see recommandation for use this command on documentation)
    certainly collation/charset issue in database

    maybe : https://forum.espocrm.com/forum/inst...-after-upgrade

    Edit : verify too in entity manager for length of field.
    Last edited by item; 09-07-2023, 08:29 PM.

    Comment


    • #3
      item

      I am doing this on a backup. Appreciate the warning.

      All of the contact IDs in every table seem to be set up as utf8mb4_unicode_ci and varchar(17).

      Where would I find the length of the field? I am assuming all of these are relationship connections so there shouldnt be a length in the settings.

      Comment


      • item
        item commented
        Editing a comment
        here : https://docs.espocrm.com/development.../#app-recordid
        my recordId.json :
        {
        "length": 17
        }

        i just see in my database sample : account_contact
        accountId : length 17 collation and charset : utf8mb4_unicode_ci
        contactId : length 17 collation and charset : utf8mb4_unicode_ci

    • #4
      Actually, the user table is set up as mb3 and varchar(24)

      Comment


      • #5
        That is exactly what it is. Ran the mb4 conversion script and it is humming like an angel. item, thanks for the assist.

        Comment


        • #6
          I'm getting the following error when trying to HARD REBUILD even though I am running command under SUDO as `sudo php /var/www/espocrm/command.php rebuild --hard`

          [2024-10-16 01:33:58] ERROR: (0) Uncaught Exception RuntimeException: "Route collector cache file directory `data/cache/application` is not writable" at /var/www/espocrm/vendor/slim/slim/Slim/Routing/RouteCollector.php line 142 :: /var/www/espocrm/vendor/slim/slim/Slim/Routing/RouteCollector.php(142)

          Comment


          • khopper
            khopper commented
            Editing a comment
            I could only get this to work by logging in as www-data first!
            WARNING: THIS IS POTENTIALLY INSECURE & SHOULD NOT BE DONE IN MOST CIRCUMSTANCES In this how-to I will provide a one-time version and a shorter over time version. For the latter one, I assume you know how to use chmod. One-Time $ su

            $ su
            Password:
            # su -s /bin/bash www-data
        Working...
        X