#1032407 Cannot start mariadb-server unless manually mkdir -p /var/lib/mysql

Package:
mariadb-server
Source:
mariadb-server
Description:
MariaDB database server binaries
Submitter:
Thomas Goirand
Date:
2024-11-28 17:39:03 UTC
Severity:
normal
Tags:
#1032407#5
Date:
2023-03-06 08:40:33 UTC
From:
To:
Hi,

As per $subject, I had to mkdir -p /var/log/mysql to make it work. This broke
badly automation for me (ie: galera setup with puppet).

I've set severity to important, however, as the setup of other programs may
fail because of this, it probably should be RC.

Cheers,

Thomas Goirand (zigo)

#1032407#10
Date:
2023-03-06 11:03:58 UTC
From:
To:
Hi Thomas!
This seems like a normal behavior to me, at least this is what the
/etc/mysql/mariadb.conf.d/50-server.cnf says:
| # Note: The configured log file or its directory need to be created
| # and be writable by the mysql user, e.g.:
| # $ sudo mkdir -m 2750 /var/log/mysql
| # $ sudo chown mysql /var/log/mysql

Also, I am not able to reproduce this on a fresh container:
| ❯ podman run --name 1032407 --rm -d fauust/docker-systemd:debian-12
| ❯ podman exec -it 1032407 bash -c "apt-get update && apt-get install -y mariadb-server && systemctl start mariadb && systemctl status mariadb"

Can you maybe point me to the steps that makes you think that there is a
problem?

#1032407#15
Date:
2023-03-06 17:38:21 UTC
From:
To:
Hi Thomas!

As Faustin wrote, the directory missing is by itself not an error. Can
you please post the command you ran and the error message so we can
see what tools/script tries to use this directory and what error
message it outputs?

The directory was removed in
https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/27
as there has not been any known use of it for a long time.

#1032407#20
Date:
2023-03-06 22:03:26 UTC
From:
To:
Well, I did my setup with puppetlab's core mysql module to setup a galera cluster. That puppet module I maintain it in Debian. I did just the same way as I was doing in Bullseye, so something broke...

Can we revert and have the directory pre-created by the package please ? ;)

Cheers,

Thomas Goirand (zigo)

#1032407#25
Date:
2023-03-07 06:29:09 UTC
From:
To:
We can consider it but we would need some evidence of what is broken
exactly to justify reverting
https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/27
by MichaIng

#1032407#30
Date:
2023-03-07 14:48:29 UTC
From:
To:
The Puppet module requires an update:
https://github.com/search?q=repo%3Apuppetlabs%2Fpuppetlabs-mysql%20%2Fvar%2Flog&type=code

One option would be to make it create and chown the directory by itself,
if plain text logs are for some reason needed/wanted.

The probably cleaner option would be if it did not touch the log file
option at all (same for PID file) to use the package/server defaults,
which are to log to STDOUT => systemd journal since Bullseye.

Best regards,

Micha

#1032407#35
Date:
2023-03-25 23:26:36 UTC
From:
To:
Hi!

Are you doing an update in Puppet for this?

So far we have only one report about this from one user (albeit the
Debian maintainer of an important package) so I don't feel confident
in reverting https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/27
just yet.

#1032407#40
Date:
2023-03-26 01:21:59 UTC
From:
To:
Who do you mean? Should be reported here by OP who faced the issue:
https://github.com/puppetlabs/puppetlabs-mysql/issues

Only the Puppet MySQL module developers will know whether they need
plain text logging for some specific reason and how to hence address
this best.

Bookworm (and hence this change) is in "testing" now, in hard freeze
stage of the upcoming Debian release. So a pretty perfect time for
testing and reporting issues as of changes like this to software
developers to update their software. And optionally to make it more
compatible in the same turn by not relying on the existence of
explicitly configured directories ;).

#1032407#47
Date:
2023-05-14 15:47:35 UTC
From:
To:
After hitting this bug when upgrading a MariaDB server to bookworm, I
submitted a bug report upstream:

https://github.com/puppetlabs/puppetlabs-mysql/issues/1566