Creating a new field in email entity times out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Emmker
    Member
    • Nov 2023
    • 64

    Creating a new field in email entity times out

    I try to create a field in email entity and it times out in around 40-50 seconds

    The email records are around 200.000 or more

    I do not have the same problem with any other entity.

    I have tried boolean and enum type of fields with no luck.

    Any ideas about why?


    My server has 16gb ram dedicated to the espo, 8 cpus and the optimizations o mysql are
    innodb_buffer_pool_size = 8G
    innodb_buffer_pool_instances = 8
    innodb_log_file_size = 2G
    innodb_flush_log_at_trx_commit = 2
    sort_buffer_size = 4M​

  • Vadym
    Super Moderator
    • Jun 2021
    • 345

    #2
    Hi Emmker,

    Please provide the EspoCRM error log, web server error log, and a screenshot of Administration -> System Requirements to get more details about this issue.
    ​

    Comment

    • Emmker
      Member
      • Nov 2023
      • 64

      #3
      The error log:

      PHP Code:
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] ERROR: Workflow [66471ab5ee10769a1]: Action failed, [executeFormula] [0], SQLSTATE[42S22]: Column not found: 1054 Unknown column 'email.c_test' in 'field list'.
      [2024-09-15 21:00:36] CRITICAL: (HY000) Failed job 66e744065c6ef54c8. SQLSTATE[HY000]: General error: 2006 MySQL server has gone away :: /var/www/espocrm/application/Espo/ORM/Executor/DefaultSqlExecutor.php(77)
      [2024-09-15 21:00:36] ERROR: (0) Uncaught Exception LogicException: "SQLSTATE[HY000]: General error: 2006 MySQL server has gone away" at /var/www/espocrm/application/Espo/Core/Job/JobRunner.php line 63 :: /var/www/espocrm/application/Espo/Core/Job/JobRunner.php(63)​ 
      
      No errors on apache



      Click image for larger version

Name:	Screenshot 2024-09-17 at 02.24.15.png
Views:	98
Size:	430.4 KB
ID:	110311​

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        Maybe the 'email' table is constantly read and written while you are creating the field. Maybe try to disable cron, set the maintenance mode (Administration > Settings), wait for a minute and then try to create your field.

        Also check whether there's enough disk space on the server. MySQL may go away when it's not enough.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8440

          #5
          BTW. Does the email's list view load fast for you?
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment


          • Emmker
            Emmker commented
            Editing a comment
            Yes, as fast as always.
        • Emmker
          Member
          • Nov 2023
          • 64

          #6
          Originally posted by yuri
          Maybe the 'email' table is constantly read and written while you are creating the field. Maybe try to disable cron, set the maintenance mode (Administration > Settings), wait for a minute and then try to create your field.

          Also check whether there's enough disk space on the server. MySQL may go away when it's not enough.
          In maintenance mode same result.
          The disk space is more than ok.

          I will disable cron tonight to check, and get back.

          Edit: same behaviour with disabled cron.
          Should I try with disabled workflows too?
          Last edited by Emmker; 09-18-2024, 08:14 PM.

          Comment

          • Emmker
            Member
            • Nov 2023
            • 64

            #7
            I have new data for the problem.
            First of all it still persists.

            Second, I found out that every email workflow that I have created, still works, but when I get in the workflow, without clicking the edit button, after some 20-30 seconds it throws a timeout error on the top.

            Mind , that the error is not visible in the /data/logs file.

            The other workflows (case, task etc) are working and have logs just fine, except from a scheduled workflow that has this script as action:
            Code:
            $lastEmail = record\findOne(
            'Email',
            'createdAt', 'desc',
            'parentId', id,
            'isReplied', false,
            'createdAt>', '2024-04-01',
            'fromEmailAddressId!=', '658578db1ea46a67b'
            );
            
            ifThen($lastEmail != null,
            record\update('Case', id, 'status', 'Needs Reply')
            );
            Edit:
            Just found out that I have many reports that give the timeout error and do not have logs either. Regardless of entity.
            Last edited by Emmker; 12-18-2024, 12:36 AM.

            Comment

            • shalmaxb
              Senior Member
              • Mar 2015
              • 1602

              #8
              from the error log, I guess you have some orphan data from a field called email_ctest. It can happen, that you delete a field in the GUI, but it is kept in database and/or json file. As you use workflow, maybe there this field is called also, but does not exist anymore.

              Comment

              Working...