Bug 1292915 - Incorrect handling of Requires(pre)
Summary: Incorrect handling of Requires(pre)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libsolv
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1239322 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-18 17:52 UTC by Ville Skyttä
Modified: 2016-07-22 10:50 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-21 09:36:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
debugdata (1.52 MB, application/x-tar)
2015-12-23 18:33 UTC, Ville Skyttä
no flags Details
dnf remove gstreamer1-plugins-base (10.26 KB, text/plain)
2016-07-16 19:39 UTC, srakitnican
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1310840 0 unspecified CLOSED Removing gstreamer1-plugins-base pulls too many dependencies 2021-02-22 00:41:40 UTC

Internal Links: 1310840

Description Ville Skyttä 2015-12-18 17:52:40 UTC
# rpm -q dnf python3-dnf-plugins-extras-leaves samba-common
dnf-1.1.4-2.fc23.noarch
python3-dnf-plugins-extras-leaves-0.0.12-1.fc23.noarch
samba-common-4.3.3-0.fc23.noarch

# rpm -e --test samba-common
(no output)

# dnf leaves | grep samba
samba-client-2:4.3.3-0.fc23.x86_64
samba-common-2:4.3.3-0.fc23.noarch

# grep clean /etc/dnf/dnf.conf 
clean_requirements_on_remove=False

So, current up to date F23, nothing requires samba-common so it should be good to remove, and dnf is not set to clean deps on remove. However, it tries to remove a bunch of other stuff. I'm not sure if clean_requirements_on_remove=False works -- it used to work at least sometime, but maybe it was broken in 1.1.4 (see "Finding unneeded leftover dependencies" in the output)?


# dnf --noplugins -d 10 remove samba-common
timer: config: 5 ms
cachedir: /var/cache/dnf
DNF version: 1.1.4
Command: dnf 
Installroot: /
Releasever: 23
Base command: remove
Extra commands: ['samba-common']
timer: sack setup: 7 ms
--> Starting dependency resolution
--> Finding unneeded leftover dependencies
---> Package cifs-utils.x86_64 6.4-4.fc23 will be erased
---> Package control-center.x86_64 1:3.18.2-1.fc23 will be erased
---> Package gdm.x86_64 1:3.18.2-1.fc23 will be erased
---> Package gnome-classic-session.noarch 3.18.2-1.fc23 will be erased
---> Package gnome-initial-setup.x86_64 3.18.0-1.fc23 will be erased
---> Package gnome-shell.x86_64 3.18.3-1.fc23 will be erased
---> Package gnome-shell-extension-alternate-tab.noarch 3.18.2-1.fc23 will be erased
---> Package gnome-shell-extension-apps-menu.noarch 3.18.2-1.fc23 will be erased
---> Package gnome-shell-extension-background-logo.noarch 3.18.0-1.fc23 will be erased
---> Package gnome-shell-extension-common.noarch 3.18.2-1.fc23 will be erased
---> Package gnome-shell-extension-launch-new-instance.noarch 3.18.2-1.fc23 will be erased
---> Package gnome-shell-extension-places-menu.noarch 3.18.2-1.fc23 will be erased
---> Package gnome-shell-extension-window-list.noarch 3.18.2-1.fc23 will be erased
---> Package gvfs-smb.x86_64 1.26.2-1.fc23 will be erased
---> Package libsmbclient.x86_64 2:4.3.3-0.fc23 will be erased
---> Package libwbclient.x86_64 2:4.3.3-0.fc23 will be erased
---> Package pulseaudio-gdm-hooks.x86_64 7.1-1.fc23 will be erased
---> Package samba-client.x86_64 2:4.3.3-0.fc23 will be erased
---> Package samba-client-libs.x86_64 2:4.3.3-0.fc23 will be erased
---> Package samba-common.noarch 2:4.3.3-0.fc23 will be erased
---> Package samba-common-libs.x86_64 2:4.3.3-0.fc23 will be erased
--> Finished dependency resolution
timer: depsolve: 116 ms
Dependencies resolved.
===================================================================================
 Package                             Arch   Version         Repository        Size
===================================================================================
Removing:
 cifs-utils                          x86_64 6.4-4.fc23      @koji-override-0 175 k
 control-center                      x86_64 1:3.18.2-1.fc23 @updates          18 M
 gdm                                 x86_64 1:3.18.2-1.fc23 @updates         3.3 M
 gnome-classic-session               noarch 3.18.2-1.fc23   @updates         194 k
 gnome-initial-setup                 x86_64 3.18.0-1.fc23   @koji-override-0 2.1 M
 gnome-shell                         x86_64 3.18.3-1.fc23   @updates         9.3 M
 gnome-shell-extension-alternate-tab noarch 3.18.2-1.fc23   @updates         9.4 k
 gnome-shell-extension-apps-menu     noarch 3.18.2-1.fc23   @updates          26 k
 gnome-shell-extension-background-logo
                                     noarch 3.18.0-1.fc23   @koji-override-0  56 k
 gnome-shell-extension-common        noarch 3.18.2-1.fc23   @updates         545 k
 gnome-shell-extension-launch-new-instance
                                     noarch 3.18.2-1.fc23   @updates         4.9 k
 gnome-shell-extension-places-menu   noarch 3.18.2-1.fc23   @updates          23 k
 gnome-shell-extension-window-list   noarch 3.18.2-1.fc23   @updates          56 k
 gvfs-smb                            x86_64 1.26.2-1.fc23   @updates          92 k
 libsmbclient                        x86_64 2:4.3.3-0.fc23  @updates         156 k
 libwbclient                         x86_64 2:4.3.3-0.fc23  @updates          70 k
 pulseaudio-gdm-hooks                x86_64 7.1-1.fc23      @updates         354  
 samba-client                        x86_64 2:4.3.3-0.fc23  @updates         1.7 M
 samba-client-libs                   x86_64 2:4.3.3-0.fc23  @updates          18 M
 samba-common                        noarch 2:4.3.3-0.fc23  @updates         119 k
 samba-common-libs                   x86_64 2:4.3.3-0.fc23  @updates         273 k

Transaction Summary
===================================================================================
Remove  21 Packages

Installed size: 54 M
Is this ok [y/N]: 
Operation aborted.
Cleaning up.

Comment 1 Honza Silhan 2015-12-23 13:55:57 UTC
Thanks for the report. Please, provide debugdata [1]. Have you noticed this regression in previous DNF version too?

[1] https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting#dependency-resolution-problem

Comment 2 Ville Skyttä 2015-12-23 18:33:10 UTC
Created attachment 1108985 [details]
debugdata

This is the first version that I've noticed the problem with. But I cannot say for sure it hasn't been there in some older versions versions.

Comment 3 Sergio Basto 2016-02-12 23:34:44 UTC
The problem is : 
rpm -q libsmbclient  --requires | grep samba-common
samba-common = 2:4.3.4-1.fc23

rpm -q samba --requires | grep samba-common
samba-common = 2:4.3.4-1.fc23

That is the difference between dnf and rpm . 

when libsmbclient and samba does not require samba-common etc should have the same results .

1- Of course, libsmbclient and samba shouldn't require samba-common .
2- if packages have the requires , rpm should obey , but don't , so for me is a bug in rpm .

Comment 4 Ville Skyttä 2016-02-13 08:14:04 UTC
(In reply to Sergio Monteiro Basto from comment #3)
> The problem is : 

I don't see any problem in that comment. But anyway:

1) I don't have samba installed so that's not relevant to my scenario.

2) The dependency on samba-common in libsmbclient is a "Requires(pre)", so it should not prevent removal of samba-common because the %pre scriptlet of libsmbclient has obviously been run as both packages are already installed. And it doesn't prevent removal with rpm, but apparently does with dnf, hence it's an issue with dnf (but not sure if it's a generic one or just clean_requirements_on_remove thing).

Comment 5 Sergio Basto 2016-02-14 04:53:56 UTC
(In reply to Ville Skyttä from comment #4)
> (In reply to Sergio Monteiro Basto from comment #3)
> > The problem is : 
> I don't see any problem in that comment. But anyway:
> 1) I don't have samba installed so that's not relevant to my scenario.
> 
> 2) The dependency on samba-common in libsmbclient is a "Requires(pre)",

That is the problem/bug the rpm --requires of libsmbclient have samba-common included, should be that, that confuses dnf . 
How do you know that is a "Requires(pre)" ? have you any command that show that or you watch on spec file ? 

> so
> it should not prevent removal of samba-common because the %pre scriptlet of
> libsmbclient has obviously been run as both packages are already installed.

Correct 

> And it doesn't prevent removal with rpm, but apparently does with dnf, hence
> it's an issue with dnf (but not sure if it's a generic one or just
> clean_requirements_on_remove thing).

Seems to me that dnf difference to yum is just when we got "Requires(pre)" .

Comment 6 Ville Skyttä 2016-02-14 07:44:55 UTC
(In reply to Sergio Monteiro Basto from comment #5)
> How do you know that is a "Requires(pre)" ? have you any command that show
> that or you watch on spec file ? 

I suppose a command or some rpm query formatting to getfor that exists as well, but I'm not aware of it, I'm just looking at the specfile.

So, maybe we're looking at two bugs here:

1) The incorrect behavior with Requires(pre) and friends, and

2) The debug output which says "--> Finding unneeded leftover dependencies" even when clean_requirements_on_remove is False and it in fact is not (or should not) be finding those in that case. Maybe it's not actually doing that and just the confusing message should be removed.

Comment 7 Honza Silhan 2016-03-11 09:07:06 UTC
reported in libsolv: https://github.com/openSUSE/libsolv/issues/126

Comment 8 Honza Silhan 2016-03-11 09:07:33 UTC
*** Bug 1310840 has been marked as a duplicate of this bug. ***

Comment 9 Justas Zemgulys 2016-03-19 22:55:09 UTC
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=1284349

Comment 10 Sergio Basto 2016-04-01 12:51:48 UTC
Meaning of Requires(pre) in email https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/NGPJMDUVEW65TQSD262G6OQF6P6LWWRM/
it emphasizes that this is a bug: Any package that is specified in `Requires(pre)` could be freely removed after installation.

Comment 11 Michal Luscon 2016-04-18 08:09:06 UTC
*** Bug 1239322 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Admin XMLRPC Client 2016-07-08 09:23:11 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 13 srakitnican 2016-07-16 19:39:28 UTC
Created attachment 1180540 [details]
dnf remove gstreamer1-plugins-base

Were there any changes in this regard?

Current list taken from rawhide regarding bug #1310840 seems a bit different (different packages involved) but still quite big.

Comment 14 Igor Gnatenko 2016-07-21 09:36:53 UTC
commit 6afc1750d97d0297cb397278c20b962bc3b24209
Author: Michael Schroeder <mls>
Date:   Thu Apr 7 17:09:14 2016 +0200

    Implement filtering of Requires(pre,post) for installed packages
    
    Should fix issue#126. Except that we need to support it in
    the testcases as well.


Looks like this has been fixed. If not - reopen please.

Comment 15 srakitnican 2016-07-21 18:41:32 UTC
(In reply to Igor Gnatenko from comment #14)
> commit 6afc1750d97d0297cb397278c20b962bc3b24209
> Author: Michael Schroeder <mls>
> Date:   Thu Apr 7 17:09:14 2016 +0200
> 
>     Implement filtering of Requires(pre,post) for installed packages
>     
>     Should fix issue#126. Except that we need to support it in
>     the testcases as well.
> 
> 
> Looks like this has been fixed. If not - reopen please.

This patch landed in libsolv 0.6.20, right? 

Previous report was made with libsolv-0.6.22-1.fc25.x86_64.

Comment 16 Igor Gnatenko 2016-07-21 19:29:37 UTC
(In reply to srakitnican from comment #15)
> (In reply to Igor Gnatenko from comment #14)
> > commit 6afc1750d97d0297cb397278c20b962bc3b24209
> > Author: Michael Schroeder <mls>
> > Date:   Thu Apr 7 17:09:14 2016 +0200
> > 
> >     Implement filtering of Requires(pre,post) for installed packages
> >     
> >     Should fix issue#126. Except that we need to support it in
> >     the testcases as well.
> > 
> > 
> > Looks like this has been fixed. If not - reopen please.
> 
> This patch landed in libsolv 0.6.20, right? 
> 
> Previous report was made with libsolv-0.6.22-1.fc25.x86_64.

it's different issue - open new bug.

Comment 17 Sergio Basto 2016-07-21 21:59:42 UTC
rpm -q libsmbclient  --requires | grep samba-common
samba-common = 2:4.4.5-1.fc23

dnf remove samba-common

no libsmbclient on list to be removed , test successful :-)

Comment 18 Igor Gnatenko 2016-07-22 05:28:26 UTC
(In reply to Sergio Monteiro Basto from comment #17)
> rpm -q libsmbclient  --requires | grep samba-common
> samba-common = 2:4.4.5-1.fc23
> 
> dnf remove samba-common
> 
> no libsmbclient on list to be removed , test successful :-)
this is not something what this bug is about.

Please, if you found bug - open new one instead of writing here 5 random bugs/notabugs.

Comment 19 Sergio Basto 2016-07-22 10:50:41 UTC
(In reply to Igor Gnatenko from comment #18)
> (In reply to Sergio Monteiro Basto from comment #17)
> > rpm -q libsmbclient  --requires | grep samba-common
> > samba-common = 2:4.4.5-1.fc23
> > 
> > dnf remove samba-common
> > 
> > no libsmbclient on list to be removed , test successful :-)
>
> this is not something what this bug is about.
> 
> Please, if you found bug - open new one instead of writing here 5 random
> bugs/notabugs.

The opposite , we find this bug with the example above and now it is fixed , ( test successful  ) 

Thanks,


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