Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-5256

SQL error on some MySQL/MariaDB during log rotation for messenger logs

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.10.0
    • Fix Version/s: 5.11.0-b2
    • Component/s: None
    • Labels:
      None

      Description

      On MariaDB 10.6, and possibly other newer versions of MariaDB, the following error is written to logs when the automation task "Clean Up Logs" runs.

      0 old Email logs have been deleted.
      Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INNER JOIN `messengers` ON `messengers`.`id`=`log_messenger`.`messenger_id` W...' at line 1 #0 
      

      The potential fix is to update app/models/logs.php around line 1417 to change:

      $this->Record->delete();

      to:

      $this->Record->delete(['log_messenger.*']);

      Waiting on confirmation that this does resolve the issue.

        Activity

        Hide
        admin Paul Phillips added a comment -

        This solved the issue for the customer that it was impacting.

        Show
        admin Paul Phillips added a comment - This solved the issue for the customer that it was impacting.

          People

          • Assignee:
            Unassigned
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: