[MDEV-27823] mariadb-install-db --group fails Created: 2022-02-13 Updated: 2022-03-01 Resolved: 2022-03-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.6.7, 10.7.3, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7 |
| Fix Version/s: | 10.2.44, 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Brad Smith | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Environment: |
OpenBSD |
||
| Issue Links: |
|
||||
| Description |
|
Trying to update our package to 10.6.7 from 10.6.5 I noticed this new odd error when testing out mariadb-install-db.
|
| Comments |
| Comment by Elena Stepanova [ 2022-02-13 ] | |||||||||||||||||||
|
What do you have in the cnf file(s)? Is it reproducible if you run with --no-defaults? | |||||||||||||||||||
| Comment by Brad Smith [ 2022-02-20 ] | |||||||||||||||||||
|
Nothing special in the default minimal config file that is installed.
Yes, it is still reproducible with --no-defaults. That definitely won't be useful when it comes to trying to reproduce the issue. I can provide you with an account on one of my build systems if you want to take a look around. | |||||||||||||||||||
| Comment by Elena Stepanova [ 2022-02-20 ] | |||||||||||||||||||
|
> I can provide you with an account on one of my build systems if you want to take a look around | |||||||||||||||||||
| Comment by Elena Stepanova [ 2022-02-22 ] | |||||||||||||||||||
|
With the provided access, I was able to figure why the problem occurs. It is a regression indeed. The patch below introduced the usage of "group" option to mysql_install_db
If the value is set, the script uses it in chown operations, but it also adds it to the bootstrap command line, like it did before for user value, as in --group=<value>. However, there is no such option as group for mariadbd, so instead it takes it as a prefix of --group-concat-max-len. By sheer luck, in standard MariaDB installations the value would be either none or mysql. If mysql is provided, it is treated as M suffix, thus the value becomes 0m and then adjusted to 4 (with warnings, but the warnings would be usually silenced). However, OpenBSD uses group/user _mysql, not mysql, and it even sets it in the modified version of mariadb-install-db by default, so it's always there. The underscore is not a valid suffix for a numeric option, so the server cannot parse the presumed group-concat-max-len value and fails to start.
The probable fix is not to add the --group option to the server command line, but instead only use it for ownership operations. | |||||||||||||||||||
| Comment by Brad Smith [ 2022-02-22 ] | |||||||||||||||||||
|
Thank you for looking into this. OpenBSD has had a very minimal patch for group handling which I re-based on that commit, but all it was was just the command-line handling for --group passed to mariadb-install-db and changing the chown operation. | |||||||||||||||||||
| Comment by Elena Stepanova [ 2022-02-22 ] | |||||||||||||||||||
|
Right. While I didn't try it in your environment, I think you should be able to work around the problem by dropping this part from the script
| |||||||||||||||||||
| Comment by Brad Smith [ 2022-02-22 ] | |||||||||||||||||||
|
It looks like that piece as well as the line..
That was added to mysqld_safe.sh which should be removed. At the moment it does nothing since the shell script was not changed further down where USER_OPTION is handled. | |||||||||||||||||||
| Comment by Michael Widenius [ 2022-03-01 ] | |||||||||||||||||||
|
I have now removed sending the --group option to the server. | |||||||||||||||||||
| Comment by Michael Widenius [ 2022-03-01 ] | |||||||||||||||||||
|
Bug fix was trivial, most time spent on reading up and discussions |