Bug 785690 - cannot upgrade rsyslog, due to removed requires(post).
Summary: cannot upgrade rsyslog, due to removed requires(post).
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 16
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 552818 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-30 11:23 UTC by Klaas Vantournhout
Modified: 2014-01-21 23:20 UTC (History)
16 users (show)

Fixed In Version: yum-3.4.3-23.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-02 23:27:54 UTC
Type: ---


Attachments (Terms of Use)

Description Klaas Vantournhout 2012-01-30 11:23:06 UTC
Description of problem:
Upgrading rsyslog to version 5.8.7-1.fc16.x86_64 fails due to dependency problems.

Version-Release number of selected component (if applicable):
5.8.7-1.fc16.x86_64

How reproducible:
always at the moment

Steps to Reproduce:
1.yum upgrade rsyslog

Downloading Packages:
Running Transaction Check
ERROR with transaction check vs depsolve:
systemd-sysv is needed by rsyslog-5.8.7-1.fc16.x86_64
Please report this error in http://yum.baseurl.org/report
** Found 25 pre-existing rpmdb problem(s), 'yum check' output follows:
(all systemd-sysv related)

Comment 1 Klaas Vantournhout 2012-02-01 16:33:24 UTC
ping!

Comment 2 Tomas Heinrich 2012-02-02 10:56:02 UTC
Works for me.
Do you have systemd-sysv installed?
Do you have yum repositories set up correctly?
You might try to clean up yum cache and attempt to update again.

Comment 3 Klaas Vantournhout 2012-02-02 17:35:18 UTC
My repositories are set up correctly, however systemd-sysv was not installed. How come that this is not installed while so many packages require it. Should dependencies not resolve this?

Comment 4 Tomas Heinrich 2012-02-03 10:11:05 UTC
I'm not really sure why it failed.

From which version of rsyslog did you upgrade?
Is this a clean install of f16 or an upgrade from a previous version?

The f16 package should have the correct dependencies. The f15 package seems to miss the systemd-sysv dep, but the issue doesn't seem to be rsyslog specific as per the report.
Reassigning to systemd.

Comment 5 Klaas Vantournhout 2012-02-03 10:30:43 UTC
It was a clean install of f16.

Comment 6 Michal Schmidt 2012-02-03 12:02:02 UTC
It's a dependency for the %post scriptlet. rsyslog.spec says:
  Requires(post): systemd-sysv

I don't see systemd doing anything wrong. Moving to yum.

Comment 7 James Antill 2012-02-03 21:25:24 UTC
> ** Found 25 pre-existing rpmdb problem(s), 'yum check' output follows:
> (all systemd-sysv related)

...this means that the problems are already in the rpmdb, and need to be fixed before yum can behave "well" (yum assumes that if rsyslog needs XYZ and rsyslog is installed, and XYZ is installed).
 Just install everything it needs, or remove it and then install it again.

Comment 8 Michal Schmidt 2012-02-06 11:09:58 UTC
(In reply to comment #7)
> ...this means that the problems are already in the rpmdb, and need to be fixed
> before yum can behave "well" (yum assumes that if rsyslog needs XYZ and rsyslog
> is installed, and XYZ is installed).

One problem is that yum happily moves the rpmdb into that broken state.

Initial state: Both rsyslog and systemd-sysv are installed, "yum check" is clean.
# yum remove systemd-sysv
[... completes successfully without complaints ...]
# yum check
...
rsyslog-5.8.5-1.fc16.x86_64 has missing requires of systemd-sysv
...
Error: check all

Comment 9 Bill Nottingham 2012-02-06 16:56:36 UTC
If it's Requires(post), you can remove it once it's installed. I suppose it should be pulled back in on upgrade?

Comment 10 James Antill 2012-02-06 20:57:57 UTC
 The problem is that above the rpm layer, we don't know anything about the different types of requires.
 I guess it's possible that looking at specific bits in the rpm header would let us know what is happening for local rpm files or the rpmdb, but we'd still have problems like:

% rpm -q --requires rsyslog | fgrep systemd-sysv
systemd-sysv
% rpm -q --whatrequires systemd-sysv
no package requires systemd-sysv

...and basically the same thing happens on remove, we ask rpm "does anything require systemd-sysv" ... rpm says no, so we remove it.
 Then "yum check" will walk the requires list of all the packages, and give failures ... and "yum upgrade" will see (can only see) that foo requires bar, which hasn't changed ... not changed == bar must be installed == no need to do anything.

 Also while people might be happy with "yum upgrade rsyslog" re-installing systemd-sysv, they are going to be much less happy if "yum remove rsyslog" requires that.
 I thought this had been "fixed" on the rpm side by treating removal of Requires(post) as not acceptable?
 To fix it properly on the yum side would require a lot of work, and new repodata (and allowing removes to install things). Reassigning to rpm guys.

Comment 11 James Antill 2012-02-06 20:59:46 UTC
 Maybe it was only Requires(postun), and not Requires(post), which were treated as the same as requires?
 That solves the biggest problem of install needed for remove, but we still can't easily do install needed for upgrade.

Comment 12 Panu Matilainen 2012-02-07 08:30:51 UTC
(In reply to comment #10)
>  The problem is that above the rpm layer, we don't know anything about the
> different types of requires.
>  I guess it's possible that looking at specific bits in the rpm header would
> let us know what is happening for local rpm files or the rpmdb, but we'd still
> have problems like:
> 
> % rpm -q --requires rsyslog | fgrep systemd-sysv
> systemd-sysv
> % rpm -q --whatrequires systemd-sysv
> no package requires systemd-sysv

Try 'rpm -qv --requires rsyslog' for more informative output, it'll tell you this is a %post dependency. That information is available to python just as much as any other dependency data (and yes I know yum has never cared about any of it), RPMSENSE_SCRIPT_POST etc.

> ...and basically the same thing happens on remove, we ask rpm "does anything
> require systemd-sysv" ... rpm says no, so we remove it.

Which is perfectly fine: Requires(post) dependency says that the dependency is only needed for execution of %post scriptlet, and nothing else. Once the package has been installed, %post will never be executed again for that specific package instance so ok to remove it. Of course on upgrade, the %post of the updating package will be run, but that's a different package that might (or might not) have completely different dependencies on its %post.

>  Then "yum check" will walk the requires list of all the packages, and give
> failures ... and "yum upgrade" will see (can only see) that foo requires bar,
> which hasn't changed ... not changed == bar must be installed == no need to do
> anything.

Well, that's not a valid assumption really. If something is required then actually check whether its installed or not, instead of tracking "did it change?" status. Besides fixing this case (without even having to look at the dependency type bits), it'd make yum behave smarter in face of 'rpm -e --nodeps foo' situations.

>  Also while people might be happy with "yum upgrade rsyslog" re-installing
> systemd-sysv, they are going to be much less happy if "yum remove rsyslog"
> requires that.
>  I thought this had been "fixed" on the rpm side by treating removal of
> Requires(post) as not acceptable?
>  To fix it properly on the yum side would require a lot of work, and new
> repodata (and allowing removes to install things). Reassigning to rpm guys.

Rpm has never allowed removing Requires(postun) (or preun) dependencies as those scriptlets haven't been executed at the time of package installation. It'd indeed seem bizarre and annoying if removal would require installing additional dependencies. And FWIW, this is the way rpm has behaved for the last 11+ years, the only fixes in this area have been correctly handling combined Requires(post,postun) style dependencies.

Comment 13 James Antill 2012-02-07 21:35:10 UTC
 I think I've fixed this, we now use the rpmsense bits in the requires flags to create a list of "strong requires" (anything that doesn't have SENSE_PRE or SENSE_POST) ... and use that for the depsolver.
 It seems to work here, asking for comments upstream.

 Note that "yum reinstall rsyslog" will reinstall systemd-sysv.

Comment 14 Michal Schmidt 2012-02-22 15:09:33 UTC
*** Bug 795907 has been marked as a duplicate of this bug. ***

Comment 15 Fedora Update System 2012-03-12 20:20:34 UTC
yum-3.4.3-22.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/yum-3.4.3-22.fc16

Comment 16 Fedora Update System 2012-03-15 02:33:45 UTC
Package yum-3.4.3-22.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-3.4.3-22.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-3766/yum-3.4.3-22.fc16
then log in and leave karma (feedback).

Comment 17 Andrew 2012-03-15 08:57:26 UTC
#795907 still exists for me with yum-3.4.3-22.fc16.noarch

Comment 18 Fedora Update System 2012-03-21 02:32:15 UTC
Package yum-3.4.3-23.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-3.4.3-23.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-3766/yum-3.4.3-23.fc16
then log in and leave karma (feedback).

Comment 19 Andrew 2012-03-21 08:49:37 UTC
yum-3.4.3-23.fc16 fixes #795907 for me

Comment 20 Fedora Update System 2012-04-02 23:27:54 UTC
yum-3.4.3-23.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Panu Matilainen 2013-05-30 08:09:51 UTC
*** Bug 552818 has been marked as a duplicate of this bug. ***


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