Description
When we start the mariadb docker with `--skip-grant-tables` option, the docker exited 1 and failed due to the following error
--------------
DROP USER IF EXISTS root@'127.0.0.1', root@'::1'
--------------
ERROR 1290 (HY000) at line 7: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
This issue can also be reproduced with skip_grant_tables=ON in the mariadb configuration file.
This issue is caused by the conflict between the DROP USER IF EXISTS root@'127.0.0.1', root@'::1' from the MariaDB's docker entrypoint script at [here](https://github.com/MariaDB/mariadb-docker/blob/master/11.7/docker-entrypoint.sh#L489) and the `--skip-grant-tables` option.
How to repeat
Pull the latest docker image of mariadb:
docker pull mariadb:latest
Start MariaDB Docker with `--skip-grant-tables` option:
docker run --name mariadbtest -e MYSQL_ROOT_PASSWORD=mypass -d mariadb:latest --skip_grant_tables
Check the status of mariadb docker and see the status of it to be `Exited (1)`:
docker ps -a
Check the logs of mariadb docker instance:
docker logs mariadbtest
which outputs the following log:
--------------
DROP USER IF EXISTS root@'127.0.0.1', root@'::1'
--------------
ERROR 1290 (HY000) at line 7: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
The root cause is that during the initialization of the MariaDB Docker container, the `docker-entrypoint.sh` script runs the query `DROP USER IF EXISTS root@'127.0.0.1', root@'::1'`. However, this query fails to execute when `--skip-grant-tables` is enabled. As a result, the entrypoint script of MariaDB container exits with error 1 and the MariaDB container crashes.
Suggested fix
The fix of this issue is to find an alternative way to run the [DROP command](https://github.com/MariaDB/mariadb-docker/blob/master/11.7/docker-entrypoint.sh#L489) when `--skip-grant-tables` option is used.
{"report":{"fcp":791.5,"ttfb":198.79999923706055,"pageVisibility":"visible","entityId":131914,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"0de7c0b8-9fa0-4f1a-9608-03030b4da8a9","navigationType":0,"readyForUser":870.5,"redirectCount":0,"resourceLoadedEnd":787.7999992370605,"resourceLoadedStart":204.5,"resourceTiming":[{"duration":7.59999942779541,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":204.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":204.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":212.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":8.09999942779541,"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":204.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":204.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":212.79999923706055,"responseStart":0,"secureConnectionStart":0},{"duration":67.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":204.89999961853027,"connectEnd":204.89999961853027,"connectStart":204.89999961853027,"domainLookupEnd":204.89999961853027,"domainLookupStart":204.89999961853027,"fetchStart":204.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":204.89999961853027,"responseEnd":272.79999923706055,"responseStart":272.79999923706055,"secureConnectionStart":204.89999961853027},{"duration":147.30000019073486,"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":205.19999980926514,"connectEnd":205.19999980926514,"connectStart":205.19999980926514,"domainLookupEnd":205.19999980926514,"domainLookupStart":205.19999980926514,"fetchStart":205.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":205.19999980926514,"responseEnd":352.5,"responseStart":352.5,"secureConnectionStart":205.19999980926514},{"duration":151.10000038146973,"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":205.29999923706055,"connectEnd":205.29999923706055,"connectStart":205.29999923706055,"domainLookupEnd":205.29999923706055,"domainLookupStart":205.29999923706055,"fetchStart":205.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":205.29999923706055,"responseEnd":356.3999996185303,"responseStart":356.3999996185303,"secureConnectionStart":205.29999923706055},{"duration":151.89999961853027,"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":205.5,"connectEnd":205.5,"connectStart":205.5,"domainLookupEnd":205.5,"domainLookupStart":205.5,"fetchStart":205.5,"redirectEnd":0,"redirectStart":0,"requestStart":205.5,"responseEnd":357.3999996185303,"responseStart":357.3999996185303,"secureConnectionStart":205.5},{"duration":152.0999994277954,"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":205.69999980926514,"connectEnd":205.69999980926514,"connectStart":205.69999980926514,"domainLookupEnd":205.69999980926514,"domainLookupStart":205.69999980926514,"fetchStart":205.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":205.69999980926514,"responseEnd":357.79999923706055,"responseStart":357.79999923706055,"secureConnectionStart":205.69999980926514},{"duration":209.20000076293945,"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":205.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":205.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":415,"responseStart":0,"secureConnectionStart":0},{"duration":152.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":206,"connectEnd":206,"connectStart":206,"domainLookupEnd":206,"domainLookupStart":206,"fetchStart":206,"redirectEnd":0,"redirectStart":0,"requestStart":206,"responseEnd":358.19999980926514,"responseStart":358.19999980926514,"secureConnectionStart":206},{"duration":208.89999961853027,"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":206.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":206.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":415.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":152.60000038146973,"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":206.29999923706055,"connectEnd":206.29999923706055,"connectStart":206.29999923706055,"domainLookupEnd":206.29999923706055,"domainLookupStart":206.29999923706055,"fetchStart":206.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":206.29999923706055,"responseEnd":358.8999996185303,"responseStart":358.8999996185303,"secureConnectionStart":206.29999923706055},{"duration":525.1999998092651,"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":207.39999961853027,"connectEnd":207.39999961853027,"connectStart":207.39999961853027,"domainLookupEnd":207.39999961853027,"domainLookupStart":207.39999961853027,"fetchStart":207.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":207.39999961853027,"responseEnd":732.5999994277954,"responseStart":732.5999994277954,"secureConnectionStart":207.39999961853027},{"duration":526.1999998092651,"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":207.5,"connectEnd":207.5,"connectStart":207.5,"domainLookupEnd":207.5,"domainLookupStart":207.5,"fetchStart":207.5,"redirectEnd":0,"redirectStart":0,"requestStart":207.5,"responseEnd":733.6999998092651,"responseStart":733.6999998092651,"secureConnectionStart":207.5},{"duration":66.20000076293945,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":426.29999923706055,"connectEnd":426.29999923706055,"connectStart":426.29999923706055,"domainLookupEnd":426.29999923706055,"domainLookupStart":426.29999923706055,"fetchStart":426.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":426.29999923706055,"responseEnd":492.5,"responseStart":492.5,"secureConnectionStart":426.29999923706055},{"duration":87,"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","startTime":700.7999992370605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":700.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":787.7999992370605,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":30,"responseStart":199,"responseEnd":202,"domLoading":202,"domInteractive":929,"domContentLoadedEventStart":929,"domContentLoadedEventEnd":981,"domComplete":1651,"loadEventStart":1651,"loadEventEnd":1651,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":905.2999992370605},{"name":"bigPipe.sidebar-id.end","time":906.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":906.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":908.2999992370605},{"name":"activityTabFullyLoaded","time":998.0999994277954}],"measures":[],"correlationId":"e8591be3ad911c","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":112,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Why is it important to run in --skip-grant-tables?
Even resolving the DROP USER command would still fail on creating the new user.