Bug 975909 - rpm fails when there are dir<->symlink replacements and the package gets split into sub-packages
Summary: rpm fails when there are dir<->symlink replacements and the package gets spli...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 37
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 974840 1054396 2123422
TreeView+ depends on / blocked
 
Reported: 2013-06-19 15:04 UTC by Adam Goode
Modified: 2022-09-21 12:50 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 12:50:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Goode 2013-06-19 15:04:39 UTC
Description of problem:

RPM cannot replace a symlink with a directory or vice-versa. To work around this, you must use a %pretrans script in the specfile. In RPM 4.11 (see bug 447156), RPM was changed to detect and report such invalid operations as file conflicts (before this, it would just fail later). These conflicts do not occur in RPM when the proper %pretrans script is used to fix up the symlinks and directories.

Unfortunately, yum now fails in transaction test (it does not execute pretrans?). So packages that need to replace symlinks with directories cannot be upgraded in Fedora 19.


Version-Release number of selected component (if applicable):
yum-3.4.3-95.fc19.noarch
rpm-4.11.0.1-2.fc19.x86_64


How reproducible:
Always.

Steps to Reproduce:
1. On Fedora 19, install golang-1.1-2 from koji: http://kojipkgs.fedoraproject.org//packages/golang/1.1/2.fc19/x86_64/golang-1.1-2.fc19.x86_64.rpm
2. yum upgrade golang

Actual results:
Transaction check error
(pages of output)

Expected results:
No error.

Additional info:
This might require a revert of this behavior in rpm?

Comment 1 Panu Matilainen 2013-06-20 05:10:14 UTC
Although yum's the one with symptoms, the problem is on rpm side in these cases.

Comment 2 Panu Matilainen 2013-06-20 09:07:17 UTC
Okay, the issue is caused by heuristics in rpm 4.11.x which decide when to let dir<->symlink replacement conflicts through in test-transactions: the heuristics fail to catch the case when package gets split into sub-packages. This can be triggered by rpm too with 'rpm -Uvh --test'.

The heuristics need to be fixed to allow for package splits, but the conflict detection itself is not going away.

Comment 3 Panu Matilainen 2013-06-20 09:41:23 UTC
Err, spoke too soon. The issue is not specific to rpm 4.11 at all, it happens with older rpm versions (4.9.x and 4.10.x tested) as well if you run with 'rpm -Uvh --test', which is what yum does before doing the actual transaction.

So AFAICS the golang update is broken for all Fedora versions.

Comment 4 Adam Goode 2013-06-20 15:16:06 UTC
Ok. I will try eliminating the subpackages as a workaround. Do you think I could keep them in rawhide?

Comment 5 Adam Goode 2013-06-29 02:25:45 UTC
This happens even when I eliminate the subpackage:
/usr/share/golang/src/pkg/unicode/digit.go conflicts between attempted installs of golang-1.1.1-4.fc19.x86_64 and golang-1.1.1-4.fc19.x86_64

Self-conflicts?

Comment 6 Panu Matilainen 2013-07-02 10:23:24 UTC
Self-conflicts are entirely possible through directory symlinks, but rpm versions prior to 4.10 didn't notice them.

Comment 7 Fedora Update System 2013-07-05 04:27:34 UTC
golang-1.1.1-4.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/golang-1.1.1-4.fc18

Comment 8 Fedora Update System 2013-07-05 04:27:59 UTC
golang-1.1.1-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/golang-1.1.1-4.fc17

Comment 9 Fedora Update System 2013-07-05 04:28:20 UTC
golang-1.1.1-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/golang-1.1.1-4.fc19

Comment 10 Panu Matilainen 2013-07-05 09:15:49 UTC
A golang update could not address an rpm bug :) Switching component...

Comment 11 Adam Goode 2013-07-05 15:16:52 UTC
Sorry, I had the wrong bug in https://admin.fedoraproject.org/updates !

Also, I think I have worked around this, so if it is not a valid bug anymore, please close.

Comment 12 Simone Caronni 2013-07-18 09:21:34 UTC
I still have this problem, and I cannot work around as in the aforementioned golang. I have an update that is giving a conflict on itself for a symlink that should disappear.

# yum --enablerepo=temp update
Loaded plugins: langpacks, refresh-packagekit
Resolving Dependencies
--> Running transaction check
---> Package guacamole.noarch 0:0.8.1-2.fc19 will be updated
---> Package guacamole.noarch 0:0.8.2-1.fc19 will be obsoleting
---> Package guacamole-common.noarch 0:0.8.0-5.fc19 will be obsoleted
---> Package guacamole-common-js.noarch 0:0.7.1-3.fc19 will be obsoleted
---> Package guacamole-ext.noarch 0:0.8.0-4.fc19 will be obsoleted
---> Package guacd.x86_64 0:0.7.0-7.fc19 will be updated
---> Package guacd.x86_64 0:0.8.2-1.fc19 will be an update
---> Package libguac.x86_64 0:0.7.0-5.fc19 will be updated
---> Package libguac.x86_64 0:0.8.2-1.fc19 will be an update
---> Package libguac-client-rdp.x86_64 0:0.7.4-3.fc19 will be updated
---> Package libguac-client-rdp.x86_64 0:0.8.2-1.fc19 will be an update
---> Package libguac-client-ssh.x86_64 0:0.8.0-3.fc19 will be updated
---> Package libguac-client-ssh.x86_64 0:0.8.2-1.fc19 will be an update
---> Package libguac-client-vnc.x86_64 0:0.7.2-3.fc19 will be updated
---> Package libguac-client-vnc.x86_64 0:0.8.2-1.fc19 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                   Arch          Version              Repository   Size
================================================================================
Installing:
 guacamole                 noarch        0.8.2-1.fc19         temp        1.2 M
     replacing  guacamole-common.noarch 0.8.0-5.fc19
     replacing  guacamole-common-js.noarch 0.7.1-3.fc19
     replacing  guacamole-ext.noarch 0.8.0-4.fc19
Updating:
 guacd                     x86_64        0.8.2-1.fc19         temp         13 k
 libguac-client-rdp        x86_64        0.8.2-1.fc19         temp         30 k
 libguac-client-ssh        x86_64        0.8.2-1.fc19         temp         23 k
 libguac-client-vnc        x86_64        0.8.2-1.fc19         temp        9.6 k
Updating for dependencies:
 libguac                   x86_64        0.8.2-1.fc19         temp         30 k

Transaction Summary
================================================================================
Install  1 Package
Upgrade  4 Packages (+1 Dependent package)

Total download size: 1.3 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for temp
--------------------------------------------------------------------------------
Total                                            53 MB/s | 1.3 MB     00:00     
Running transaction check
Running transaction test


Transaction check error:
  file /usr/share/tomcat/webapps/guacamole/guacamole-common-js from install of guacamole-0.8.2-1.fc19.noarch conflicts with file from package guacamole-0.8.1-2.fc19.noarch

Error Summary
-------------


The file "/usr/share/tomcat/webapps/guacamole/guacamole-common-js" was a symlink in guacamole-0.8.1-2.fc19.noarch, now it's a folder since the other guacamole-common-js is now contained in guacamole-0.8.2-1.fc19.noarch.

How to deal with such situation?
What are the "%pretrans" hacks mentioned?
I'm bumping the priority as this is preventing me to push updates to Fedora.

Thanks,
--Simone

Comment 13 Simone Caronni 2013-07-18 09:30:27 UTC
Well, I've looked to all bugs referenced and this is happening since 2008!

There are many workarounds floating in packages, like this one:

http://pkgs.fedoraproject.org/cgit/groff.git/commit/?id=036f949b899bb5d933e38760bf36995ca47df847

Is this the intended way to deal with the problem?

Comment 14 Simone Caronni 2013-08-26 08:54:03 UTC
ping?

Bumped distribution to f20, as it happens there as well...

Comment 15 Panu Matilainen 2014-01-20 14:09:08 UTC
This should be fixed in rpm >= 4.12, there was an issue where a %pretrans-removed symlink was still considered in fingerprinting, causing a bogus conflict to be reported:
http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=bcba176fbf0d2cae4d0ee01c0f1b19dde181fc59

If you can test your particular case with the rawhide rpm, that'd be appreciated.

Comment 16 Simone Caronni 2014-01-20 14:43:14 UTC
Thanks, I will try to test it this week. Need some time to set up a Rawhide system between one meeting and the other.

Comment 17 Severin Gehwolf 2014-02-17 14:58:39 UTC
(In reply to Panu Matilainen from comment #15)
> This should be fixed in rpm >= 4.12, there was an issue where a
> %pretrans-removed symlink was still considered in fingerprinting, causing a
> bogus conflict to be reported:
> http://rpm.org/gitweb?p=rpm.git;a=commitdiff;
> h=bcba176fbf0d2cae4d0ee01c0f1b19dde181fc59
> 
> If you can test your particular case with the rawhide rpm, that'd be
> appreciated.

The latest rawhide build is rpm-4.11.2-1.fc21 I believe. This build does not yet let me update a symlink with a directory using yum. rpm -Uvh works, but yum install fails (similar to rpm -Uvh --test). See bug 1054396 for details as to how to reproduce. RPM from rawhide does not fix the problem for me.

Comment 18 Richard Fearn 2014-04-04 21:59:41 UTC
(In reply to Severin Gehwolf from comment #17)
> (In reply to Panu Matilainen from comment #15)
> > This should be fixed in rpm >= 4.12, there was an issue where a
> > %pretrans-removed symlink was still considered in fingerprinting, causing a
> > bogus conflict to be reported:
> > http://rpm.org/gitweb?p=rpm.git;a=commitdiff;
> > h=bcba176fbf0d2cae4d0ee01c0f1b19dde181fc59
> > 
> > If you can test your particular case with the rawhide rpm, that'd be
> > appreciated.
> 
> The latest rawhide build is rpm-4.11.2-1.fc21 I believe. This build does not
> yet let me update a symlink with a directory using yum. rpm -Uvh works, but
> yum install fails (similar to rpm -Uvh --test). See bug 1054396 for details
> as to how to reproduce. RPM from rawhide does not fix the problem for me.

Panu backported the fix to 4.11.2:

  http://rpm.org/gitweb?p=rpm.git;a=commit;h=7e5d0fa5b9089598765d1f0b9f3fbb1517175107

but I can confirm that with 4.11.2-2.fc20, "yum upgrade" behaves differently to "rpm -U", and the problem I described here:

  https://lists.fedoraproject.org/pipermail/devel/2013-December/193266.html

still exists when using "yum upgrade" (though not with "rpm -U").

I found bug 1076552 and discovered that a fix for that bug is now in rawhide. The latest build is 4.11.2-4.fc21 (http://koji.fedoraproject.org/koji/buildinfo?buildID=507188).

With 4.11.2-4.fc21 the problem does seem to be fixed, and old files are not left behind when upgrading the 'test' package using "yum upgrade".

Panu, do you think the bug 1076552 fix will make its way into F20? Unless I am mistaken, the solution for replacing a symlink to a directory with a directory, documented here:

  https://fedoraproject.org/wiki/Packaging:Directory_Replacement

leaves behind old files.

Comment 19 Fedora End Of Life 2015-05-29 09:07:57 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 20 Fedora End Of Life 2015-06-30 01:22:51 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 21 Simone Caronni 2022-09-02 14:22:45 UTC
Happening again on Fedora 37:

https://bugzilla.redhat.com/show_bug.cgi?id=2123422

In the lv2-devel package a symlink is replaced by a directory in an update:

Before: /usr/include/lv2/atom -> ../../lib64/lv2/atom.lv2
After: /usr/include/lv2/atom/

Comment 22 Michal Domonkos 2022-09-12 12:55:23 UTC
This is a known issue, have you consulted https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/ ?

Comment 23 Simone Caronni 2022-09-21 12:50:46 UTC
No I missed that page, I was not aware.

Beside that, I've seen the bug was closed to inactivity and thought it was a good idea not to lose it.
But based on the packaging guidelines page and your answer I guess at this point there is no plan to fix it.

Nevermind then, thanks.


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