package zabbix-agent 1:2.0.2+dfsg-3 failed to install/upgrade: subprocess installed pre-removal script returned error exit status 1

Bug #1071293 reported by Josh Brand
52
This bug affects 10 people
Affects Status Importance Assigned to Milestone
zabbix (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Attempting removal of package, script fails regardless of whether daemon is running or not.

ProblemType: Package
DistroRelease: Ubuntu 12.10
Package: zabbix-agent 1:2.0.2+dfsg-3
ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
Uname: Linux 3.5.0-18-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.6.1-0ubuntu4
Architecture: amd64
Date: Thu Oct 25 08:18:58 2012
DpkgTerminalLog:
 Removing zabbix-agent ...
 invoke-rc.d: initscript zabbix-agent, action "stop" failed.
 dpkg: error processing zabbix-agent (--remove):
  subprocess installed pre-removal script returned error exit status 1
DuplicateSignature:
 Removing zabbix-agent ...
 invoke-rc.d: initscript zabbix-agent, action "stop" failed.
 dpkg: error processing zabbix-agent (--remove):
  subprocess installed pre-removal script returned error exit status 1
ErrorMessage: subprocess installed pre-removal script returned error exit status 1
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
SourcePackage: zabbix
Title: package zabbix-agent 1:2.0.2+dfsg-3 failed to install/upgrade: subprocess installed pre-removal script returned error exit status 1
UpgradeStatus: Upgraded to quantal on 2012-10-22 (2 days ago)

Revision history for this message
Josh Brand (joshbrand) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Nicola Volpini (nicola-volpini) wrote :

I commented in the french version of the bug as well, I'll post the same, it could help the ones in my very same situation:

I confirm this. The issue is in the init scripts for the agent, for the server and for the proxy. The issue has been fixed in the 2.0.3 version of the package (I did a comparison of the init scripts between 2.0.2 and 2.0.3).
Apparently there's a wrong evaluation in the _ev_ function on lines 28-30 which throws an exit status of 1 despite the daemon being started properly. Dpkg gets the exit status of 1 and thinks some issue occurred during installation, leaving the package in an inconsistent state.
Here, this is the NON-working version from zabbix 2.0.2:

_ev_ () {
  [ "$VERBOSE" != "no" ] && eval $@
}

This is the working version from the package zabbix 2.0.3 (from Ubuntu Raring):

_ev_ () {
  [ "$VERBOSE" = "no" ] || eval $@
}

The solution is to copy the init scripts from the Raring version of the package (or fix the above function), recompile the deb package and everything should be fine.

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

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

Changed in zabbix (Ubuntu):
status: New → Confirmed
Revision history for this message
Ritesh (rudra) wrote :

While I try to remove Zabbix on my System, Showing bellow error message.

apt-get remove zabbix-agent
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  zabbix-agent
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 692 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 190144 files and directories currently installed.)
Removing zabbix-agent ...
invoke-rc.d: initscript zabbix-agent, action "stop" failed.
dpkg: error processing zabbix-agent (--remove):
 subprocess installed pre-removal script returned error exit status 1
invoke-rc.d: initscript zabbix-agent, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 zabbix-agent
E: Sub-process /usr/bin/dpkg returned an error code (1)

uname -a
3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:52:46 UTC 2012 i686 i686 i686 GNU/Linux

Revision history for this message
Tomasz Słomiński (tomasz-slominski) wrote :

The same for zabbix-server-mysql:

~$ sudo apt-get purge zabbix-server-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fping libiksemel3 libopenipmi0 snmpd
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  zabbix-server-mysql*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 2,473 kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 240067 files and directories currently installed.)
Removing zabbix-server-mysql ...
invoke-rc.d: initscript zabbix-server, action "stop" failed.
dpkg: error processing zabbix-server-mysql (--purge):
 subprocess installed pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                               * zabbix_server is disabled in /etc/default/zabbix-server.
Errors were encountered while processing:
 zabbix-server-mysql

~$ uname -a
Linux Sirius 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Javier López (javier-lopez) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. However, I am closing it because the bug has been fixed in the latest development version of Ubuntu - Raring Ringtail

This is a significant bug in Ubuntu. If you need a fix for the bug in previous versions of Ubuntu, please do steps 1 and 2 of the SRU Procedure [1] to bring the need to a developer's attention.

[1]: https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Changed in zabbix (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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