postrm script fails

Bug #191656 reported by Jordi Mallach
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
db2exc (Ubuntu)
Fix Released
Undecided
Brian Thomason

Bug Description

Binary package hint: db2exc

Testing db2exc installs for a deployment, I found an update to the package today.

When I went ahead to purge it, I found some problems in the .postrm script:
(sorry for the Catalan output)

S'estan purgant els fitxers de configuració de db2exc ...
dpkg: s'ha produït un error en processar db2exc (--purge):
 el subprocés post-removal script retornà el codi d'eixida d'error 1

There are some unprotected rm and rmdir calls which fail at that stage as at least for me, the /opt/ibm dir was already empty at the time of purging.

I'm attaching a patch to fix this, but I'm not too sure if I can be this happy about assuming the non-existance of these files is OK.

Tags: packaging
Revision history for this message
Jordi Mallach (jordi) wrote :
Revision history for this message
Jordi Mallach (jordi) wrote :

Actually, here's a patch that works.

Revision history for this message
Stephan Rügamer (sruegamer) wrote :

Not in hardy anymore

Changed in db2exc:
status: New → Won't Fix
Revision history for this message
Jordi Mallach (jordi) wrote :

Stephan, does this mean there won't ever be a hardy version? I was happy to find a gutsy version recently, and assumed a LTS release would get it as well, eventually.

My project relies on LTS + DB2. Not that I can maintain a hardy package myself, but I wonder why it won't be in the commercial repo anymore.

Revision history for this message
Brian Thomason (brian-thomason) wrote :

Hi jordi,

db2exc will be in hardy. I appreciate your reporting this. Can you provide me a little more info as to what version you upgraded from/to, and why those dirs were already empty? obviously it should be fixed - just curious if there are greater problems I need to make IBM aware of)

Thanks again!

-Brian

Changed in db2exc:
assignee: nobody → brian-thomason
status: Won't Fix → In Progress
Revision history for this message
Jordi Mallach (jordi) wrote : Re: [Bug 191656] Re: postrm script fails

Hi Brian,

On Tue, Mar 25, 2008 at 07:37:04AM -0000, Brian Thomason wrote:
> db2exc will be in hardy. I appreciate your reporting this. Can you
> provide me a little more info as to what version you upgraded from/to,
> and why those dirs were already empty? obviously it should be fixed -
> just curious if there are greater problems I need to make IBM aware of)

I don't remember the details, but rereading my patch, I'd say $instDir
(/opt/ibm/db2exc) was already gone when the postrm script tried to rm
it. Same for the init script.

--
Jordi Mallach Pérez -- Debian developer http://www.debian.org/
<email address hidden> <email address hidden> http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/

Revision history for this message
Jordi Mallach (jordi) wrote :

Oh, this should be a different bug report, but /opt/ibm/db2exc/V9.5/logs is a broken symlink pointing to install/logs, which does not exist.

Changed in db2exc:
status: In Progress → Confirmed
Revision history for this message
korvins (katarata) wrote :

Hi,
I found a similar problem with db2 installation. I had a version of db2 installed previously, not sure if this is related.

When I try to install the packet it fails with an error and when trying to uninstall it says packet is in bad state so it is needs to be reinstalled. I am stuck at this, and everytime I try to update my system it keeps trying to reinstall this packet. That is something it messes up everything. I tried the common options (--purge, --update, synaptic, --force, without success). As a aside note I believe apt-get should be more resilient to this.

This is what I am doing (Catalan output again):

S'està llegint la llista de paquets... Fet
S'està construint l'arbre de dependències
Reading state information... Fet
0 actualitzats, 0 nous a instal·lar, 0 a eliminar i 0 no actualitzats.
1 no instal·lats o eliminats completament.
Es necessita obtenir 0B/214MB d'arxius.
Després de desempaquetar s'usaran 0B d'espai en disc addicional.
S'està seleccionant el paquet db2exc prèviament no seleccionat.
(S'està llegint la base de dades ... hi ha 193232 fitxers i directoris instal·lats actualment.)
S'està preparant per a reemplaçar db2exc 9.5.0-1gutsy1 (fent servir .../db2exc_9.5.0-1gutsy1_i386.deb) ...
S'està desempaquetant el reemplaçament de db2exc ...
dpkg: avís - seqüència de «post-removal» antiga retorna l'eixida d'error 1
dpkg - s'està provant la seqüència del paquet nou en el seu lloc...
dpkg: s'ha produït un error en processar /var/cache/apt/archives/db2exc_9.5.0-1gutsy1_i386.deb (--unpack):
 el subprocés seqüència post-removal nova retornà el codi d'eixida d'error 1
dpkg: s'ha produït un error en netejar:
 el subprocés post-removal script retornà el codi d'eixida d'error 1
S'han trobat errors en processar:
 /var/cache/apt/archives/db2exc_9.5.0-1gutsy1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I applied Jordi's second patch and it worked smoothly (I have not ran db2 yet, but it seems everything should be fine). Now I can update my system without messing with db2exc.

Please include this change in the official script and let me know when you do it.

Per cert, gràcies Jordi m'has estalviat un bon maldecap.

Thank you

Revision history for this message
Antony Jones (wrh) wrote :

This is still a problem. I have to use 9.2 instead of the new 9.5 - they are very, very different databases.

I've just upgraded to Ubuntu 8.04 and bang, stuck with an unremovable db2exc package... no idea how to remove it. Now my system is virtually unusable because it has prevented lots of other upgrades.

Revision history for this message
Antony Jones (wrh) wrote :

Here's how I have to manually remove db2exc 9.5 from gutsy (and when I use it with hardy too) - I can't believe i'm still having problems with this.

sudo aptitude remove db2exc
(package cannot be removed, it is broken)
sudo vim /var/lib/dpkg/info/db2exc.postrm

comment out the following lines as shown:

# rm $instDir/cfg/installcopy.cfg > /dev/null 2>&1
# rm $instDir/default.env > /dev/null 2>&1
# rm $instDir/profiles.reg > /dev/null 2>&1
# rmdir $instDir/cfg > /dev/null 2>&1
# rmdir $instDir > /dev/null 2>&1
# rmdir /opt/ibm/db2exc > /dev/null 2>&1

# /usr/sbin/update-rc.d -f db2 remove > /dev/null 2>&1
# rm /etc/init.d/db2 > /dev/null 2>&1

then...

sudo aptitude remove db2exc

(now it works). Now delete the db2inst1, dasadm1, and db2fenc1 users from /home and 'userdel' them.

Then reinstall at your leisure.

What a pain!

Revision history for this message
Brian Thomason (brian-thomason) wrote :

9.5 in Hardy now fixes this and other issues.

Changed in db2exc:
status: Confirmed → Fix Released
Revision history for this message
Akanksha (a-batra16) wrote :

I am having somewhat the same problem..
I installed db2 and it failed saying
 Setting up db2exc (9.7.1-3hardy1) ...
 * Setting DB2 library path... [ OK ]
 * Registering installation in the DB2 global registry... [ OK ]
 * Creating new group and user for Database Administration Server... [ OK ]
 * Creating Database Administration Server... ERROR: Could not create default instances. Aborting Configuration...
dpkg: error processing db2exc (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 db2exc
E: Sub-process /usr/bin/dpkg returned an error code (1)

And since then i am not able to install/update anything. It always retrns an error "E: db2exc: subprocess installed post-installation script returned error exit status 1".And I am using ubuntu 10.04 lts..32 bit..
I do not know anything about the postrm or postint files and what to do with them.. But the above post suggested to do some changes in the /var/lib/dpkg/info/db2exc.postrm file.
Patch : http://launchpadlibrarian.net/11930183/db2.ubuntu.patch
But nothing happened even after that.
Please suggest something.

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.