Bug 2158332

Summary: apptainer: installing apptainer while singularity is installed is causing transaction check conflict errors
Product: [Fedora] Fedora EPEL Reporter: Carl George 🤠 <carl>
Component: apptainerAssignee: Dave Dykstra <dwd>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: dwd, go-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: apptainer-1.1.5-1.fc37 apptainer-1.1.5-1.el9 apptainer-1.1.5-1.el8 apptainer-1.1.5-1.el7 apptainer-1.1.5-1.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-19 06:10:30 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:
Bug Depends On: 2159814    
Bug Blocks:    

Description Carl George 🤠 2023-01-05 05:51:13 UTC
Description of problem:
(Originally filed in the EPEL tracker [0], transposed here.)

After the change required by #215 [1], where the Obsoletes: singularity was moved to apptainer-suid and the Provides: singularity was removed, now when someone does 'yum install apptainer' on a system where singularity is already installed it attempts to do the install of apptainer without removing singularity.


Version-Release number of selected component (if applicable):
apptainer-1.1.4-2.el7


How reproducible:
always


Steps to Reproduce:
1. yum install https://kojipkgs.fedoraproject.org//packages/singularity/3.8.7/1.el7/x86_64/singularity-3.8.7-1.el7.x86_64.rp
2. yum install apptainer


Actual results:
Transaction check error:
  file /usr/bin/run-singularity from install of apptainer-1.1.4-2.el7.x86_64 conflicts with file from package singularity-3.8.7-1.el7.x86_64
  file /usr/bin/singularity from install of apptainer-1.1.4-2.el7.x86_64 conflicts with file from package singularity-3.8.7-1.el7.x86_64
  file /usr/share/man/man1/singularity-build.1.gz from install of apptainer-1.1.4-2.el7.x86_64 conflicts with file from package singularity-3.8.7-1.el7.x86_64
...


Expected results:
successful install


Additional info:
[0] https://pagure.io/epel/issue/216
[1] https://pagure.io/epel/issue/215

Comment 1 Carl George 🤠 2023-01-05 06:09:48 UTC
I can see that an obsoletes was added to apptainer-1.1.4-3 [0].  This is probably not the best fix, and doesn't line up with the recommendation given by the EPEL steering committee [1].  Please revert it.  Instead, you can just add a conflicts to apptainer.  That will prevent the long error message, and instead just inform users that apptainer and singularity can't be installed at the same time.  The correct thing still happens when users run `yum update` (apptainer-suid and apptainer are installed, singularity is removed).

apptainer:
Conflicts: singularity < 3.8.7-4

apptainer-suid:
Obsoletes: singularity < 3.8.7-4


[0] https://src.fedoraproject.org/rpms/apptainer/c/9a95af1ffb7ece3b1ae2ef1cb2ae70ea370f5052?branch=rawhide
[1] https://pagure.io/epel/issue/215

Comment 2 Dave Dykstra 2023-01-05 13:02:41 UTC
That is another possibility I had thought of and it's probably what I'll do, but first please explain why having a Conflicts is better than Obsoletes.  The second Obsoletes still has the same effect with a `yum update`, and it is more convenient for the users.

Comment 3 Carl George 🤠 2023-01-05 18:35:05 UTC
The effect is only the same with dnf (or the yum symlink to dnf).  Having two packages obsolete one package doesn't work the same in actual yum in EL7.  In your given scenario (having singularity installed and trying to install apptainer before running `yum update`), it results in only apptainer being installed, not apptainer-suid.  apptainer-suid isn't pulled in by future updates either.  Based on this and the discussions about apptainer compatibility, the correct action is to only have apptainer-suid have the obsoletes, and to add just a conflicts to apptainer.

Comment 4 Dave Dykstra 2023-01-05 19:47:05 UTC
> In your given scenario (having singularity installed and trying to install apptainer before running `yum update`), it results in only apptainer being installed, not apptainer-suid. 

But that's exactly what users expect if they are explicitly asking for apptainer.  If they are asking for that package, they obviously are aware of the name change, and they will expect it to replace the singularity rpm and to be non-suid by default because that's what apptainer is.  If on the other hand they do `yum update singularity` they will still get both packages, even with yum on EL7.  So it seems to me to be exactly the expected and correct behavior.

If I haven't convinced you and don't hear any different from other EPEL Steering Committee members, I will go ahead and do what you ask but submit a second request to FESCo to change it from Conflicts to Obsoletes, in addition to the request I plan to submit for adding "Provides: singularity" to apptainer-suid.  I really believe that both are best for the users and are what users expect.

I'm expecting an apptainer 1.1.5 release early next week, so I think the packaging change will be made along with that release.

Comment 5 Dave Dykstra 2023-01-05 20:09:22 UTC
Oh, but as you alluded too, the dnf behavior with the second Obsoletes is different, to install both packages.  I think that is unexpected behavior.  So maybe the Conflicts is better after all, so people can get only the package they ask for after removing singularity.

Comment 6 Carl George 🤠 2023-01-05 21:07:31 UTC
> But that's exactly what users expect if they are explicitly asking for apptainer.  If they are asking for that package, they obviously are aware of the name change, and they will expect it to replace the singularity rpm and to be non-suid by default because that's what apptainer is.

I'm not sure that's always true.  And even when it is, using a conflicts is still better so we're not assuming user intent.  With just a conflicts, no obsoletes, it would look like this:

- have singularity installed
- `yum install apptainer`
- see that apptainer conflicts with the installed singularity
- uninstall singularity and then install apptainer, either separately or in the same transaction (`yum swap` or `yum shell`)

That is a perfectly fine workflow that makes no assumptions.  There really is no significant benefit to having the obsoletes on apptainer also.  The recommended path is available via `yum update`.  Between that and the difference in behavior between dnf and yum, just sticking with the conflicts is best.

Comment 7 Dave Dykstra 2023-01-06 02:04:34 UTC
Ok I was convinced to do it, but I tried putting in a "Conflicts: singularity <= 3.8.7-3" on the apptainer package and I don't see the behavior you were expecting.  On both EL7 and EL8, a `yum install apptainer` while singularity is installed surpringly installs both apptainer and apptainer-suid.  On EL7 it gives these details:

--> Running transaction check
---> Package apptainer.x86_64 0:1.1.4~0.0.20230105170603.dwd.305.g8d1a657git-1.el7 will be installed
--> Processing Conflict: apptainer-1.1.4~0.0.20230105170603.dwd.305.g8d1a657git-1.el7.x86_64 conflicts singularity <= 3.8.7-3
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package apptainer-suid.x86_64 0:1.1.4~0.0.20230105170603.dwd.305.g8d1a657git-1.el7 will be obsoleting
---> Package singularity.x86_64 0:3.8.7-1 will be obsoleted
--> Finished Dependency Resolution

So I don't know if there is a way to make it do anything else (other than on EL7 an Obsoletes will install only apptainer).

Comment 8 Dave Dykstra 2023-01-06 15:29:43 UTC
(I wish that bugzilla had an edit feature.  surpringly -> surprisingly)

Comment 9 Carl George 🤠 2023-01-06 19:47:31 UTC
Ah, that's good that yum is actually smart enough to see a resolution path (installing apptainer-suid to obsolete singularity in the same transaction).  That's the end goal anyways and the same thing that would happen if a users runs `yum update`.

Comment 10 Dave Dykstra 2023-01-10 20:41:21 UTC
I think it would surprise users, but it's at least consistent and I don't know anything better, so is in the 1.1.5 version that was just released

https://github.com/apptainer/apptainer/pull/990

Comment 11 Fedora Update System 2023-01-10 23:41:49 UTC
FEDORA-2023-0be2c66af0 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2023-0be2c66af0

Comment 12 Fedora Update System 2023-01-10 23:41:50 UTC
FEDORA-EPEL-2023-253bcc4444 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-253bcc4444

Comment 13 Fedora Update System 2023-01-10 23:41:50 UTC
FEDORA-2023-d139c5b447 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-d139c5b447

Comment 14 Fedora Update System 2023-01-10 23:41:51 UTC
FEDORA-EPEL-2023-0b5a551aaf has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-0b5a551aaf

Comment 15 Fedora Update System 2023-01-10 23:41:51 UTC
FEDORA-EPEL-2023-bdb426dc1d has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-bdb426dc1d

Comment 16 Fedora Update System 2023-01-11 01:50:10 UTC
FEDORA-EPEL-2023-0b5a551aaf has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-0b5a551aaf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 17 Fedora Update System 2023-01-11 01:59:19 UTC
FEDORA-EPEL-2023-bdb426dc1d has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-bdb426dc1d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2023-01-11 02:08:18 UTC
FEDORA-EPEL-2023-253bcc4444 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-253bcc4444

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2023-01-11 02:41:26 UTC
FEDORA-2023-d139c5b447 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-d139c5b447`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-d139c5b447

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2023-01-11 02:43:43 UTC
FEDORA-2023-0be2c66af0 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-0be2c66af0`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-0be2c66af0

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2023-01-19 06:10:30 UTC
FEDORA-2023-d139c5b447 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Fedora Update System 2023-01-19 10:01:13 UTC
FEDORA-EPEL-2023-0b5a551aaf has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Fedora Update System 2023-01-19 10:36:11 UTC
FEDORA-EPEL-2023-bdb426dc1d has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 Fedora Update System 2023-01-19 11:16:47 UTC
FEDORA-EPEL-2023-253bcc4444 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 25 Fedora Update System 2023-01-19 13:14:02 UTC
FEDORA-2023-0be2c66af0 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.