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;"
Hartmut Holzgraefe
made changes -
2018-11-14 11:15
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"
Hartmut Holzgraefe
made changes -
2018-11-14 11:22
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}
Elena Stepanova
made changes -
2018-11-18 22:59
Status
Open
[ 1
]
Confirmed
[ 10101
]
Elena Stepanova
made changes -
2018-11-18 22:59
Component/s
Server
[ 13907
]
Fix Version/s
10.3
[ 22126
]
Assignee
Sergei Golubchik
[ serg
]
Sergei Golubchik
made changes -
2019-05-04 18:13
Status
Confirmed
[ 10101
]
In Progress
[ 3
]
Sergei Golubchik
made changes -
2019-05-04 21:34
Status
In Progress
[ 3
]
Stalled
[ 10000
]
Sergei Golubchik
made changes -
2019-05-07 16:41
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
]
Sergei Golubchik
made changes -
2021-12-06 21:48
Workflow
MariaDB v3
[ 90631
]
MariaDB v4
[ 155200
]
{"report":{"fcp":1026.8000001907349,"ttfb":251.80000019073486,"pageVisibility":"visible","entityId":70812,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"bc8059da-f9b8-4746-bd48-3c1b7ba18176","navigationType":0,"readyForUser":1092.3999996185303,"redirectCount":0,"resourceLoadedEnd":1453.6999998092651,"resourceLoadedStart":257.3999996185303,"resourceTiming":[{"duration":218.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":257.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":476,"responseStart":0,"secureConnectionStart":0},{"duration":218.70000076293945,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":257.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":476.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":284.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":257.80000019073486,"connectEnd":257.80000019073486,"connectStart":257.80000019073486,"domainLookupEnd":257.80000019073486,"domainLookupStart":257.80000019073486,"fetchStart":257.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":257.80000019073486,"responseEnd":542.3000001907349,"responseStart":542.3000001907349,"secureConnectionStart":257.80000019073486},{"duration":370.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":258,"connectEnd":258,"connectStart":258,"domainLookupEnd":258,"domainLookupStart":258,"fetchStart":258,"redirectEnd":0,"redirectStart":0,"requestStart":258,"responseEnd":628.1999998092651,"responseStart":628.1999998092651,"secureConnectionStart":258},{"duration":374.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":258.30000019073486,"connectEnd":258.30000019073486,"connectStart":258.30000019073486,"domainLookupEnd":258.30000019073486,"domainLookupStart":258.30000019073486,"fetchStart":258.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":258.30000019073486,"responseEnd":632.8000001907349,"responseStart":632.8000001907349,"secureConnectionStart":258.30000019073486},{"duration":374.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":258.5,"connectEnd":258.5,"connectStart":258.5,"domainLookupEnd":258.5,"domainLookupStart":258.5,"fetchStart":258.5,"redirectEnd":0,"redirectStart":0,"requestStart":258.5,"responseEnd":633.3000001907349,"responseStart":633.3000001907349,"secureConnectionStart":258.5},{"duration":375.20000076293945,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":258.5999994277954,"connectEnd":258.5999994277954,"connectStart":258.5999994277954,"domainLookupEnd":258.5999994277954,"domainLookupStart":258.5999994277954,"fetchStart":258.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":258.5999994277954,"responseEnd":633.8000001907349,"responseStart":633.8000001907349,"secureConnectionStart":258.5999994277954},{"duration":430.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":258.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":258.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":689,"responseStart":0,"secureConnectionStart":0},{"duration":375.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":259,"connectEnd":259,"connectStart":259,"domainLookupEnd":259,"domainLookupStart":259,"fetchStart":259,"redirectEnd":0,"redirectStart":0,"requestStart":259,"responseEnd":634.3000001907349,"responseStart":634.3000001907349,"secureConnectionStart":259},{"duration":430.1000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":259.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":259.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":689.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":375.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":259.19999980926514,"connectEnd":259.19999980926514,"connectStart":259.19999980926514,"domainLookupEnd":259.19999980926514,"domainLookupStart":259.19999980926514,"fetchStart":259.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":259.19999980926514,"responseEnd":635.0999994277954,"responseStart":635.0999994277954,"secureConnectionStart":259.19999980926514},{"duration":1192.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":260.0999994277954,"connectEnd":260.0999994277954,"connectStart":260.0999994277954,"domainLookupEnd":260.0999994277954,"domainLookupStart":260.0999994277954,"fetchStart":260.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":260.0999994277954,"responseEnd":1452.1999998092651,"responseStart":1452.1999998092651,"secureConnectionStart":260.0999994277954},{"duration":1188.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":264.8999996185303,"connectEnd":264.8999996185303,"connectStart":264.8999996185303,"domainLookupEnd":264.8999996185303,"domainLookupStart":264.8999996185303,"fetchStart":264.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":264.8999996185303,"responseEnd":1453.6999998092651,"responseStart":1453.6999998092651,"secureConnectionStart":264.8999996185303},{"duration":748.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":704.1999998092651,"connectEnd":704.1999998092651,"connectStart":704.1999998092651,"domainLookupEnd":704.1999998092651,"domainLookupStart":704.1999998092651,"fetchStart":704.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":704.1999998092651,"responseEnd":1452.6999998092651,"responseStart":1452.6999998092651,"secureConnectionStart":704.1999998092651},{"duration":453.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1017,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1017,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1470.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":56,"responseStart":252,"responseEnd":262,"domLoading":255,"domInteractive":1562,"domContentLoadedEventStart":1562,"domContentLoadedEventEnd":1628,"domComplete":1831,"loadEventStart":1831,"loadEventEnd":1831,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1529.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1530.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1530.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1533.8999996185303},{"name":"activityTabFullyLoaded","time":1646.5999994277954}],"measures":[],"correlationId":"6ce17f437ba592","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":141,"dbReadsTimeInMs":25,"dbConnsTimeInMs":35,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
See also e.g.: https://lists.launchpad.net/maria-discuss/msg04421.html