Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17710

"unknown error" with FLUSH LOGS if log directory is not writeable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3.9
    • 10.3.15, 10.4.5
    • Server
    • None

    Description

      This actually only happens on log rotation, not on simple flush with the log file(s) still in place.

      When doing a log rotate by first renaming the log file, then calling FLUSH LOGS, the open() call by flush actually needs to re-create the log file under its own name, and that rightfully fails if the mysql user does not have write permission on the directory.

      The problem though is that it just reports "Unknown error" instead of "Can't create logfile $path" plus the correct error code, e.g. "errno 13: permission denied"

      How to reproduce:

      cd $datadir
      mv *.err old_error_log
      chmod a-w .
      mysql -e "FLUSH LOGS;"
      

      Attachments

        Activity

          hholzgra Hartmut Holzgraefe created issue -
          hholzgra Hartmut Holzgraefe made changes -
          Field Original Value New Value
          Description This actually only happens on log rotation, not on simple flush with the log file(s) still in place.

          When doing a log rotate by first renaming the log file, then calling FLUSH LOGS, the open() call by flush actually needs to re-create the log file under its own name, and that rightfully fails if the mysql user does not have write permission on the directory.

          The problem though is that it just reports "Unknown error" instead of "Can't create logfile $path" plus the correct error code, e.g. "errno 13: permission denied"
          hholzgra Hartmut Holzgraefe added a comment - See also e.g.: https://lists.launchpad.net/maria-discuss/msg04421.html
          hholzgra Hartmut Holzgraefe made changes -
          Key TODO-1577 MDEV-17710
          Workflow Simple workflow [ 90630 ] MariaDB v3 [ 90631 ]
          Project Dev todo [ 10100 ] MariaDB Server [ 10000 ]
          hholzgra Hartmut Holzgraefe made changes -
          Affects Version/s 10.3.9 [ 23114 ]
          Description This actually only happens on log rotation, not on simple flush with the log file(s) still in place.

          When doing a log rotate by first renaming the log file, then calling FLUSH LOGS, the open() call by flush actually needs to re-create the log file under its own name, and that rightfully fails if the mysql user does not have write permission on the directory.

          The problem though is that it just reports "Unknown error" instead of "Can't create logfile $path" plus the correct error code, e.g. "errno 13: permission denied"
          This actually only happens on log rotation, not on simple flush with the log file(s) still in place.

          When doing a log rotate by first renaming the log file, then calling FLUSH LOGS, the open() call by flush actually needs to re-create the log file under its own name, and that rightfully fails if the mysql user does not have write permission on the directory.

          The problem though is that it just reports "Unknown error" instead of "Can't create logfile $path" plus the correct error code, e.g. "errno 13: permission denied"

          How to reproduce:
          {noformat}
          cd $datadir
          mv *.err old_error_log
          chmod a-w .
          mysql -e "FLUSH LOGS;"
          {noformat}
          serg Sergei Golubchik made changes -
          Comment [ I did not pay attention when creating this, and so ended up in the wrong project

          I used the "Move" function to move it over to MDEV (where it appeared as MDEV-17710)
          but somehow this one here still exists, too ...

          This one can clearly be closed / removed ... (which I can't do)
          ]
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          elenst Elena Stepanova made changes -
          Component/s Server [ 13907 ]
          Fix Version/s 10.3 [ 22126 ]
          Assignee Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.4 [ 22408 ]
          serg Sergei Golubchik made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3.15 [ 23309 ]
          Fix Version/s 10.4.5 [ 23311 ]
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 90631 ] MariaDB v4 [ 155200 ]
          mariadb-jira-automation Jira Automation (IT) made changes -
          Zendesk Related Tickets 119921

          People

            serg Sergei Golubchik
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.