package mysql-server-5.6 5.6.19-0ubuntu0.14.04.1 [modified: usr/share/mysql/errmsg-utf8.txt] failed to install/upgrade: Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück

Asked by Gerrit Addiks on 2015-10-07

I just tried to install mysql-server-5.6, it asked for root-password twice and then said it could not set the root password, then dpkg failed to start mysql (invoke-rc.d: initscript mysql, action "start" failed.). Now apt wants to finish the broken mysql-installation everytime i try to use it. When i try to start the mysql server manually (sudo service mysql start), it gives me "start: Job failed to start" and nothing else.

ProblemType: Package
DistroRelease: Ubuntu 14.04
Package: mysql-server-5.6 5.6.19-0ubuntu0.14.04.1 [modified: usr/share/mysql/errmsg-utf8.txt]
Uname: Linux 3.19.8-031908-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.14.1-0ubuntu3.15
Architecture: amd64
Date: Wed Oct 7 11:10:01 2015
DuplicateSignature: package:mysql-server-5.6:5.6.19-0ubuntu0.14.04.1 [modified: usr/share/mysql/errmsg-utf8.txt]:Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
ErrorMessage: Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
InstallationDate: Installed on 2014-02-20 (593 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
RelatedPackageVersions:
 dpkg 1.17.5ubuntu5.4
 apt 1.0.1ubuntu2.10
SourcePackage: mysql-5.6
SystemImageInfo: Error: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'system-image-cli'
Title: package mysql-server-5.6 5.6.19-0ubuntu0.14.04.1 [modified: usr/share/mysql/errmsg-utf8.txt] failed to install/upgrade: Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
UpgradeStatus: Upgraded to trusty on 2014-02-21 (592 days ago)

Question information

RansomStark (ransomstark) said : #1

Not a bug, more of an installation support issue.

RansomStark (ransomstark) said : #2

Have you attempted to remove --purge mysql and then reinstall? Take care to backup any databases before attempting this.

Gerrit Addiks (addiks) said : #3

Yes, i have tried to purge and reinstall all mysql-server related packages multiple times now, but it just fails everytime.

I also have discovered in the meantime that even if it failed to install and i cannot start mysqld using "sudo service mysql start", i can actually start mysqld using "/etc/init.d/mysql" but get some warnings on the way:

gerrit@gerrit:~$ sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
gerrit@gerrit:~$ ps -A | grep mysql
 6410 pts/28 00:00:00 mysql
gerrit@gerrit:~$ sudo /etc/init.d/mysql restart
 * Stopping MySQL database server mysqld [ OK ]
 * /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz
 * Starting MySQL database server mysqld No directory, logging in with HOME=/
                                                                                                                           [ OK ]
 * Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
gerrit@gerrit:~$ ps -A | grep mysql
 6410 pts/28 00:00:00 mysql
13243 ? 00:00:00 mysqld_safe
13308 ? 00:00:00 mysqld
gerrit@gerrit:~$ ll /etc/mysql/
insgesamt 28
drwxr-xr-x 3 root root 4096 Okt 13 09:45 ./
drwxr-xr-x 185 root root 12288 Okt 14 10:32 ../
drwxr-xr-x 2 root root 4096 Okt 13 09:45 conf.d/
-rw------- 1 root root 333 Okt 7 17:03 debian.cnf
-rwxr-xr-x 1 root root 1220 Aug 6 2014 debian-start*
gerrit@gerrit:~$

Manfred Hampl (m-hampl) said : #4

What is the output of the commands

uname -a
lsb_release -crid
dpkg -l | grep mysql

Gerrit Addiks (addiks) said : #5

gerrit@gerrit:~$ uname -a
Linux gerrit 3.19.8-031908-generic #201505110938 SMP Mon May 11 13:39:59 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
gerrit@gerrit:~$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
gerrit@gerrit:~$ dpkg -l | grep mysql
ii libdbd-mysql-perl 4.025-1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient18:amd64 5.6.23-1ubuntu14.04 amd64 MySQL shared client libraries
ii libmysqlclient18:i386 5.6.23-1ubuntu14.04 i386 MySQL shared client libraries
ii libmysqlcppconn7 1.1.3-5 amd64 MySQL Connector for C++ (library)
ii libqt4-sql-mysql:i386 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 i386 Qt 4 MySQL database driver
rc mysql-apt-config 0.3.3-1ubuntu14.04 all Auto configuration for MySQL APT Repo.
ii mysql-client-5.6 5.6.19-0ubuntu0.14.04.1 amd64 MySQL database client binaries
ii mysql-client-core-5.6 5.6.19-0ubuntu0.14.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.6.23-1ubuntu14.04 amd64 MySQL Common
ii mysql-common-5.6 5.6.19-0ubuntu0.14.04.1 all MySQL 5.6 specific common files, e.g. /etc/mysql/conf.d/my-5.6.cnf
iF mysql-server-5.6 5.6.19-0ubuntu0.14.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.6 5.6.19-0ubuntu0.14.04.1 amd64 MySQL database server binaries
ii mysql-utilities 1.3.5-2 all collection of scripts for managing MySQL servers
rc mysql-workbench 6.0.8+dfsg-2 amd64 MySQL Workbench - a visual database modeling, administration and queuing tool
ii mysql-workbench-community 6.2.5-1ubu1404 amd64 MySQL Workbench
ii mysql-workbench-data 6.0.8+dfsg-2 all MySQL Workbench -- architecture independent data
ii php5-mysql 5.5.9+dfsg-1ubuntu4.13 amd64 MySQL module for php5
ii python-mysql.connector 1.1.6-1 all pure Python implementation of MySQL Client/Server protocol
gerrit@gerrit:~$

Manfred Hampl (m-hampl) said : #6

The line "iF mysql-server-5.6 5.6.19-0ubuntu0.14.04.1 ..." shows that the mysql-server-5.6 package is not correctly installed. It does not make sense to try starting MySQL before the installation is completed.

What is the output of the commands

sudo dpkg --audit
sudo dpkg --configure -a

Gerrit Addiks (addiks) said : #7

gerrit@gerrit:~$ sudo LANG=EN dpkg --audit
The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 mysql-server-5.6 MySQL database server binaries and system database setup

gerrit@gerrit:~$ sudo LANG=EN dpkg --configure -a
Setting up mysql-server-5.6 (5.6.19-0ubuntu0.14.04.1) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
2015-10-15 09:46:42 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-15 09:46:42 5159 [Warning] Using pre 5.5 semantics to load error messages from /usr/share/mysql/.
2015-10-15 09:46:42 5159 [Warning] If this is not intended, refer to the documentation for valid usage of --lc-messages-dir and --language parameters.
2015-10-15 09:46:42 5159 [Note] Plugin 'FEDERATED' is disabled.
2015-10-15 09:46:42 5159 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-15 09:46:42 5159 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-15 09:46:42 5159 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-15 09:46:42 5159 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-10-15 09:46:42 5159 [Note] InnoDB: Using Linux native AIO
2015-10-15 09:46:42 5159 [Note] InnoDB: Using CPU crc32 instructions
2015-10-15 09:46:42 5159 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-15 09:46:42 5159 [Note] InnoDB: Completed initialization of buffer pool
2015-10-15 09:46:42 5159 [Note] InnoDB: Highest supported file format is Barracuda.
2015-10-15 09:46:42 5159 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-15 09:46:42 5159 [Note] InnoDB: Waiting for purge to start
2015-10-15 09:46:42 5159 [Note] InnoDB: 5.6.19 started; log sequence number 1360815734
2015-10-15 09:46:42 5159 [Note] Binlog end
2015-10-15 09:46:42 5159 [Note] InnoDB: FTS optimize thread exiting.
2015-10-15 09:46:42 5159 [Note] InnoDB: Starting shutdown...
2015-10-15 09:46:44 5159 [Note] InnoDB: Shutdown completed; log sequence number 1360815744
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.6
gerrit@gerrit:~$

Gerrit Addiks (addiks) said : #8

My guess would be that dpkg tries to start mysqld using "sudo service mysql start", which fails for whatever reason which then causes the installation to cancel in broken state. I am able to start mysqld using "sudo /etc/init.d/mysql start" though, which could imply that the problem lies with the 'service' command starting mysqld the wrong way.

Manfred Hampl (m-hampl) said : #9

What output do you get for

sudo invoke-rc.d mysql start

DEBIAN_SCRIPT_DEBUG=1 LANG=C sudo dpkg --configure -a

Gerrit Addiks (addiks) said : #10

gerrit@gerrit:~$ sudo LANG=EN invoke-rc.d mysql start
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
gerrit@gerrit:~$ DEBIAN_SCRIPT_DEBUG=1 LANG=C sudo dpkg --configure -a
Setting up mysql-server-5.6 (5.6.19-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.6
gerrit@gerrit:~$

Manfred Hampl (m-hampl) said : #11

What is the output of

sudo bash -x /usr/sbin/invoke-rc.d mysql start

(hide passwords in case they are shown in the output).

Gerrit Addiks (addiks) said : #12

gerrit@gerrit:~$ sudo bash -x /usr/sbin/invoke-rc.d mysql start
[sudo] password for gerrit:
+ RUNLEVELHELPER=/sbin/runlevel
+ POLICYHELPER=/usr/sbin/policy-rc.d
+ INITDPREFIX=/etc/init.d/
+ UPSTARTDIR=/etc/init/
+ RCDPREFIX=/etc/rc
+ BEQUIET=
+ MODE=
+ ACTION=
+ FALLBACK=
+ NOFALLBACK=
+ FORCE=
+ RETRY=
+ RETURNFAILURE=
+ RC=
+ is_upstart=
+ set +e
+ test 2 -eq 0
+ state=I
+ test 2 -gt 0
+ test I '!=' III
+ case "$1" in
+ case ${state} in
+ verifyparameter mysql
+ test 1 -eq 0
+ test 1 -ne 1
+ return
+ INITSCRIPTID=mysql
+ state=II
+ shift
+ test 1 -gt 0
+ test II '!=' III
+ case "$1" in
+ case ${state} in
+ verifyparameter start
+ test 1 -eq 0
+ test 1 -ne 1
+ return
+ ACTION=start
+ state=III
+ shift
+ test 0 -gt 0
+ test III '!=' III
+ case ${ACTION} in
+ which initctl
+ initctl version
+ grep -q upstart
+ '[' -e /etc/init//mysql.conf ']'
+ is_upstart=1
++ /sbin/runlevel
++ sed 's/.*\ //'
+ RL=2
+ test '!' 0
+ test x2 = x0
+ test x2 = x6
+ test x2 = x0
+ test x2 = x6
+ test x2 '!=' x
++ xargs
++ ls -d -Q '/etc/rc2.d/S[0-9][0-9]mysql'
+ SLINK=
++ xargs
++ ls -d -Q '/etc/rc2.d/K[0-9][0-9]mysql'
+ KLINK=
++ xargs
++ ls -d -Q '/etc/rcS.d/S[0-9][0-9]mysql'
+ SSLINK=
+ verifyrclink
+ doexit=
+ test 0 -gt 0
+ test x '!=' x
+ return 0
+ RC=
+ case ${ACTION} in
+ testexec
+ test 0 -gt 0
+ return 1
+ testexec
+ test 0 -gt 0
+ return 1
+ testexec
+ test 0 -gt 0
+ return 1
+ '[' -n 1 ']'
+ test x = x
+ test x = xquery
+ querypolicy
+ policyaction=start
+ test x = x101
+ test x/usr/sbin/policy-rc.d '!=' x
+ test -x /usr/sbin/policy-rc.d
+ test x = x
+ RC=104
+ return
+ case ${RC} in
+ test x = xquery
+ '[' -n 1 ']'
+ RUNNING=
+ DISABLED=
+ status mysql
+ grep -q ' start/'
++ initctl version
++ awk '{print $3}'
++ tr -d ')'
+ UPSTART_VERSION_RUNNING=1.12.1
+ dpkg --compare-versions 1.12.1 ge 0.9.7
+ initctl show-config -e mysql
+ grep -q '^ start on'
+ '[' 0 '!=' 0 ']'
+ clean_ldpreload libeatmydata.so
+ local name=libeatmydata.so 'oifs=
' found=0 tok= nval= 'delim= '
+ '[' '' = '' ']'
+ IFS=' '
+ IFS='
'
+ '[' 0 = 1 ']'
+ return 0
+ test x '!=' x
+ test 104 -eq 104
+ '[' -n 1 ']'
+ RC=102
+ setechoactions start
+ test 1 -gt 1
+ echoaction=
+ test '!' -z start
+ getnextaction start
+ saction=start
+ shift
+ ACTION=
+ test '!' -z
+ '[' -n 1 ']'
+ initctl reload-configuration
+ case $saction in
+ '[' -z '' ']'
+ '[' start = stop ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ start mysql
start: Job failed to start
+ RC=1
+ test '!' -z ''
+ test '!' -z ''
+ printerror initscript mysql, action '"start"' failed.
+ test x = x
++ basename /usr/sbin/invoke-rc.d
+ echo invoke-rc.d: 'initscript mysql, action "start" failed.'
invoke-rc.d: initscript mysql, action "start" failed.
+ exit 1
gerrit@gerrit:~$

Manfred Hampl (m-hampl) said : #13

Also not helpful. Is there an error log in /var/log/mysql/error.log ?

There was also a warning on one of the previous messages:
etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz

/etc/mysql/my.cnf should be installed by mysql-common

So maybe you should try re-installing mysql-common as next step?

Gerrit Addiks (addiks) said : #14

gerrit@gerrit:~$ ll /etc/mysql/
insgesamt 28
drwxr-xr-x 3 root root 4096 Okt 13 09:45 ./
drwxr-xr-x 185 root root 12288 Okt 15 09:38 ../
drwxr-xr-x 2 root root 4096 Okt 13 09:45 conf.d/
-rw------- 1 root root 333 Okt 7 17:03 debian.cnf
-rwxr-xr-x 1 root root 1220 Aug 6 2014 debian-start*
gerrit@gerrit:~$ cat /var/log/mysql/error.log
gerrit@gerrit:~$

I currently need my running mysql setup, so i will try reinstalling mysql-common later.

Best Manfred Hampl (m-hampl) said : #15

I just spotted a strange detail.
Your dpkg -l output shows the lines

ii libmysqlclient18:amd64 5.6.23-1ubuntu14.04 amd64 MySQL shared client libraries
ii libmysqlclient18:i386 5.6.23-1ubuntu14.04 i386 MySQL shared client libraries
ii mysql-common 5.6.23-1ubuntu14.04 amd64 MySQL Common

with version number 5.6.23 different from 5.6.19-0ubuntu0.14.04.1 as all other MySQL packages are.
You seem to have borked your system by installing a package from some foreign source instead of the Ubuntu repositories.

Gerrit Addiks (addiks) said : #16

Thank you so much! These mysql-common packages with wrong versions (5.6.23) seem to somehow scrambled things up indeed. I installed the version 5.5.44 of them (like from the repo) and now dpkg is finally at peace. These 5.6.23 packages are gone now and i cannot install them anymore, so they were probably locally built packages. I just don't remember ever building any mysql-packages by hand, i guess some other tool (mysql-workbench maybe?) must have been done that automaticly without asking me.

Gerrit Addiks (addiks) said : #17

Thanks Manfred Hampl, that solved my question.