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;"
|
{"report":{"fcp":754.8999998569489,"ttfb":171.59999990463257,"pageVisibility":"visible","entityId":70812,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"5a37fbfa-c345-495c-9a52-1425b7af14b6","navigationType":0,"readyForUser":823.7999999523163,"redirectCount":0,"resourceLoadedEnd":795.5999999046326,"resourceLoadedStart":176.59999990463257,"resourceTiming":[{"duration":9.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":176.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":176.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":185.79999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":10.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":176.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":176.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":187,"responseStart":0,"secureConnectionStart":0},{"duration":64.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":177.09999990463257,"connectEnd":177.09999990463257,"connectStart":177.09999990463257,"domainLookupEnd":177.09999990463257,"domainLookupStart":177.09999990463257,"fetchStart":177.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":177.09999990463257,"responseEnd":241.79999995231628,"responseStart":241.79999995231628,"secureConnectionStart":177.09999990463257},{"duration":149,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":177.19999980926514,"connectEnd":177.19999980926514,"connectStart":177.19999980926514,"domainLookupEnd":177.19999980926514,"domainLookupStart":177.19999980926514,"fetchStart":177.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":177.19999980926514,"responseEnd":326.19999980926514,"responseStart":326.19999980926514,"secureConnectionStart":177.19999980926514},{"duration":152.70000004768372,"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":177.29999995231628,"connectEnd":177.29999995231628,"connectStart":177.29999995231628,"domainLookupEnd":177.29999995231628,"domainLookupStart":177.29999995231628,"fetchStart":177.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":177.29999995231628,"responseEnd":330,"responseStart":330,"secureConnectionStart":177.29999995231628},{"duration":153,"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":177.5,"connectEnd":177.5,"connectStart":177.5,"domainLookupEnd":177.5,"domainLookupStart":177.5,"fetchStart":177.5,"redirectEnd":0,"redirectStart":0,"requestStart":177.5,"responseEnd":330.5,"responseStart":330.5,"secureConnectionStart":177.5},{"duration":153.09999990463257,"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":177.79999995231628,"connectEnd":177.79999995231628,"connectStart":177.79999995231628,"domainLookupEnd":177.79999995231628,"domainLookupStart":177.79999995231628,"fetchStart":177.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":177.79999995231628,"responseEnd":330.89999985694885,"responseStart":330.89999985694885,"secureConnectionStart":177.79999995231628},{"duration":206.89999985694885,"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":178,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":178,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":384.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":153.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":178.09999990463257,"connectEnd":178.09999990463257,"connectStart":178.09999990463257,"domainLookupEnd":178.09999990463257,"domainLookupStart":178.09999990463257,"fetchStart":178.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":178.09999990463257,"responseEnd":331.39999985694885,"responseStart":331.39999985694885,"secureConnectionStart":178.09999990463257},{"duration":206.79999995231628,"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":178.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":178.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":153.39999985694885,"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":178.5,"connectEnd":178.5,"connectStart":178.5,"domainLookupEnd":178.5,"domainLookupStart":178.5,"fetchStart":178.5,"redirectEnd":0,"redirectStart":0,"requestStart":178.5,"responseEnd":331.89999985694885,"responseStart":331.89999985694885,"secureConnectionStart":178.5},{"duration":288.2999999523163,"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":183.59999990463257,"connectEnd":183.59999990463257,"connectStart":183.59999990463257,"domainLookupEnd":183.59999990463257,"domainLookupStart":183.59999990463257,"fetchStart":183.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":183.59999990463257,"responseEnd":471.89999985694885,"responseStart":471.89999985694885,"secureConnectionStart":183.59999990463257},{"duration":500.2000000476837,"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":183.69999980926514,"connectEnd":183.69999980926514,"connectStart":183.69999980926514,"domainLookupEnd":183.69999980926514,"domainLookupStart":183.69999980926514,"fetchStart":183.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":183.69999980926514,"responseEnd":683.8999998569489,"responseStart":683.8999998569489,"secureConnectionStart":183.69999980926514},{"duration":76,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":396.5,"connectEnd":396.5,"connectStart":396.5,"domainLookupEnd":396.5,"domainLookupStart":396.5,"fetchStart":396.5,"redirectEnd":0,"redirectStart":0,"requestStart":396.5,"responseEnd":472.5,"responseStart":472.5,"secureConnectionStart":396.5},{"duration":38.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":672.3999998569489,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":672.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":711.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":113.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":673.3999998569489,"connectEnd":673.3999998569489,"connectStart":673.3999998569489,"domainLookupEnd":673.3999998569489,"domainLookupStart":673.3999998569489,"fetchStart":673.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":673.3999998569489,"responseEnd":787,"responseStart":787,"secureConnectionStart":673.3999998569489},{"duration":121.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":673.7999999523163,"connectEnd":673.7999999523163,"connectStart":673.7999999523163,"domainLookupEnd":673.7999999523163,"domainLookupStart":673.7999999523163,"fetchStart":673.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":673.7999999523163,"responseEnd":795.5999999046326,"responseStart":795.5999999046326,"secureConnectionStart":673.7999999523163},{"duration":104.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":748.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":748.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":852.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":27.200000047683716,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":769.6999998092651,"connectEnd":769.6999998092651,"connectStart":769.6999998092651,"domainLookupEnd":769.6999998092651,"domainLookupStart":769.6999998092651,"fetchStart":769.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":769.6999998092651,"responseEnd":796.8999998569489,"responseStart":796.8999998569489,"secureConnectionStart":769.6999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":19,"responseStart":172,"responseEnd":180,"domLoading":175,"domInteractive":883,"domContentLoadedEventStart":883,"domContentLoadedEventEnd":928,"domComplete":1428,"loadEventStart":1428,"loadEventEnd":1430,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":854.5},{"name":"bigPipe.sidebar-id.end","time":855.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":855.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":857.7999999523163},{"name":"activityTabFullyLoaded","time":938.8999998569489}],"measures":[],"correlationId":"8f04ff4bedf543","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":10,"dbConnsTimeInMs":24,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}