0

I have debian 8.0 with backports and the official mariadb repositories are set up. I already had mariadb-server-10.1 and it was trying to upgrade to an other version. The upgrade of mariadb failed and now it is broken. I can not use owncloud anymore. The other service using mysql is wordpress but it works without issues.

When I want to upgrade mariadb: I got this message:

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mariadb-server-10.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.1 (= 10.1.22+maria-1~jessie); however:
  Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

systemctl status mariadb.service gives:

Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Plugin 'Aria' init function returned error.
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [Note] Plugin 'FEEDBACK' is disabled.
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Unknown/unsupported storage engine: InnoDB
Apr 22 14:01:56 ctl mysqld[10359]: 2017-04-22 14:01:56 139845057845504 [ERROR] Aborting
Apr 22 14:01:57 ctl systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Apr 22 14:01:57 ctl systemd[1]: Failed to start MariaDB database server.
Apr 22 14:01:57 ctl systemd[1]: mariadb.service: Unit entered failed state.
Apr 22 14:01:57 ctl systemd[1]: mariadb.service: Failed with result 'exit-code'.

an journalctl -xe gives:

Apr 22 15:05:25 ctl sshd[10944]: Received disconnect from 61.177.172.60: 11:  [preauth]
Apr 22 15:05:25 ctl sshd[10944]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.177.172.60  user=root
Apr 22 15:06:12 ctl sshd[10946]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=61.177.172.60  user
Apr 22 15:06:14 ctl sshd[10946]: Failed password for root from 61.177.172.60 port 51871 ssh2
Apr 22 15:06:17 ctl sshd[10946]: Failed password for root from 61.177.172.60 port 51871 ssh2
Apr 22 15:06:20 ctl sshd[10946]: Failed password for root from 61.177.172.60 port 51871 ssh2
Apr 22 15:06:21 ctl sshd[10946]: Received disconnect from 61.177.172.60: 11:  [preauth]

Output of ps aux | grep mysql is:

tchokap+ 11212 0.0 0.0 12728 2208 pts/0 S+ 15:31 0:00 
grep mysql root 16860 0.0 0.0 40540 3196 ? S Feb01 0:00 
sudo mysqld --binlog_format=MIXED mysql 16861 0.0 8.2 1064928 333048 ? Sl Feb01 103:34 
mysqld --binlog_format=MIXED

I think the journal ctl refers to an other issue that my server is unable to resolve host ctl.

iwaseatenbyagrue
  • 3,688
  • 15
  • 24
Etienne
  • 3
  • 1
  • 4
  • Is there already some form of a mariadb / mysqld running? If not, why are its files locked? (That's what the cut off message appears to be saying...?) – Håkan Lindqvist Apr 22 '17 at 13:21
  • How can I check it specifically for mysqld? Mariadb server status is down. But I have wordpress working thus it should be using mysqld, shouldn't it? – Etienne Apr 22 '17 at 13:26
  • The output of `ps aux | grep mysql` is `tchokap+ 11212 0.0 0.0 12728 2208 pts/0 S+ 15:31 0:00 grep mysql root 16860 0.0 0.0 40540 3196 ? S Feb01 0:00 sudo mysqld --binlog_format=MIXED mysql 16861 0.0 8.2 1064928 333048 ? Sl Feb01 103:34 mysqld --binlog_format=MIXED` – Etienne Apr 22 '17 at 13:34

2 Answers2

2

It looks like you, for whatever reason, started mariadb manually using the command sudo mysqld --binlog_format=MIXED on February 1st.

Invoking mysqld directly instead of starting it through the init system (systemd in this case) is why things are in a weird state now.

The upgrade process assumed it could ask the init system to stop mariadb and then do the upgrade, but you have a mysqld instance that the init system knows nothing about.

Hence why there's a still a mysqld running despite the status being "down".

You should make sure the setting you provided on the command line (binlog_format=MIXED) is in the configuration file (my.cnf), stop your manually started mysqld and then try again.

Håkan Lindqvist
  • 35,011
  • 5
  • 69
  • 94
  • It is not in `my.cnf`. What do I have to do? – Etienne Apr 22 '17 at 14:41
  • @EtienneBorocco Presumably you added that command line argument when you started `mysqld` because you needed that setting? If so, add it to `my.cnf` (in the `[mysqld]` section). – Håkan Lindqvist Apr 22 '17 at 14:47
  • I did `service mysqld stop`. I did `dist-upgrade` and `systemctl status mariadb.service` gave this: `ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)` – Etienne Apr 22 '17 at 15:36
  • That's kind of the point I was making, `service mysqld stop` won't stop something that you started entirely manually on the side like that. – Håkan Lindqvist Apr 22 '17 at 16:01
  • How can I stop it? I don't understand. – Etienne Apr 22 '17 at 16:13
  • I did `killall mysqld` and it works. – Etienne Apr 22 '17 at 16:21
0

In my case was the mysqld_safe process which was restarting the mysqld each time I killed it.

Do a ps aux | grep mysqld

Take the PID of each process (the second column)

Run a kill -s 9 PID for each process (you can write more than one PID separating they by one space.

After that, try to run another time the apt-get upgrade or apt-get dist-upgrade

NetVicious
  • 462
  • 5
  • 17