Bug 32687 - Error when uninstalling lxc
Summary: Error when uninstalling lxc
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA9-64-OK
Keywords: IN_ERRATA9, advisory, validated_update
Depends on:
Blocks: 32467
  Show dependency treegraph
 
Reported: 2024-01-04 18:20 CET by Guillaume Bedot
Modified: 2024-02-22 20:30 CET (History)
8 users (show)

See Also:
Source RPM: lxc-5.0.2-1.mga9.src.rpm
CVE:
Status comment:


Attachments
trying to upgrade lxc on mageia 9 then uninstall (15.10 KB, text/plain)
2024-01-04 23:22 CET, Guillaume Bedot
Details

Description Guillaume Bedot 2024-01-04 18:20:04 CET
Description of problem:
Having no more need for lxc, I tried to uninstall it.

How reproducible:
Everytime.

Steps to Reproduce:
1. urpmi lxc
2. urpme lxc
the output is:
removing lxc-5.0.3-1.mga10.x86_64
/var/tmp/rpm-tmp.mNztw4: line 1: fg: no job control
/var/tmp/rpm-tmp.mNztw4: line 2: fg: no job control
/var/tmp/rpm-tmp.mNztw4: line 3: fg: no job control
error: %preun(lxc-1:5.0.3-1.mga10.x86_64) scriptlet failed, exit status 1
ERROR: 'script' failed for lxc-1:5.0.3-1.mga10.x86_64
error: lxc-1:5.0.3-1.mga10.x86_64: erase failed

Maybe something to do with the epoch and escaping ?
Comment 1 sturmvogel 2024-01-04 18:58:10 CET
The errors are in the %post and %preun parts of the spec file...


[root@localhost ~]# urpmi lxc
    https://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/cauldron/x86_64/media/core/release/lxc-5.0.3-1.mga10.x86_64.rpm
installing lxc-5.0.3-1.mga10.x86_64.rpm from /var/cache/urpmi/rpms                                                                                                                                                                         
Preparing...                     
#########################################
      1/1: lxc                   
#########################################
/var/tmp/rpm-tmp.7FXJps: line 1: fg: no job control
/var/tmp/rpm-tmp.7FXJps: line 2: fg: no job control
/var/tmp/rpm-tmp.7FXJps: line 3: fg: no job control
warning: %post(lxc-1:5.0.3-1.mga10.x86_64) scriptlet failed, exit status 1
ERROR: 'script' failed for lxc-1:5.0.3-1.mga10.x86_64

[root@localhost ~]# urpme lxc
removing lxc-5.0.3-1.mga10.x86_64
/var/tmp/rpm-tmp.LDi2Rt: line 1: fg: no job control
/var/tmp/rpm-tmp.LDi2Rt: line 2: fg: no job control
/var/tmp/rpm-tmp.LDi2Rt: line 3: fg: no job control
error: %preun(lxc-1:5.0.3-1.mga10.x86_64) scriptlet failed, exit status 1
ERROR: 'script' failed for lxc-1:5.0.3-1.mga10.x86_64
error: lxc-1:5.0.3-1.mga10.x86_64: erase failed
Comment 2 Guillaume Bedot 2024-01-04 19:23:31 CET
(In reply to sturmvogel from comment #1)
> The errors are in the %post and %preun parts of the spec file...

Maybe i didn't noticed because I installed it part of multiple rpms :/
Comment 3 David GEIGER 2024-01-04 19:29:11 CET
There was a typo in post and preun systemd scriptlet, should be fixed in next lxc-5.0.3-2.mga10 update!

CC: (none) => geiger.david68210

Comment 4 Lewis Smith 2024-01-04 20:16:31 CET
Not for the first time, thank you for an instant fix.
Assigning to you.

CC: geiger.david68210 => (none)
Assignee: bugsquad => geiger.david68210

Comment 5 Guillaume Bedot 2024-01-04 21:08:47 CET
So, it was an untranslated macro...
It works for me now, thank you very much !

[root@cauldron ~]# urpmi lxc


    http://[::1]/distrib/cauldron/x86_64/media/core/release/lxc-5.0.3-2.mga10.x86_64.rpm
installing lxc-5.0.3-2.mga10.x86_64.rpm from /var/cache/urpmi/rpms             
Preparing...                     #############################################
      1/1: lxc                   #############################################
[root@cauldron ~]# urpme lxc
removing lxc-5.0.3-2.mga10.x86_64
removing package lxc-1:5.0.3-2.mga10.x86_64
      1/1: removing lxc-1:5.0.3-2.mga10.x86_64
                                 #############################################
Comment 6 Guillaume Bedot 2024-01-04 21:09:18 CET
Do I close myself the bug ?

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 7 David GEIGER 2024-01-04 21:10:43 CET
Reopened to fix also same error for mga9!

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 8 David GEIGER 2024-01-04 21:15:30 CET
Assigning to QA,

Packages in 9/Core/Updates_testing:
======================
liblxc-devel-5.0.3-1.mga9
liblxc1-5.0.3-1.mga9
lib64lxc-devel-5.0.3-1.mga9
lib64lxc1-5.0.3-1.mga9
lxc-5.0.3-1.mga9
lxc-doc-5.0.3-1.mga9.noarch.rpm


From SRPMS:
lxc-5.0.3-1.mga9.src.rpm

Assignee: geiger.david68210 => qa-bugs

David GEIGER 2024-01-04 21:15:38 CET

CC: (none) => geiger.david68210
Version: Cauldron => 9

Comment 9 Guillaume Bedot 2024-01-04 23:22:49 CET
Created attachment 14244 [details]
trying to upgrade lxc on mageia 9 then uninstall
Comment 10 Dave Hodgins 2024-01-04 23:42:30 CET
The only way to uninstall the old version of lxc is to run
"rpm -e --noscripts" lxc, and then install the new version.

Once the old version has been uninstalled, the new version can be installed
and uninstalled cleanly.

I think the old version can be uninstalled by using a lua scriptlet in
the new version, but am not sure. Check on the dev ml.

CC: (none) => davidwhodgins

PC LX 2024-01-05 00:48:30 CET

CC: (none) => mageia

Comment 11 Herman Viaene 2024-01-05 16:21:21 CET
MGA9-64 Plasma Wayland on HP Pavillion
No installation issues  (no previous version installed.
Used QARepo to install the 4 packages  plus dependencies, then
# urpme lxc
removing lxc-5.0.3-1.mga9.x86_64
removing package lxc-1:5.0.3-1.mga9.x86_64
      1/1: removing lxc-1:5.0.3-1.mga9.x86_64
                                 ###############################################################################################################
Removed the 3 others in MCC, all works OK.

CC: (none) => herman.viaene
Whiteboard: (none) => MGA9-64-OK

Comment 12 Thomas Andrews 2024-01-06 16:18:16 CET
I've been wondering what was going on here.

Urpmq indicates that lxc is required by waydroid, and that's it. I had installed waydroid in a VirtualBox Plasma guest for testing purposes a while back, then removed it later. Trying to remove all of it, I ran "urpme --auto-orphans" which failed to remove lxc. I don't use that command often because of all the dire warnings I've heard over the years, and thought little of the failure at the time. It didn't seem to hurt anything, and I got on with my life.

So with this bug I've revisited it. Wondering what would happen if this were presented as a simple update, I used qarepo to download the packages, and MCC to get updates - which was just lxc, no dependencies. There were no messages to indicate that anything had gone wrong.

So then I went to use urpme to remove orphans again, and I found that there were now TWO versions of lxc installed, both considered orphans. I told it to remove both, but it would only remove the new one. The old one still fails.

Using urpmi to update once more, this time I saw in the terminal where removing the old version had failed.

Removing the OK, because we need some way to remove that old version during a normal update procedure. Waydroid may have other problems preventing it from working as it should, but having two versions of lxc installed at the same time shouldn't be one of them.

Whiteboard: MGA9-64-OK => (none)
CC: (none) => andrewsfarm

Comment 13 Guillaume Bedot 2024-01-06 17:38:34 CET
I just was thinking, could rpmlint or some tool check for that kind of errors automatically ?
Comment 14 Dave Hodgins 2024-01-06 18:42:27 CET
(In reply to Thomas Andrews from comment #12)
<snip>
> Removing the OK, because we need some way to remove that old version during
> a normal update procedure. Waydroid may have other problems preventing it
> from working as it should, but having two versions of lxc installed at the
> same time shouldn't be one of them.

My understanding is that here are two version of lxc listed in the files in
/var/lib/rpm, but as the file names haven't changed within the lxc package,
there's only the last version installed actually present in the system.

It's messy, but as the error is in the package that's being removed, I'm
not sure if there is any way to fix it in the updated package.

Check on the dev ml. If there is a way to fix it using a lua script, great.
If not, the README.urpmi will have to be used to explain to the users that
the need to run "urpme lxc", followed by ""rpm -e --noscripts lxc", to
fix it, after which they can reinstall the fixed version.
katnatek 2024-01-06 21:05:06 CET

Source RPM: lxc-5.0.3-1.mga10.src.rpm => lxc-5.0.2-1.mga9.src.rpm

katnatek 2024-01-08 19:46:05 CET

Blocks: (none) => 32467

Comment 15 Marja Van Waes 2024-01-08 20:16:11 CET
(In reply to Dave Hodgins from comment #14)
> (In reply to Thomas Andrews from comment #12)
> <snip>
> > Removing the OK, because we need some way to remove that old version during
> > a normal update procedure. Waydroid may have other problems preventing it
> > from working as it should, but having two versions of lxc installed at the
> > same time shouldn't be one of them.
> 
> My understanding is that here are two version of lxc listed in the files in
> /var/lib/rpm, but as the file names haven't changed within the lxc package,
> there's only the last version installed actually present in the system.
> 
> It's messy, but as the error is in the package that's being removed, I'm
> not sure if there is any way to fix it in the updated package.
> 
> Check on the dev ml. If there is a way to fix it using a lua script, great.
> If not, the README.urpmi will have to be used to explain to the users that
> the need to run "urpme lxc", followed by ""rpm -e --noscripts lxc", to
> fix it, after which they can reinstall the fixed version.

Setting the "feedback" keyword.

CC: (none) => marja11
Keywords: (none) => feedback

katnatek 2024-01-09 02:29:31 CET

CC: (none) => ngompa13

Comment 16 katnatek 2024-01-09 02:31:04 CET
In one of my own packages I also make some mistakes in %pre, %post, %postun scripts, and also not find other choice that ask the users to first uninstall the buggy package and install the fixed package
@Neal do you know a good alternative to fix this?
Comment 17 Guillaume Bedot 2024-01-09 13:30:32 CET
so README.urpmi is the way to go, but we need a policy to say when to clean these files
Comment 18 Dave Hodgins 2024-01-09 17:53:59 CET Comment hidden (obsolete)
Comment 19 Dave Hodgins 2024-01-09 18:02:27 CET Comment hidden (obsolete)
Comment 20 Dave Hodgins 2024-01-09 18:10:18 CET
It should be until the release where the problem was present reaches end of support. In this case, that means any further update in m9 has to keep it.

The reasoning for that is that someone with the problem version installed
could update directly to the last m9 version just before upgrading to m10.

Skipping updates within a release has to work.

As upgrading to m10 from m9 will require all m9 updates to be installed, it can
be dropped from the m10 packages.
Comment 21 Guillaume Bedot 2024-01-09 19:21:58 CET
it makes sense for lxc package, the contents of README.urpmi files can be outdated for other reasons, or still be useful though
Comment 22 Guillaume Bedot 2024-01-09 19:37:46 CET
Maybe just a line at the begining stating "README of <package-version>, at <date>" would be be helpul enough idk
Comment 23 katnatek 2024-01-23 23:27:36 CET
Returning to David GEIGER

Assignee: qa-bugs => geiger.david68210

Comment 24 katnatek 2024-02-04 23:10:08 CET
@Thomas and Dave, if more time pass is more possible that other users get this issue
What do you think of validate and make an Errata?
Comment 25 katnatek 2024-02-14 00:00:08 CET
Is in Errata now, what we must do, wait to a "cosmetic" change (if the packager decide add a README.install.urpmi with the warming about the update issue due the fails of previous version) or give green light so avoid more bites of this bug?

Keywords: (none) => IN_ERRATA9

Comment 26 Dave Hodgins 2024-02-14 00:50:34 CET
If a lua scriptlet can not force uninstalling the old version without
executing the script from the old version, then the feedback keyword should
be removed, and the MGA9-64-OK,validated_update whiteboard entries added.
Comment 27 Dave Hodgins 2024-02-14 01:30:55 CET
The bug also needs to be reassigned back to qa-bugs@ml.mageia.org it no lua
script can work.
Comment 28 Thomas Andrews 2024-02-22 19:01:42 CET
This has been hanging around too long. Removing the feedback flag, and assigning back to QA.

Assignee: geiger.david68210 => qa-bugs
Keywords: feedback => (none)

Comment 29 Thomas Andrews 2024-02-22 19:06:44 CET
Giving this an OK, and validating the way it is. katnatek, we still need an advisory.

CC: (none) => sysadmin-bugs
Keywords: (none) => validated_update
Whiteboard: (none) => MGA9-64-OK

katnatek 2024-02-22 20:02:50 CET

Keywords: (none) => advisory

Comment 30 katnatek 2024-02-22 20:03:37 CET
type: bugfix
subject: Updated lxc packages fix packaging issues of lxc
src:
  9:
    core:
    - lxc-5.0.3-1.mga9
description: |
  lxc 5.0.2-1.mga9 presents errors when install or uninstall .
  lxc-5.0.3-1.mga9 fix that errors, but manual actions are required.
  See https://bugs.mageia.org/show_bug.cgi?id=32687#c10
references:
- https://bugs.mageia.org/show_bug.cgi?id=32687
- https://bugs.mageia.org/show_bug.cgi?id=32687#c10
- https://wiki.mageia.org/en/Mageia_9_Errata#Various_software
Comment 31 Mageia Robot 2024-02-22 20:30:54 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2024-0068.html

Resolution: (none) => FIXED
Status: REOPENED => RESOLVED


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