[MDEV-17590] installation problem: mariadb service does not recognize that the server has been started Created: 2018-11-01  Updated: 2018-12-07  Resolved: 2018-12-07

Status: Closed
Project: MariaDB Server
Component/s: Configuration, Packaging, Platform Debian
Affects Version/s: 10.1.26, 10.3.10
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: MadEmpire Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: debian9, need_feedback, socket
Environment:

debian 9, v Server


Attachments: File log.7z    

 Description   

We can not install mariadb or any other mysql version. We tried >20 times to install mariadb with a clear debian 9 img from our webhoster zap-hosting.com. It works fine with debian 8.
Error description:
Problem: since Sunday 28.10.2018 afternoon

  • mysql socket not found and could not be started
  • Generally different service crashed (may be a other problem sincce we installed new packages)
    mysql still does not work->
    Overview:
  • with debian 8 the installation goes through
  • when installing debian 9 the error message (> 20 times tried with zap-hosting Debian 9 img without other components to install) we get this error:
  • https://gyazo.com/5f6830907b3a97e7f0810b151a7eb4d6
  • try to start: Can not connect to the local MySQL server via the socket '/var/run/mysqld/mysqld.sock' (2).
  • the socket is not there either
  • Updated repository or inserted new source
    mariadb / mysql debian 9 Source tried -> failed

Our Linux version is:
Linux 12505 4.15.18-1-pve # 1 SMP PVE 4.15.18-17 (Mon, Jul 30, 2018 12:53:35 +0200) x86_64
or.
Linux version 4.15.18-1-pve (build @ pve) (gcc version 6.3.0 20170516 (Debian 6.3.0-18 + deb9u1)) # 1 SMP PVE 4.15.18-17 (Mon, 30 Jul 2018 12:53 : 35 +0200)



 Comments   
Comment by Elena Stepanova [ 2018-11-01 ]

It appears that you are installing a mix of Debian's MariaDB packages (10.1.26-0+deb9u1) and MariaDB's packages (1:10.3.10+maria~stretch). Unfortunately, it's an unsupported combination, here is a comment from official Debian maintenance.

Could you please try to install either one or another and check if it works?
To install Debian's 10.1 packages, it should be enough to remove MariaDB repo from the apt list. To install MariaDB's 10.3 packages, you'll probably need to do some pinning. Here is some basic information about it in the MariaDB KB, but quite possibly there are better ways to do it.

Comment by MadEmpire [ 2018-11-01 ]

Hey we already tried this and treid it now again. There is no mariadb repo in the apt list:
Here is the installation process

root@12505:~# apt install mariadb-server-10.1 mariadb-client-10.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
galera-3 gawk libcgi-fast-perl libcgi-pm-perl libdbd-mysql-perl
libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl
libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl
liblwp-mediatypes-perl libmariadbclient18 libsigsegv2 libtimedate-perl
liburi-perl mariadb-client-core-10.1 mariadb-common mariadb-server-core-10.1
mysql-common psmisc rsync socat
Suggested packages:
gawk-doc libdata-dump-perl libipc-sharedcache-perl libwww-perl mailx
mariadb-test netcat-openbsd tinyca
The following NEW packages will be installed:
galera-3 gawk libcgi-fast-perl libcgi-pm-perl libdbd-mysql-perl
libencode-locale-perl libfcgi-perl libhtml-parser-perl libhtml-tagset-perl
libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl
liblwp-mediatypes-perl libmariadbclient18 libsigsegv2 libtimedate-perl
liburi-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common
mariadb-server-10.1 mariadb-server-core-10.1 mysql-common psmisc rsync socat
0 upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
Need to get 393 kB/25.5 MB of archives.
After this operation, 191 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ftp.debian.org/debian stretch/main amd64 rsync amd64 3.1.2-1+deb9u1 [393 kB]
Fetched 393 kB in 0s (3508 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libsigsegv2:amd64.
(Reading database ... 20536 files and directories currently installed.)
Preparing to unpack .../libsigsegv2_2.10-5_amd64.deb ...
Unpacking libsigsegv2:amd64 (2.10-5) ...
Setting up libsigsegv2:amd64 (2.10-5) ...
Selecting previously unselected package gawk.
(Reading database ... 20546 files and directories currently installed.)
Preparing to unpack .../0-gawk_1%3a4.1.4+dfsg-1_amd64.deb ...
Unpacking gawk (1:4.1.4+dfsg-1) ...
Selecting previously unselected package mysql-common.
Preparing to unpack .../1-mysql-common_5.8+1.0.2_all.deb ...
Unpacking mysql-common (5.8+1.0.2) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../2-mariadb-common_10.1.26-0+deb9u1_all.deb ...
Unpacking mariadb-common (10.1.26-0+deb9u1) ...
Selecting previously unselected package galera-3.
Preparing to unpack .../3-galera-3_25.3.19-2_amd64.deb ...
Unpacking galera-3 (25.3.19-2) ...
Selecting previously unselected package mariadb-client-core-10.1.
Preparing to unpack .../4-mariadb-client-core-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-client-core-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package mariadb-client-10.1.
Preparing to unpack .../5-mariadb-client-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-client-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package mariadb-server-core-10.1.
Preparing to unpack .../6-mariadb-server-core-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-server-core-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package psmisc.
Preparing to unpack .../7-psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Selecting previously unselected package rsync.
Preparing to unpack .../8-rsync_3.1.2-1+deb9u1_amd64.deb ...
Unpacking rsync (3.1.2-1+deb9u1) ...
Selecting previously unselected package socat.
Preparing to unpack .../9-socat_1.7.3.1-2+deb9u1_amd64.deb ...
Unpacking socat (1.7.3.1-2+deb9u1) ...
Setting up mysql-common (5.8+1.0.2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-common (10.1.26-0+deb9u1) ...
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mariadb-server-10.1.
(Reading database ... 20995 files and directories currently installed.)
Preparing to unpack .../00-mariadb-server-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-server-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package libhtml-tagset-perl.
Preparing to unpack .../01-libhtml-tagset-perl_3.20-3_all.deb ...
Unpacking libhtml-tagset-perl (3.20-3) ...
Selecting previously unselected package liburi-perl.
Preparing to unpack .../02-liburi-perl_1.71-1_all.deb ...
Unpacking liburi-perl (1.71-1) ...
Selecting previously unselected package libhtml-parser-perl.
Preparing to unpack .../03-libhtml-parser-perl_3.72-3_amd64.deb ...
Unpacking libhtml-parser-perl (3.72-3) ...
Selecting previously unselected package libcgi-pm-perl.
Preparing to unpack .../04-libcgi-pm-perl_4.35-1_all.deb ...
Unpacking libcgi-pm-perl (4.35-1) ...
Selecting previously unselected package libfcgi-perl.
Preparing to unpack .../05-libfcgi-perl_0.78-2_amd64.deb ...
Unpacking libfcgi-perl (0.78-2) ...
Selecting previously unselected package libcgi-fast-perl.
Preparing to unpack .../06-libcgi-fast-perl_1%3a2.12-1_all.deb ...
Unpacking libcgi-fast-perl (1:2.12-1) ...
Selecting previously unselected package libmariadbclient18:amd64.
Preparing to unpack .../07-libmariadbclient18_10.1.26-0+deb9u1_amd64.deb ...
Unpacking libmariadbclient18:amd64 (10.1.26-0+deb9u1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../08-libdbd-mysql-perl_4.041-2_amd64.deb ...
Unpacking libdbd-mysql-perl (4.041-2) ...
Selecting previously unselected package libencode-locale-perl.
Preparing to unpack .../09-libencode-locale-perl_1.05-1_all.deb ...
Unpacking libencode-locale-perl (1.05-1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../10-libhtml-template-perl_2.95-2_all.deb ...
Unpacking libhtml-template-perl (2.95-2) ...
Selecting previously unselected package libtimedate-perl.
Preparing to unpack .../11-libtimedate-perl_2.3000-2_all.deb ...
Unpacking libtimedate-perl (2.3000-2) ...
Selecting previously unselected package libhttp-date-perl.
Preparing to unpack .../12-libhttp-date-perl_6.02-1_all.deb ...
Unpacking libhttp-date-perl (6.02-1) ...
Selecting previously unselected package libio-html-perl.
Preparing to unpack .../13-libio-html-perl_1.001-1_all.deb ...
Unpacking libio-html-perl (1.001-1) ...
Selecting previously unselected package liblwp-mediatypes-perl.
Preparing to unpack .../14-liblwp-mediatypes-perl_6.02-1_all.deb ...
Unpacking liblwp-mediatypes-perl (6.02-1) ...
Selecting previously unselected package libhttp-message-perl.
Preparing to unpack .../15-libhttp-message-perl_6.11-1_all.deb ...
Unpacking libhttp-message-perl (6.11-1) ...
Setting up libhtml-tagset-perl (3.20-3) ...
Setting up mariadb-server-core-10.1 (10.1.26-0+deb9u1) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libencode-locale-perl (1.05-1) ...
Setting up libtimedate-perl (2.3000-2) ...
Setting up socat (1.7.3.1-2+deb9u1) ...
Setting up mariadb-client-core-10.1 (10.1.26-0+deb9u1) ...
Setting up libio-html-perl (1.001-1) ...
Setting up libmariadbclient18:amd64 (10.1.26-0+deb9u1) ...
Setting up gawk (1:4.1.4+dfsg-1) ...
Setting up rsync (3.1.2-1+deb9u1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/rsync.service -> /lib/systemd/system/rsync.service.
Setting up liblwp-mediatypes-perl (6.02-1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up galera-3 (25.3.19-2) ...
Setting up liburi-perl (1.71-1) ...
Processing triggers for systemd (232-25+deb9u4) ...
Setting up libhtml-parser-perl (3.72-3) ...
Setting up libcgi-pm-perl (4.35-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libdbd-mysql-perl (4.041-2) ...
Setting up libfcgi-perl (0.78-2) ...
Setting up mariadb-client-10.1 (10.1.26-0+deb9u1) ...
Setting up libhttp-date-perl (6.02-1) ...
Setting up libhtml-template-perl (2.95-2) ...
Setting up libcgi-fast-perl (1:2.12-1) ...
Setting up libhttp-message-perl (6.11-1) ...
Setting up mariadb-server-10.1 (10.1.26-0+deb9u1) ...
Created symlink /etc/systemd/system/mysql.service -> /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service -> /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service -> /lib/systemd/system/mariadb.service.
Job for mariadb.service failed because a timeout was exceeded.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
mariadb.service couldn't start.
Processing triggers for systemd (232-25+deb9u4) ...
root@12505:~# systemctl status mariadb.service

  • mariadb.service - MariaDB database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset:
    Active: failed (Result: timeout) since Thu 2018-11-01 15:28:17 UTC; 37s ago
    Main PID: 15338 (code=exited, status=0/SUCCESS)

Nov 01 15:26:39 12505 systemd[1]: Starting MariaDB database server...
Nov 01 15:26:43 12505 mysqld[15338]: 2018-11-01 15:26:43 140530577130048 [Note]
Nov 01 15:28:12 12505 systemd[1]: mariadb.service: Start operation timed out. Te
Nov 01 15:28:17 12505 systemd[1]: Failed to start MariaDB database server.
Nov 01 15:28:17 12505 systemd[1]: mariadb.service: Unit entered failed state.
Nov 01 15:28:17 12505 systemd[1]: mariadb.service: Failed with result 'timeout'.
lines 1-11/11 (END)

Comment by Elena Stepanova [ 2018-11-01 ]

Thanks. And can you now provide the portion of syslog related to this unsuccessful attempt?
In the archive that you attached, I only found the part about 10.3 installation, it fails to start with this:

Oct 30 17:12:26 12505 mysqld: 2018-10-30 17:12:26 0 [ERROR] InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10.2.2, and it appears corrupted.
Oct 30 17:12:26 12505 mysqld: 2018-10-30 17:12:26 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption

But the problem for 10.1 should be different, so we need to see what it is.

Comment by MadEmpire [ 2018-11-01 ]

I uploaded the new log files, they should be attached.

Comment by Elena Stepanova [ 2018-11-01 ]

Thanks. So indeed, 10.1 problem is different. 10.1.26 server starts just fine (as we can see in error.log), waits for 90 seconds and then gets shut down gracefully, at the same time when the service reports a timeout. It doesn't complain about any problems with socket creation. Unfortunately, I can't find in the last archive errors from mysqladmin or whatever other tool fails to connect to the server, but the timeout obviously occurs. Maybe 10.1 is just less verbose.

When you said in the description "mysql socket not found and could not be started", did you mean that you checked for the existence of the socket manually, or is it the interpretation of mysqladmin complaining that it couldn't connect to the server via the socket? And If you did check for the existence of the socket, did you do it while the service was still "waiting" for the server to start? Because the socket would only exist during those 90 seconds while the service is waiting, as soon as the server shuts down cleanly, the socket file is removed.

We did have one complaint from a user very long time ago about a socket file magically disappearing on their machine while the server was running, the reason for this has never been found. The suspicion was that the problem was environmental (if it was indeed happening at all), since nobody else ever reported it. It was something like CentOS, though.

However, assuming that the socket is all right, the most likely reason of the problem is a mix up of authentication methods. Packages provided by Debian use unix_socket as a default authentication method for the local root, and thus their scripts assume that mysqladmin etc. will have a passwordless access to the server as long as they are run under root. On the other hand, MariaDB's packages use a special user/password configured in debian.conf for the tools, and also invite the user to create a password for the local root upon installation. When these two approaches collide, e.g. a database created by one is attempted to be used by another, or scripts/configs from them get mixed up, bad things happen. I saw that you did purge before installing, but still, given how strange debian packaging happens to be, I wouldn't rule out some garbage remaining there. One approach which should probably help to check it is adding skip-grant-tables to the server config file temporarily. Hopefully it will allow the service to start, and then you can connect to the server and inspect mysql.user table (important columns would be user, host, password, authentication_string) to see what's there.

Comment by MadEmpire [ 2018-11-01 ]

The error message occured and then i checked the folder and there was no socket. I checked this directly after the installation and the error message.
I tested it again and now its the first time i cant purge/remove mysql or mariadb anyway i installed the img again and installed mariadb.
There is no socket and no folder created after the installation in var. I also set up a completly new debian 9 version between every step or new installation of mariadb.
I also used autoremove and deleted the config files etc. manuelly.
I will try it with your skip-grant-table solution later and if it works post the mysql.user table. If this all does not work i will just use a other linux version or ask my hoster just to delete my v server and make a new one, maybe its a problem of the server environment in combination with debian 9, i read something like this at stackoverflow. But i also got different error like that the socket is missing and now that it just failed to start.

Comment by MadEmpire [ 2018-11-01 ]

if you want to test it yourself i can just tell you our root pw. I could also install a clean version of debian 9 from our web hoster.

Comment by Elena Stepanova [ 2018-11-01 ]

Yes, sure, it might go faster if I have access to the box in question. I could take a look at your current (failing) installation, maybe there will be no need to re-install Debian. You can send me the password by email, or just add my ssh key to the authorized list.

Comment by Elena Stepanova [ 2018-11-02 ]

I've spent some time digging into the machine in question.

First of all, there is no problem with socket or server startup – server starts just fine, the socket gets created normally, the server is accessible via the socket until the service timeout (90 sec by default) occurs and the server gets shut down.

Secondly, there was indeed a mix of different installations when I reached the machine, but it's unrelated to the main problem. Even after I cleaned up the mix and got a totally clean 10.1.26 (or 10.3.10) installation, the problem persisted.

The problem happens upon service startup (not server, but service). MariaDB service has Type=notify. According to systemd documentation, it means that

the daemon sends a notification message via sd_notify(3) or an equivalent call when it has finished starting up

.

It appears to be indeed the culprit. If I change the Type to simple, everything works file.

Further, I noticed these errors in the system logs. They don't show up in system logs every time, I'm not sure how audit logging occurs, maybe there is some throttling. But they seem to be related.

kernel: [1736989.458558] audit: type=1400 audit(1541186503.700:8086): apparmor="DENIED" operation="sendmsg" profile="/usr/sbin/mysqld" name="/run/systemd/noti
fy" pid=28557 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=109 ouid=0

Oddly, the machine doesn't have apparmor installed, but there are some pieces which might indicate an inconsistent state, e.g. /sys/module/apparmor/parameters/mode shows enforce, etc. I tried to re-install/uninstall apparmor, but it didn't help. Possibly it requires some changes in system startup configuration, or at least system restart.

Finally, I tried the exact same installation (same MariaDB version from the same repo) on our Stretch VM, and it works fine (We don't have VServer though). The difference is that we don't have those pieces of apparmor suggesting that it could have been enabled at some point, so again, it indirectly confirms the theory. Also, since the year-old 10.1.26 packages built by Debian and new 10.3.10 packages built by MariaDB hit the exact same problem, and according to you, it only started happening recently, it's extremely unlikely that the problem is on the server packaging side. Far more likely is that the environment changed somehow.

I suggest that you try to figure out

  • what changed on Sept 28th, when according to the description the problems started;
  • check if there are any known issues with apparmor/VServer, in general and specifically in regard to 'notify'. Maybe a recent system upgrade brought something;
  • try to install system so that there are no garbage from apparmor at all, and see if it helps;
  • ask on public mailing lists whether anyone experienced similar issues with similar configuration.

We'll be waiting for news from you, as it might be useful for other community users.

Comment by MadEmpire [ 2018-11-05 ]

First of all, thank you for your great help We reported the problems to our Webhoster and zap hosting will create a new virtual server for us. I will give the task to find the problem to our Webhoster. If i have news about this i will post them here and again thank you for your help.

Comment by Elena Stepanova [ 2018-12-07 ]

I will close it for now. Please comment if you have further evidence that it's a MariaDB bug.

Generated at Thu Feb 08 08:37:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.