Bug 1584387 - glusterfs-server Debian package uninstall fails
Summary: glusterfs-server Debian package uninstall fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: packaging
Version: 3.12
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Kaleb KEITHLEY
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-30 19:07 UTC by jack.wong
Modified: 2018-09-25 02:19 UTC (History)
3 users (show)

Fixed In Version: 3.12.10, 4.1.0
Clone Of:
Environment:
Last Closed: 2018-06-14 13:06:49 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)
glusterfs-server.prerm (453 bytes, text/plain)
2018-06-04 20:30 UTC, jack.wong
no flags Details

Description jack.wong 2018-05-30 19:07:45 UTC
Description of problem:
I am using Ubuntu 16.04 (Xenial). In glusterfs-server 3.12, the service installed by the Debian package was renamed from glusterfs-server to glusterd. The prerm script for the Debian package includes a line to stop the glusterd service but it also includes a line to stop the glusterfs-server service. Since the service no longer exists at that name, this line fails and causes Debian package uninstall to fail.

This is bad because it prevents upgrading the Debian package. To install a newer Debian package, apt-get will try to uninstall the existing package and fail.

Version-Release number of selected component (if applicable):
I tested both glusterfs-server_3.12.2-ubuntu1~xenial2 and glusterfs-server_3.12.9-ubuntu1~xenial1. Both packages have this problem.

How reproducible:
Highly reproducible

Steps to Reproduce:
1. Install the glusterfs-server Debian package (`apt-get install glusterfs-server`)
2. Uninstall the glusterfs-server Debian package (`apt-get remove glusterfs-server` or `apt-get install --reinstall glusterfs-server` or try to install a newer glusterfs-server deb).

Actual results:
The apt-get command returns the following error and leaves the glusterfs-server package installed.
    Removing glusterfs-server (3.12.9-ubuntu1~xenial1) ...
    Failed to stop glusterfs-server.service: Unit glusterfs-server.service not loaded.
    invoke-rc.d: initscript glusterfs-server, action "stop" failed.
    dpkg: error processing package glusterfs-server (--remove):
     subprocess installed pre-removal script returned error exit status 5
    Errors were encountered while processing:
     glusterfs-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Expected results:
There should be no error message and the Debian package should be removed.

Additional info:
Deleting lines 8 through 12 of /var/lib/dpkg/info/glusterfs-server.prerm seems to fix the issue.

Comment 1 Kaleb KEITHLEY 2018-06-04 11:33:51 UTC
There is no glusterfs-server.prerm script in the sources used to build the gluster packages in the gluster PPA, and there never has been.

Nor is there a /var/lib/dpkg/info/glusterfs-server.prerm file on my xenial box, which has only ever had packages from the PPA installed.

I removed the PPA and installed glusterfs from the base distritbution and _that_ (glusterfs-3.7.6) did install /var/lib/dpkg/info/glusterfs-server.prerm. It appears to me that the file on your system is left over from a previous install that did not get cleaned up properly.

IMO the upgrade/uninstall from the base 3.7.6 should have removed those files; if it didn't that seems like a bug in apt or dpkg.

I suggest a complete uninstall and manual delete of any leftover files like /var/lib/dpkg/info/glusterfs-server.prerm.

Comment 2 jack.wong 2018-06-04 20:30:08 UTC
Created attachment 1447632 [details]
glusterfs-server.prerm

prerm script from glusterfs-server Debian package

Comment 3 jack.wong 2018-06-04 21:01:39 UTC
(In reply to Kaleb KEITHLEY from comment #1)
> There is no glusterfs-server.prerm script in the sources used to build the
> gluster packages in the gluster PPA, and there never has been.

While prerm scripts can be maintained by humans, they are usually autogenerated by one of the debhelper tools. That would explain why the file appears appear neither in the Debian source tarball nor in source code. Please see attached file glusterfs-server.prerm. Looking at the file's content, lines 8 through 12 say that they were autogenerated by dh_installinit. Looking at the documentation for dh_installinit (http://manpages.ubuntu.com/manpages/bionic/man1/dh_installinit.1.html), these five lines were probably generated due to the presence of glusterfs-server.upstart in the debian/ directory.

> Nor is there a /var/lib/dpkg/info/glusterfs-server.prerm file on my xenial
> box, which has only ever had packages from the PPA installed.

I launched a clean Ubuntu 16.04.4 machine on Amazon EC2 using the latest available Xenial AMI. After I added the PPA and installed glusterfs-server 3.12, I see the file appear in /var/lib/dpkg/info/.

Did you check for the file after you installed the package and before uninstallation? When I uninstall the package, the prerm file is deleted even though the invoke-rc.d line writes out an error.

> I removed the PPA and installed glusterfs from the base distritbution and
> _that_ (glusterfs-3.7.6) did install
> /var/lib/dpkg/info/glusterfs-server.prerm. It appears to me that the file on
> your system is left over from a previous install that did not get cleaned up
> properly.
>
> IMO the upgrade/uninstall from the base 3.7.6 should have removed those
> files; if it didn't that seems like a bug in apt or dpkg.

The file contains a systemd section for the new names of the Gluster services (glusterd.service, glustereventsd.service, and glusterfssharedstorage.service). That rules out that this file could have come from a <3.12 package as those services were not created until 3.12.

Unless there is some subtle bug in my startup scripts, I have never installed GlusterFS 3.7.6 on the Ubuntu machines that I use. I have always gone straight to 3.12, without installing or upgrading from any older versions like 3.11 or 3.7.

Comment 4 Kaleb KEITHLEY 2018-06-14 13:06:49 UTC
Fixed in 3.12.10 and 4.1.0 Debian packages on download.gluster.org and Ubuntu packages in Launchpad PPA

Comment 5 jack.wong 2018-09-25 02:19:43 UTC
I finally had to uninstall my 3.12.12 version so that I could install version 3.12.14. I can confirm that this bug is fixed. Thank you, Kaleb.


Note You need to log in before you can comment on or make changes to this bug.