[debian-mysql] Bug#926231: mariadb-server-10.3: dpkg configure error - upgrade from mysql
Graham Cobb
g+debian at cobb.uk.net
Thu Apr 4 10:38:31 BST 2019
Package: mariadb-server-10.3
Version: 1:10.3.13-2
Followup-For: Bug #926231
OK, this is weird!
I tried the two options suggested by Otto. mysql_upgrade failed...
# mysql_upgrade
Version check failed. Got the following error when calling the 'mysql' command line client
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
FATAL ERROR: Upgrade failed
Restarting mariadb did something, even though it seemed to have got errors...
# systemctl restart mariadb
# systemctl status mariadb
mariadb.service - MariaDB 10.3.13 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2019-04-04 09:59:08 BST; 11s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 8417 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 8418 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 8419 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl
Process: 8499 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 8501 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 8467 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 31 (limit: 4915)
Memory: 117.7M
CGroup: /system.slice/mariadb.service
8467 /usr/sbin/mysqld
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: sys.x$wait_classes_global_by_avg_latency OK
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: sys.x$wait_classes_global_by_latency OK
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: sys.x$waits_by_host_by_latency OK
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: sys.x$waits_by_user_by_latency OK
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: sys.x$waits_global_by_latency OK
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: test
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: Phase 4/7: Running 'mysql_fix_privilege_tables'
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: ERROR 6 (HY000) at line 689: Error on delete of './performance_schema/db.opt' (Errcode: 13
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: ERROR 1007 (HY000) at line 694: Can't create database 'performance_schema'; database exists
Apr 04 09:59:12 novatech /etc/mysql/debian-start[8505]: FATAL ERROR: Upgrade failed
I then retried the dpkg --configure. This hung. Looking at the mariadb error log, I could see that it was waiting for a lock:
2019-04-04 10:07:39 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2019-04-04 10:07:39 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
So I stopped mariadb:
# systemctl stop mariadb
After that, the configure (which was still hanging in another window) completed successfully! And mariadb is started apparently without errors...
# systemctl status mariadb
mariadb.service - MariaDB 10.3.13 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-04-04 10:08:24 BST; 10min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 9167 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 9168 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 9169 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl
Process: 9249 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
Process: 9251 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 9217 (mysqld)
Status: "Taking your SQL requests now..."
Tasks: 30 (limit: 4915)
Memory: 79.0M
CGroup: /system.slice/mariadb.service
9217 /usr/sbin/mysqld
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: Phase 6/7: Checking and upgrading tables
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: Processing databases
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: information_schema
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: performance_schema
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: sys
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: sys.sys_config OK
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: test
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: Phase 7/7: Running 'FLUSH PRIVILEGES'
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9255]: OK
Apr 04 10:08:27 novatech /etc/mysql/debian-start[9294]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
However, looking at the log from mariadb service startup there are a lot of errors reported. I can make the full log available, but here are a couple of extracts...
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Phase 3/7: Fixing views
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Processing databases
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: information_schema
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: mysql
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: performance_schema
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys.host_summary
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : View 'sys.host_summary' references invalid table(s) or column(s) or function(s)
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: error : Corrupt
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys.host_summary_by_file_io OK
.
.
.
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys.memory_by_host_by_current_bytes
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : Table 'performance_schema.memory_summary_by_host_by_event_name' doesn't exist
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : View 'sys.memory_by_host_by_current_bytes' references invalid table(s) or column
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: error : Corrupt
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys.memory_by_thread_by_current_bytes
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : Table 'performance_schema.memory_summary_by_thread_by_event_name' doesn't exist
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : View 'sys.memory_by_thread_by_current_bytes' references invalid table(s) or colu
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: error : Corrupt
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys.memory_by_user_by_current_bytes
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : Table 'performance_schema.memory_summary_by_user_by_event_name' doesn't exist
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : View 'sys.memory_by_user_by_current_bytes' references invalid table(s) or column
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: error : Corrupt
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: sys.memory_global_by_current_bytes
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : Table 'performance_schema.memory_summary_global_by_event_name' doesn't exist
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: Error : View 'sys.memory_global_by_current_bytes' references invalid table(s) or column(
Apr 04 10:08:25 novatech /etc/mysql/debian-start[9255]: error : Corrupt
.
.
.
I don't know whether mariadb is actually working, as I really don't use it except that it is necessary for kde (via akonadi). Any simple test I can run?
My conclusions:
1) The package upgrade fails in the configure phase because the configure script does not do something which the mariadb service startup upgrade process does do.
2) If configure has not finished, the service startup gets fatal errors in its upgrade processing but still leaves the service running.
3) If configure is attempted again with the service running, it hangs waiting for a lock.
All these seem like bugs in the upgrade process which could do with fixing.
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (900, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_IE.utf8, LC_CTYPE=en_IE.utf8 (charmap=UTF-8) (ignored: LC_ALL set to en_IE.utf8), LANGUAGE=en_GB (charmap=UTF-8) (ignored: LC_ALL set to en_IE.utf8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages mariadb-server-10.3 depends on:
ii adduser 3.118
ii debconf [debconf-2.0] 1.5.71
ii galera-3 25.3.25-1
ii gawk 1:4.2.1+dfsg-1
ii iproute2 4.20.0-2
ii libc6 2.28-8
ii libdbi-perl 1.642-1+b1
ii libgnutls30 3.6.6-2
ii libpam0g 1.3.1-5
ii libstdc++6 8.3.0-4
ii lsb-base 10.2019031300
ii lsof 4.91+dfsg-1
ii mariadb-client-10.3 1:10.3.13-2
ii mariadb-common 1:10.3.13-2
ii mariadb-server-core-10.3 1:10.3.13-2
ii passwd 1:4.5-1.1
ii perl 5.28.1-5
ii psmisc 23.2-1
ii rsync 3.1.3-6
ii socat 1.7.3.2-2
ii zlib1g 1:1.2.11.dfsg-1
Versions of packages mariadb-server-10.3 recommends:
ii libhtml-template-perl 2.97-1
Versions of packages mariadb-server-10.3 suggests:
ii bsd-mailx [mailx] 8.1.2-0.20180807cvs-1
ii mailutils [mailx] 1:3.5-3
ii mailx 1:20081101-2
pn mariadb-test <none>
ii netcat-openbsd 1.195-2
ii tinyca 0.7.5-6
-- debconf information:
mariadb-server-10.3/nis_warning:
mariadb-server-10.3/postrm_remove_databases: false
mariadb-server-10.3/old_data_directory_saved:
More information about the pkg-mysql-maint
mailing list