mariadb-server failed to install: script returned error exit status 1 (by design) after user chooses to abort installation

Bug #1457356 reported by Bronislav Koch
84
This bug affects 15 people
Affects Status Importance Assigned to Milestone
mariadb-5.5 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Description: Ubuntu 14.04.2 LTS
Release: 14.04

Installiert: 5.5.41-1ubuntu0.14.04.1
  Installationskandidat: 5.5.43-1ubuntu0.14.04.2
  Versionstabelle:
     5.5.43-1ubuntu0.14.04.2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
 *** 5.5.41-1ubuntu0.14.04.1 0
        100 /var/lib/dpkg/status
     5.5.36-1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

Expected updating the package
Instead this bug happend

ProblemType: Package
DistroRelease: Ubuntu 14.04
Package: mariadb-server-5.5 5.5.41-1ubuntu0.14.04.1
ProcVersionSignature: Ubuntu 3.13.0-53.88-generic 3.13.11-ckt19
Uname: Linux 3.13.0-53-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.10
Architecture: amd64
Date: Thu May 21 09:20:58 2015
DuplicateSignature: package:mariadb-server-5.5:5.5.41-1ubuntu0.14.04.1:subprocess new pre-removal script returned error exit status 1
ErrorMessage: subprocess new pre-removal script returned error exit status 1
InstallationDate: Installed on 2015-02-15 (94 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
SourcePackage: mariadb-5.5
Title: package mariadb-server-5.5 5.5.41-1ubuntu0.14.04.1 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.mysql.conf.d.mysqld.safe.syslog.cnf: [deleted]
modified.conffile..etc.mysql.debian.start: [deleted]

Revision history for this message
Bronislav Koch (b-koch) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Otto Kekäläinen (otto) wrote :

This automatic Apport bug report contains very little useful information, I don't think there is much I can help unless there is a proper bug report written by a human.

However I can see in the logs the line 'invoke-rc.d: initscript mysql, action "stop" failed.'

What is you just run 'killall mysqld' and then upgrade? For some reason the service didn't stop when asked to during the upgrade.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mariadb-5.5 (Ubuntu):
status: New → Confirmed
Revision history for this message
Tamás Baráth (tamas-barath) wrote :

Ubuntu 14.04 1, but the new package is ended with 14.04.2 (maybe it is important).

A yes/no dialog appeared during the upgrade with a message that it wanted to convert something. But I thougt it is a minor change and I did not want it, so I pressed no.

The end of apt message:
Errors were encountered while processing:
 /var/cache/apt/archives/mariadb-server-5.5_5.5.43-1ubuntu0.14.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
W: Operation was interrupted before it could finish

I tried to rerun:
 # apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 mariadb-client-5.5 : Breaks: mariadb-server-5.5 (< 5.5.43-1ubuntu0.14.04.2) but 5.5.41-1ubuntu0.14.04.1 is installed
 mariadb-server : Depends: mariadb-server-5.5 (>= 5.5.43-1ubuntu0.14.04.2) but 5.5.41-1ubuntu0.14.04.1 is installed
E: Unmet dependencies. Try using -f.

Maybe important lines from term.log:
Preparing to unpack .../mariadb-client-core-5.5_5.5.43-1ubuntu0.14.04.2_amd64.deb ...
Unpacking mariadb-client-core-5.5 (5.5.43-1ubuntu0.14.04.2) over (5.5.41-1ubuntu0.14.04.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up mariadb-common (5.5.43-1ubuntu0.14.04.2) ...
(Reading database ... 131104 files and directories currently installed.)
Preparing to unpack .../mariadb-server-5.5_5.5.43-1ubuntu0.14.04.2_amd64.deb ...
 * Stopping MariaDB database server mysqld [ OK ]
Aborting MariaDB installation.
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-5.5_5.5.43-1ubuntu0.14.04.2_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
 * Stopping MariaDB database server mysqld [ OK ]
 * Starting MariaDB database server mysqld [ OK ]
 * Checking for corrupt, not cleanly closed and upgrade needing tables.
dpkg: considering deconfiguration of mariadb-server-5.5, which would be broken by installation of mariadb-client-5.5 ...
dpkg: yes, will deconfigure mariadb-server-5.5 (broken by mariadb-client-5.5)
Preparing to unpack .../mariadb-client-5.5_5.5.43-1ubuntu0.14.04.2_amd64.deb ...
De-configuring mariadb-server-5.5 (5.5.41-1ubuntu0.14.04.1) ...
 * Stopping MariaDB database server mysqld ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Revision history for this message
Otto Kekäläinen (otto) wrote :

> A yes/no dialog appeared during the upgrade with a message
> that it wanted to convert something. But I thougt it is a minor change
> and I did not want it, so I pressed no.

What did that dialog exactly say? It is very relevant what is said and what was your reponse to it was. Such a dialog is not visible in the automatic Apport logs.

What if you try 'sudo apt-get remove "mariadb-*"' and then reinstall?

Revision history for this message
Tamás Baráth (tamas-barath) wrote :

I am trying to reproduce it.
The dialog's caption: Configuring mariadb-server-5.5
The dialog said:"
MariaDB is a drop-in replacement for mysql. It will use your current configuration file (my.cnf) and current databases.

Note that MariaDB has some enhanced features, which do not exist in MySQL and thus migration back to MySQL might not always work, at least not as automatically as migrating from MySQL to MariaDB.

Really migrate to MariaDB?
"
And the Yes/No chooser.
And if you choose no it will broke the apt.

I reproduced it in a test vm (will send steps soon).

After "sudo apt-get remove "mariadb-*" and for reinstall I tried:
First "apt-get install mariadb-server mariadb-server-5.5 mariadb-client-5.5 mariadb-client", this showed the same dialog as above, I pressed no, then "sudo apt-get remove "mariadb-*" again.
Then "apt-get install mariadb-server mariadb-client" is the same as newly installed (asks root pw) and then the "really migrate" dialog, I pressed yes.
I tried again the "sudo apt-get remove "mariadb-*" and "apt-get install mariadb-server mariadb-server-5.5 mariadb-client-5.5 mariadb-client" method, and packages installed without any question.

Revision history for this message
Tamás Baráth (tamas-barath) wrote :

Steps to reproduce (nearly) my case:

0. install ubuntu 14.04 2 server, install just the base
1. edit /etc/apt/sources.list, comment out the next two lines:
 deb http://security.ubuntu.com/ubuntu trusty-security universe
 deb http://archive.ubuntu.com/ubuntu trusty-updates universe
2. apt-get update
3. apt-get install mariadb-server mariadb-client (install an older version, see later), add a root password and wait until installation is complete
4. undo step 1 (remove comments before the two lines)
5. apt-get update
6. apt-get upgrade shows that mariadb-server mariadb-server-5.5 mariadb-client-5.5 mariadb-client packages under "have been kept back". Choose yes or no, it has no effect the next step (in my case these packages were updated automatically)
7. apt-get install mariadb-server mariadb-server-5.5 mariadb-client-5.5 mariadb-client and choose no
8. and this breaks the package dependencies:
 mariadb-client-5.5 : Breaks: mariadb-server-5.5 (< 5.5.43-1ubuntu0.14.04.2) but 5.5.41-1ubuntu0.14.04.1 is installed
 mariadb-server : Depends: mariadb-server-5.5 (>= 5.5.43-1ubuntu0.14.04.2) but 5.5.41-1ubuntu0.14.04.1 is installed

Comments
In step 3 the version (5.5.36-1) is not the 5.5.41-1 what was installed in my case, but I cannot reproduce that state and this way will break the package manager too

Step 6 shows some interesting things, some mariadb package (for example mariadb-client-core-5.5 or mariadb-common) can updated automatically to version 5.5.43-1, but 4 mariadb packages "have been kept back". I do not think it is good...

Revision history for this message
Tamás Baráth (tamas-barath) wrote :

At step seven you have to say "no" to the "Really migrate to MariaDB?" question in the "Configuring mariadb-server-5.5" dialog

Revision history for this message
Otto Kekäläinen (otto) wrote :

If you in the dialog "Really migrate to MariaDB?" choose the option "No" it will bail out from dpkg and abort the installation. This is by design - you are not supposed to get MariaDB installed if you choose "No".

This method of aborting has been around in MySQL packaging for a long time. For example if you had MySQL 5.1 installed and then installed MySQL 5.0 you would see a similar screen asking for confirmation and if you selected "No" then the dpkg process would be aborted.

Revision history for this message
Otto Kekäläinen (otto) wrote :

Just to make sure, I just tested by installing mariadb-server 5.5.36-1 from the universe repository, and then enabled universe-updates repository and ran 'apt-get upgrade'. It upgraded to mariadb-server 5.5.43-1ubuntu0.14.04.2. I chose 'yes' in the dialog and everything went fine.

The actual bug here is that the dialog asking to if the admin wants to migrate forward should not be shown on a minor version upgrade. I believe it has been fixed in Debian for a long time ago and I need to check what is the status of backporting it into Trusty. I Debian we should maybe even stop showing that dialog at all since it does not seem to bring any actual benefit. Few admins read or understand the dialog anyway.

Revision history for this message
Tamás Baráth (tamas-barath) wrote :

You have right, the main problem is the dialog. And other problem is the result of "no", the broken dependencies

Otto Kekäläinen (otto)
summary: - package mariadb-server-5.5 5.5.41-1ubuntu0.14.04.1 failed to
- install/upgrade: subprocess new pre-removal script returned error exit
- status 1
+ package mariadb-server-5.5 failed to install/upgrade: subprocess new
+ pre-removal script returned error exit status 1 (by design) after user
+ chooses to abort installation
Otto Kekäläinen (otto)
summary: - package mariadb-server-5.5 failed to install/upgrade: subprocess new
- pre-removal script returned error exit status 1 (by design) after user
- chooses to abort installation
+ mariadb-server failed to install: script returned error exit status 1
+ (by design) after user chooses to abort installation
Revision history for this message
Otto Kekäläinen (otto) wrote :
Changed in mariadb-5.5 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Ian (i-hasman) wrote : Re: [Bug 1457356] mariadb-server failed to install: script returned error exit status 1 (by design) after user chooses to abort installation

Otto,

Many thanks to you and your coleagues both for fixing these bugs and taking the time to let us know. So much better than Windo$e. Keep up the good work.

Regards,

Ian Hasman

On Sat, 22 Aug 2020 11:44:49 +0000, Otto Kekäläinen wrote:
> This was fixed 4 years ago in https://salsa.debian.org/mariadb-
> team/mariadb-10.3/-/commit/9605a48a99a61f439698676da192799de45d732a
>
> ** Changed in: mariadb-5.5 (Ubuntu)
> Status: Confirmed => Fix Released
>

--
Sent using Dekko from my Ubuntu device

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.