Bug 1789332

Summary: Erase fails with "rm failed: no such file or directory"
Product: [Fedora] Fedora Reporter: Horst H. von Brand <vonbrand>
Component: calibreAssignee: Kevin Fenzi <kevin>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 31CC: chkr, helio, kevin, nushio, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: calibre-4.12.0-1.fc31 calibre-4.12.0-1.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-15 13:42:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Horst H. von Brand 2020-01-09 11:36:10 UTC
Description of problem:
Sometimes packages seem to record non-installed files, or files get removed otherwise. The result is packages that can't be uninstalled regularly.
Has happened a few times when trying to update using dnf, the update fails (!), often leaving the obsolete, impossible to uninstall, package and the last version around.

I.e., here:

# rpm -e calibre-3.36.0-8.fc30
rm: cannot remove '/usr/share/calibre/viewer/mathjax': No such file or directory
error: %preun(calibre-3.36.0-8.fc30.x86_64) scriptlet failed, exit status 1
error: calibre-3.36.0-8.fc30.x86_64: erase failed

Version-Release number of selected component (if applicable):
rpm-4.15.1-1.fc31.x86_64

How reproducible:
Happens for a few packages each upgrade cycle...

Steps to Reproduce:
1. Install some package, delete a file from it
2. rpm -e <above package>

Actual results:
Complaint abount removing a non-existent file/directory, package isn't erased

Expected results:
Complaint is OK (may need investigation), but package should be erased. Specially if it was somehow mangled...


Additional info:
Possible workaround: Reinstall the broken package, then erase. Or create (touch(1) or mkdir(1) as needed) what is "missing", then erase.

Comment 1 Panu Matilainen 2020-01-09 11:41:13 UTC
This is a bug in the calibre package %preun scriptlet, not rpm.

Comment 2 Zbigniew Jędrzejewski-Szmek 2020-01-09 12:43:55 UTC
The scriptlet uses 'rm -f' in other branches, so it is fixed there. I pushed a commit to do the same in F30. Unfortunately, it's something that we can't fix retroactively, but since this is a special case, I think it's OK to just fix it for subsequent versions. I won't rebuild now.

Comment 3 Horst H. von Brand 2020-01-09 16:14:25 UTC
The same has happened to me with several packages. Perhaps an audit all-around is warranted? Some handholding for scriptlets?

Comment 4 Zbigniew Jędrzejewski-Szmek 2020-01-09 16:23:13 UTC
It's the (completely unreasonable imo) refusal of rpm maintainers to fix the glaring deficiency in rpm and to require maintainers to write complex scriptlets to make package upgrades work.

Comment 5 Fedora Update System 2020-03-07 02:07:22 UTC
FEDORA-2020-65a5d0462d has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-65a5d0462d

Comment 6 Fedora Update System 2020-03-07 17:17:08 UTC
calibre-4.12.0-1.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-df465db1c1

Comment 7 Fedora Update System 2020-03-08 01:37:22 UTC
calibre-4.12.0-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-65a5d0462d

Comment 8 Fedora Update System 2020-03-15 13:42:22 UTC
calibre-4.12.0-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2020-03-16 20:35:10 UTC
calibre-4.12.0-1.fc32 has been pushed to the Fedora 32 stable repository. If problems still persist, please make note of it in this bug report.