package mysql-server failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

Bug #522185 reported by Klayshin
256
This bug affects 58 people
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.1 (Ubuntu)
Expired
Medium
Unassigned

Bug Description

While upgrading Ubuntu, mysql 5.1 failed to install due to unknown reasons.

ProblemType: Package
Architecture: i386
Date: Fri Feb 12 18:36:54 2010
DistroRelease: Ubuntu 9.10
ErrorMessage: subprocess new pre-removal script returned error exit status 1
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['ibdata1', 'MyNewDataBase', 'consult', 'ib_logfile0', 'debian-5.1.flag', 'ib_logfile1', 'mysql', 'mysql_upgrade_info']
Package: mysql-server-5.1 5.1.37-1ubuntu5
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
SourcePackage: mysql-dfsg-5.1
Title: package mysql-server-5.1 5.1.37-1ubuntu5 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
Uname: Linux 2.6.31-19-generic i686

Revision history for this message
Klayshin (clay-herrera) wrote :
Thierry Carrez (ttx)
Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
David Park (dparkmit) wrote :
Download full text (5.9 KiB)

I'm writing to add some more details re: this bug. I encountered the same problem and figured out what the apt-get upgrade command did that made the mysql upgrade fail.

I'm using a 64-bit version of Ubuntu 9.10 server on an Amazon EC2 instance. Since a couple weeks ago, "sudo apt-get upgrade" has failed because it can't upgrade MySQL successfully. When I run apt-get upgrade, the server downloads the latest MySQL files and stops the MySQL daemon in order to upgrade the server. But then it fails when trying to start MySQL.

When I investigated the cause of this error, I realized that the cause of the problem is that the "sudo apt-get upgrade" creates 2 binary log files which have the root:root account and group as the owner. These binary log files are in the directory /var/lib/mysql/ and have names like mysql-bin.000107. I'm not sure why "sudo apt-get upgrade" creates 2 files, but it always seems to create 2 files. When I change the owner of these binary log files to mysql:mysql, then MySQL successfully starts.

As a result of this bug, I haven't been able to successfully run sudo apt-get upgrade for a couple weeks. Any help or advice would be appreciated!

Here is info about my server.

Output from lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

Amazon EC2 AMI: I created my own AMI but built it on top of the official Canonical Ubuntu 64-bit 9.10 AMI in December, 2009.
 CancelOk

Here's the output from the apt-get upgrade command:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  bind9-host dnsutils libbind9-50 libdns50 libgssapi-krb5-2 libgssrpc4 libisc50 libisccc50 libisccfg50 libk5crypto3 libkadm5srv6 libkrb5-3 libkrb5-dev libkrb5support0 liblwres50 linux-ec2 linux-image-ec2 linux-image-virtual linux-virtual
The following packages will be upgraded:
  apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common dpkg dpkg-dev tzdata
8 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
2 not fully installed or removed.
Need to get 5,136kB of archives.
After this operation, 65.5kB disk space will be freed.
Get:1 http://us.ec2.archive.ubuntu.com karmic-updates/main dpkg 1.15.4ubuntu2.1 [2,126kB]
Get:2 http://us.ec2.archive.ubuntu.com karmic-updates/main tzdata 2010e-0ubuntu0.9.10 [683kB]
Get:3 http://us.ec2.archive.ubuntu.com karmic-updates/main apache2 2.2.12-1ubuntu2.2 [1,426B]
Get:4 http://us.ec2.archive.ubuntu.com karmic-updates/main apache2-mpm-prefork 2.2.12-1ubuntu2.2 [2,376B]
Get:5 http://us.ec2.archive.ubuntu.com karmic-updates/main apache2.2-common 2.2.12-1ubuntu2.2 [285kB]
Get:6 http://us.ec2.archive.ubuntu.com karmic-updates/main apache2.2-bin 2.2.12-1ubuntu2.2 [1,309kB]
Get:7 http://us.ec2.archive.ubuntu.com karmic-updates/main apache2-utils 2.2.12-1ubuntu2.2 [155kB]
Get:8 http://us.ec2.archive.ubuntu.com karmic-updates/main dpkg-dev 1.15.4ubuntu2.1 [573kB]
Fetched 5,136kB in 0s (16.4MB/s)
Preconfiguring packages ...
(Reading database ... 32789 files and directories currently installed.)
Preparing to replace dpkg 1.15.4ubuntu2 (using .../dpkg_1.15.4ubuntu2.1_i386.deb) ...
Unpacking replacement dpkg ...
Processing tr...

Read more...

Revision history for this message
Sinquin David (davidsinquin+launchpad) wrote :

I don't know if I had the same bug as the message I had when I updated was that dpkg couldn't stop mysql.
I tried "sudo /etc/init.d/mysql stop" but it failed. Then I did "sudo killall mysqld" which worked, I re-launched "sudo /etc/init.d/mysql stop" : it worked. Then "apt-get upgrade" did his work fine… Mysql seems to work fine now.

Revision history for this message
Fisher90 (unixfish) wrote :

I used the instructions that Sinquin David posted, and that seemed to work.

There were a few files in the /var/lib/mysql that were not owned by mysql - after doing the process, all the files were mysql mysql for owner and group. The file I was concerned with was the debian-5.1.flag file.

Is it possible the MySQL deamon did not have access to the flag file, and this was causing the problem? I could not get MySQL to stop, so the update never got very far. After the hard shutdown, clean shutdown, then update, everything seems fine. MySQL now starts and stops normally as well.

Revision history for this message
Nicolas Connault (nicolasconnault) wrote :

I can confirm that David's solution works.

> sudo killall mysqld
> sudo /etc/init.d/mysql stop
> apt-get upgrade

Revision history for this message
David Park (dparkmit) wrote :

I think that the bug that I reported may be different from the one that has been reported here. I tried David's solution. And it didn't work on my server. Server stopped MySQL successfully. But it didn't start MySQL for the same reasons that I outlined in my bug report above.

Revision history for this message
zorgrian (geoffcowne) wrote :

Nicolas Connault's simple-o-fied version of David's instructions. Highly recommended! Tried everything else! STOPS the APT error because it allows APT to upgrade the package AND ENABLES MySQL = restarts MySQL after this!!! NICE!

Revision history for this message
Mathias Gug (mathiaz) wrote :

@David Park: you're having a different bug as the package upgrade is able to stop mysql but not restart it. Please open a new bug.

Revision history for this message
Mathias Gug (mathiaz) wrote :

The issue is related to:

* Stopping MySQL database server mysqld
   ...fail!

Could you paste the output of running the mysqld init script stop action with debugging set to yes?

(Edit /etc/init.d/mysql to add 'set -x' at the beginning of the file and then run sudo /etc/init.d/mysql stop).

summary: - package mysql-server-5.1 5.1.37-1ubuntu5 failed to install/upgrade:
- subprocess new pre-removal script returned error exit status 1
+ package mysql-server failed to install/upgrade: subprocess new pre-
+ removal script returned error exit status 1
Changed in mysql-dfsg-5.1 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Chuck Short (zulcss) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Raphael Camus (raphael-camus) wrote :

Hi,
Please do not close this bug, it is still there each time I got an update proposal from the update-manager.
What information do you need ?

Revision history for this message
mauri (maurizio-boscaini-gmail) wrote : Re: [Bug 522185] Re: package mysql-server failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

On Thu, Jun 17, 2010 at 10:14 AM, Raphael Camus <email address hidden>wrote:

> Hi,
> Please do not close this bug, it is still there each time I got an update
> proposal from the update-manager.
> What information do you need ?
>

Hi,
I agree with Rapahel

mauri

>
> --
> package mysql-server failed to install/upgrade: subprocess new pre-removal
> script returned error exit status 1
> https://bugs.launchpad.net/bugs/522185
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “mysql-dfsg-5.1” package in Ubuntu: Invalid
>
> Bug description:
> While upgrading Ubuntu, mysql 5.1 failed to install due to unknown reasons.
>
> ProblemType: Package
> Architecture: i386
> Date: Fri Feb 12 18:36:54 2010
> DistroRelease: Ubuntu 9.10
> ErrorMessage: subprocess new pre-removal script returned error exit status
> 1
> InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
> MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
> [mysqld_safe]
> syslog
> MySQLVarLibDirListing: ['ibdata1', 'MyNewDataBase', 'consult',
> 'ib_logfile0', 'debian-5.1.flag', 'ib_logfile1', 'mysql',
> 'mysql_upgrade_info']
> Package: mysql-server-5.1 5.1.37-1ubuntu5
> ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
> SourcePackage: mysql-dfsg-5.1
> Title: package mysql-server-5.1 5.1.37-1ubuntu5 failed to install/upgrade:
> subprocess new pre-removal script returned error exit status 1
> Uname: Linux 2.6.31-19-generic i686
>
> To unsubscribe from this bug, go to:
>
> https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/522185/+subscribe
>

--
mauri

......................................................................
Ing. Maurizio Boscaini
Libero pensatore (un tentativo e una speranza)

email: <email address hidden>
phone +39 045 994492
mobile +39 340 5631571
......................................................................

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Invalid → New
Revision history for this message
Sinquin David (davidsinquin+launchpad) wrote :

Can you send the result of "sudo /etc/init.d/mysql start" ?
You should maybe open a new bug and close this one as the problem doesn't seem to be exactly the same : mine was that mysql was not able to stop, yours is that mysql cannot start.

Changed in mysql-dfsg-5.1 (Ubuntu):
status: New → Invalid
status: Invalid → New
Revision history for this message
mauri (maurizio-boscaini-gmail) wrote :

here you are:

$ sudo /etc/init.d/mysql start
[sudo] password for mauri:
 * Starting MySQL database server
mysqld
[ OK ]

I've no problem with my installed mysql:

$ mysql --version
mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486) using EditLine
wrapper

thanks
mauri

On Thu, Jun 17, 2010 at 1:40 PM, Sinquin David <
<email address hidden> <davidsinquin%<email address hidden>>>wrote:

> Can you send the result of "sudo /etc/init.d/mysql start" ?
> You should maybe open a new bug and close this one as the problem doesn't
> seem to be exactly the same : mine was that mysql was not able to stop,
> yours is that mysql cannot start.
>
>
> ** Changed in: mysql-dfsg-5.1 (Ubuntu)
> Status: New => Invalid
>
> ** Changed in: mysql-dfsg-5.1 (Ubuntu)
> Status: Invalid => New
>
> --
> package mysql-server failed to install/upgrade: subprocess new pre-removal
> script returned error exit status 1
> https://bugs.launchpad.net/bugs/522185
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “mysql-dfsg-5.1” package in Ubuntu: New
>
> Bug description:
> While upgrading Ubuntu, mysql 5.1 failed to install due to unknown reasons.
>
> ProblemType: Package
> Architecture: i386
> Date: Fri Feb 12 18:36:54 2010
> DistroRelease: Ubuntu 9.10
> ErrorMessage: subprocess new pre-removal script returned error exit status
> 1
> InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
> MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
> [mysqld_safe]
> syslog
> MySQLVarLibDirListing: ['ibdata1', 'MyNewDataBase', 'consult',
> 'ib_logfile0', 'debian-5.1.flag', 'ib_logfile1', 'mysql',
> 'mysql_upgrade_info']
> Package: mysql-server-5.1 5.1.37-1ubuntu5
> ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
> SourcePackage: mysql-dfsg-5.1
> Title: package mysql-server-5.1 5.1.37-1ubuntu5 failed to install/upgrade:
> subprocess new pre-removal script returned error exit status 1
> Uname: Linux 2.6.31-19-generic i686
>
> To unsubscribe from this bug, go to:
>
> https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/522185/+subscribe
>

--
mauri

......................................................................
Ing. Maurizio Boscaini
Libero pensatore (un tentativo e una speranza)

email: <email address hidden>
phone +39 045 994492
mobile +39 340 5631571
......................................................................

Revision history for this message
Sinquin David (davidsinquin+launchpad) wrote :

When you try to upgrade, do you have an error message like that :
"Setting up mysql-server-5.1 (5.1.37-1ubuntu5.1) ...
 * Stopping MySQL database server mysqld
   ...done.
 * Starting MySQL database server mysqld
   ...fail!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.1; however:
  Package mysql-server-5.1 is not configured yet.
dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Setting up apache2.2-bin (2.2.12-1ubuntu2.2) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Setting up apache2-utils (2.2.12-1ubuntu2.2) ...
Setting up apache2.2-common (2.2.12-1ubuntu2.2) ...

Setting up apache2-mpm-prefork (2.2.12-1ubuntu2.2) ...
 * Starting web server apache2
   ...done.

Setting up apache2 (2.2.12-1ubuntu2.2) ...

Setting up dpkg-dev (1.15.4ubuntu2.1) ...
Errors were encountered while processing:
 mysql-server-5.1
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)"

Do you really need mysql on this computer (to know if it is possible to test to remove and reinstall mysql package) ? You should save your databases before removing mysql)

Revision history for this message
mauri (maurizio-boscaini-gmail) wrote :
Download full text (3.4 KiB)

On Fri, Jun 18, 2010 at 6:26 PM, Sinquin David <
<email address hidden> <davidsinquin%<email address hidden>>>wrote:

> When you try to upgrade, do you have an error message like that :
>

> "Setting up mysql-server-5.1 (5.1.37-1ubuntu5.1) ...
> * Stopping MySQL database server mysqld
> ...done.
> * Starting MySQL database server mysqld
> ...fail!
> invoke-rc.d: initscript mysql, action "start" failed.
> dpkg: error processing mysql-server-5.1 (--configure):
> subprocess installed post-installation script returned error exit status 1
> dpkg: dependency problems prevent configuration of mysql-server:
> mysql-server depends on mysql-server-5.1; however:
> Package mysql-server-5.1 is not configured yet.
> dpkg: error processing mysql-server (--configure):
> dependency problems - leaving unconfigured
> Setting up apache2.2-bin (2.2.12-1ubuntu2.2) ...
> No apport report written because the error message indicates its a followup
> error from a previous failure.
>
> Setting up apache2-utils (2.2.12-1ubuntu2.2)
> ...
> Setting up apache2.2-common (2.2.12-1ubuntu2.2) ...
>
> Setting up apache2-mpm-prefork (2.2.12-1ubuntu2.2) ...
> * Starting web server apache2
> ...done.
>
> Setting up apache2 (2.2.12-1ubuntu2.2) ...
>
> Setting up dpkg-dev (1.15.4ubuntu2.1) ...
> Errors were encountered while processing:
> mysql-server-5.1
> mysql-server
> E: Sub-process /usr/bin/dpkg returned an error code (1)"
>

no, I've no this type of errors

>
> Do you really need mysql on this computer (to know if it is possible to
> test to remove and reinstall mysql package) ?

yes

> You should save your
> databases before removing mysql)
>
>
so, the solution is to remove mysql and reinstall it?
than I think I'll wait some time...

thanks
mauri

> --
> package mysql-server failed to install/upgrade: subprocess new pre-removal
> script returned error exit status 1
> https://bugs.launchpad.net/bugs/522185
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “mysql-dfsg-5.1” package in Ubuntu: New
>
> Bug description:
> While upgrading Ubuntu, mysql 5.1 failed to install due to unknown reasons.
>
> ProblemType: Package
> Architecture: i386
> Date: Fri Feb 12 18:36:54 2010
> DistroRelease: Ubuntu 9.10
> ErrorMessage: subprocess new pre-removal script returned error exit status
> 1
> InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
> MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
> [mysqld_safe]
> syslog
> MySQLVarLibDirListing: ['ibdata1', 'MyNewDataBase', 'consult',
> 'ib_logfile0', 'debian-5.1.flag', 'ib_logfile1', 'mysql',
> 'mysql_upgrade_info']
> Package: mysql-server-5.1 5.1.37-1ubuntu5
> ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
> SourcePackage: mysql-dfsg-5.1
> Title: package mysql-server-5.1 5.1.37-1ubuntu5 failed to install/upgrade:
> subprocess new pre-removal script returned error exit status 1
> Uname: Linux 2.6.31-19-generic i686
>
> To unsubscribe from this bug, go to:
>
> https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/522185/+subscribe
>

--
mauri

.....................................................

Read more...

Revision history for this message
Sinquin David (davidsinquin+launchpad) wrote :

What error do tou have when you launch "sudo apt-get update && sudo apt-get dist-upgrade" ?

Revision history for this message
mauri (maurizio-boscaini-gmail) wrote :

On Sat, Jun 19, 2010 at 7:46 PM, Sinquin David <
<email address hidden> <davidsinquin%<email address hidden>>>wrote:

> What error do tou have when you launch "sudo apt-get update && sudo apt-
> get dist-upgrade" ?
>

sorry, but I've ubuntu 9.10 and I wish to remain for a couple of weeks with
it
maybe we can see if the error continues when I'll do the distribution
upgrade, ok?

mauri

>
> --
> package mysql-server failed to install/upgrade: subprocess new pre-removal
> script returned error exit status 1
> https://bugs.launchpad.net/bugs/522185
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “mysql-dfsg-5.1” package in Ubuntu: New
>
> Bug description:
> While upgrading Ubuntu, mysql 5.1 failed to install due to unknown reasons.
>
> ProblemType: Package
> Architecture: i386
> Date: Fri Feb 12 18:36:54 2010
> DistroRelease: Ubuntu 9.10
> ErrorMessage: subprocess new pre-removal script returned error exit status
> 1
> InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
> MySQLConf.etc.mysql.conf.d.mysqld.safe.syslog.cnf:
> [mysqld_safe]
> syslog
> MySQLVarLibDirListing: ['ibdata1', 'MyNewDataBase', 'consult',
> 'ib_logfile0', 'debian-5.1.flag', 'ib_logfile1', 'mysql',
> 'mysql_upgrade_info']
> Package: mysql-server-5.1 5.1.37-1ubuntu5
> ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
> SourcePackage: mysql-dfsg-5.1
> Title: package mysql-server-5.1 5.1.37-1ubuntu5 failed to install/upgrade:
> subprocess new pre-removal script returned error exit status 1
> Uname: Linux 2.6.31-19-generic i686
>
> To unsubscribe from this bug, go to:
>
> https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/522185/+subscribe
>

--
mauri

......................................................................
Ing. Maurizio Boscaini
Libero pensatore (un tentativo e una speranza)

email: <email address hidden>
phone +39 045 994492
mobile +39 340 5631571
......................................................................

Revision history for this message
h34v3n (heaven978) wrote :

I thought that this problem it was solved running the services as root

Changed in mysql-dfsg-5.1 (Ubuntu):
status: New → Incomplete
Revision history for this message
Raphael Camus (raphael-camus) wrote :

After upgrading to Ubuntu 10.10, I do not have such a problem anymore and mysql is working properly.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for mysql-dfsg-5.1 (Ubuntu) because there has been no activity for 60 days.]

Changed in mysql-dfsg-5.1 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.