Bug 1004853

Summary: yum-cron 0yum-daily.cron emits strange message when there are dependency errors
Product: Red Hat Enterprise Linux 7 Reporter: Orion Poplawski <orion>
Component: yumAssignee: Michal Domonkos <mdomonko>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.0CC: admiller, ali+rhbugzilla, andreasfleig, anton, bertrand.lods, bugzillaredhat.jim-j, d.bz-redhat, emrakova, felix.kaiser, ffesti, firas.alkafri, gergnz, Gillingham, james.antill, jzeleny, mail, mdomonko, me, milan.kerslager, mwasilewski, paer.berge, p.malishev, redhatbug.kofl, tim.lauridsen, urusha.v1.0, uwe.wisniewski, vmukhame, vpakolu, yuri
Target Milestone: rc   
Target Release: 7.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.4.3-138.el7 Doc Type: If docs needed, set a value
Doc Text:
no docs required
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:27:25 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 Orion Poplawski 2013-09-05 15:35:16 UTC
Description of problem:

/etc/cron.daily/0yum-daily.cron:

Failed to check for updates with the following error message: 
Failed to build transaction: Success - empty transaction

# yum upgrade
Loaded plugins: auto-update-debuginfo, langpacks
Resolving Dependencies
--> Running transaction check
---> Package nx.x86_64 0:3.5.0-18.fc20 will be obsoleted
--> Processing Dependency: libXcompext.so.3()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libXcompshad.so.3()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libXcomp.so.3()(64bit) for package: nxproxy-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libXcomp.so.3()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
---> Package nx-libs.x86_64 0:3.5.0.21-3.fc21 will be obsoleting
---> Package nxagent.x86_64 0:3.5.0.21-3.fc21 will be obsoleting
--> Processing Dependency: libNX_Xtst.so.6()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xrender.so.1()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xrandr.so.2()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xpm.so.4()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xinerama.so.1()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xfixes.so.3()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xext.so.6()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xdmcp.so.6()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xdamage.so.1()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_Xcomposite.so.1()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
--> Processing Dependency: libNX_X11.so.6()(64bit) for package: nxagent-3.5.0.21-3.fc21.x86_64
---> Package nxproxy.x86_64 0:3.5.0.21-3.fc21 will be obsoleting
--> Running transaction check
---> Package libNX_X11.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xcomposite.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xdamage.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xdmcp.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xext.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xfixes.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xinerama.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xpm.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xrandr.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xrender.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libNX_Xtst.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libXcomp.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libXcompext.x86_64 0:3.5.0.21-3.fc21 will be installed
---> Package libXcompshad.x86_64 0:3.5.0.21-3.fc21 will be installed
--> Processing Dependency: /usr/bin/nxssh for package: qtnx-0.9-17.fc20.x86_64
--> Finished Dependency Resolution
Error: Package: qtnx-0.9-17.fc20.x86_64 (@rawhide/20)
           Requires: /usr/bin/nxssh
           Removing: nx-3.5.0-18.fc20.x86_64 (@rawhide/20)
               Not found
           Obsoleted By: nxproxy-3.5.0.21-3.fc21.x86_64 (rawhide)
               Not found
 You could try using --skip-broken to work around the problem

It would be good if the yum-cron output at least showed the Error: message.

Version-Release number of selected component (if applicable):
yum-3.4.3-109.fc21.noarch

Comment 1 Orion Poplawski 2014-09-30 22:46:34 UTC
Still present with yum-3.4.3-155.fc22.noarch

Comment 2 paer.berge@gmail.com 2015-02-27 07:52:08 UTC
I get the same message:
Failed to check for updates with the following error message:
Failed to build transaction: Success - empty transaction

without having any dependency problems.

$ rpm -q yum
yum-3.4.3-118.el7.centos.noarch

$ rpm -q yum-cron
yum-cron-3.4.3-118.el7.centos.noarch

Comment 3 Jaroslav Reznik 2015-03-03 15:02:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 4 Andreas Fleig 2015-03-12 15:33:06 UTC
This bug is also present in CentOS 7 (and therefore RHEL?). Here's a fix:

diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index 20911af..66f9c19 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -504,7 +504,13 @@ class YumCronBase(yum.YumBase, YumOutput):
         except yum.Errors.RepoError, e:
             self.emitCheckFailed("%s" %(e,))
             sys.exit()
-        if res != 2:
+        if res == 0:
+            # success, empty transaction
+            sys.exit(0)
+        elif res == 2:
+            # success, dependencies resolved
+            pass
+        else:
             self.emitCheckFailed("Failed to build transaction: %s" %(str.join("\n", resmsg),))
             sys.exit(1)

Comment 5 Felix Kaiser 2015-04-04 07:17:29 UTC
That "except:" clause in the very first line of your patches context is broken too. exit() should be exit(1).

Can you please add Product: RHEL 7?

Comment 6 Patrick Hofmann 2015-04-14 06:10:57 UTC
I have the same issue on CentOS 7.
The fix from #4 and #5 worked for me, but there is no /yum-cron/yum-cron.py
I changed the lines in /usr/sbin/yum-cron

Comment 7 Michal Wasilewski 2015-10-07 13:33:53 UTC
The same here, I'm running CentOS 7, build 1503

Name        : yum-cron
Arch        : noarch
Version     : 3.4.3
Release     : 125.el7.centos

The fix above solved it.

Comment 8 Thomas 2015-10-25 07:46:55 UTC
Same issue here. Fix solved it.

Name        : yum-cron
Version     : 3.4.3
Release     : 125.el7.centos

CentOS Linux release 7.1.1503 (Core)

Comment 9 Pavel Malyshev 2016-02-18 09:07:06 UTC
The issue is still there in RHEL7 and CentOS7

Comment 10 Pavel Malyshev 2016-02-18 09:08:08 UTC
The issue is still there in RHEL7 and CentOS7

RHEL7: yum-cron-3.4.3-132.el7.noarch
CentOS7: yum-cron-3.4.3-132.el7.centos.0.1.noarch

Comment 11 Thomas 2016-02-28 18:40:52 UTC
Yep, still there:

yum-cron-3.4.3-132.el7.centos.0.1.noarch

Comment 13 Michal Domonkos 2016-03-16 12:56:39 UTC
Pull request submitted:
https://github.com/rpm-software-management/yum/pull/9

Comment 14 Michal Domonkos 2016-03-16 12:59:13 UTC
Andreas, the patch you provided looks good so I've applied it, thanks!

Felix, thanks for pointing out the missing exit code, I've included it in the pull request as well.

Comment 23 narutobaka 2016-07-04 09:39:56 UTC
Hi 

I try the purpose patch, but doing so, I get no more yum update message alert :

In /usr/sbin/yum-cron, i did this :

        if res == 0:
            # success, empty transaction
            sys.exit(0)
        elif res == 2:
            # success, dependencies resolved
            pass
        else:


I work on four Centos7 server, and I only have this e-mail message on one :

/etc/cron.daily/0yum-daily.cron:

Failed to check for updates with the following error message: 
Failed to build transaction: Succès - transaction vide

I compare yum-cron, but file are same

Manual yum update work fine.

Yum package on this server :

rpm -qa | grep yum
yum-cron-3.4.3-132.el7.centos.0.1.noarch
yum-plugin-fastestmirror-1.1.31-34.el7.noarch
yum-plugin-protectbase-1.1.31-34.el7.noarch
yum-utils-1.1.31-34.el7.noarch
yum-3.4.3-132.el7.centos.0.1.noarch
yum-plugin-priorities-1.1.31-34.el7.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64


CentOs version on this server :

rpm -qa | grep release
centos-release-7-2.1511.el7.centos.2.10.x86_64

Kernel version on this server :

uname -r
3.10.0-327.22.2.el7.x86_64

cordialy

Comment 24 Michal Domonkos 2016-07-08 13:14:00 UTC
Hi,

(In reply to narutobaka from comment #23)
> Hi 
> 
> I try the purpose patch, but doing so, I get no more yum update message
> alert :

Do you get no alerts even when there _are_ actual updates available to install?  If you get no alerts when there are no updates, that's what this patch is supposed to do :)

Maybe seeing what your /etc/yum/yum-cron.conf file looks like would help.  Could you attach it?

> I work on four Centos7 server, and I only have this e-mail message on one :
> 
> /etc/cron.daily/0yum-daily.cron:
> 
> Failed to check for updates with the following error message: 
> Failed to build transaction: Succès - transaction vide

That's weird and shouldn't happen with the patch applied.  There is actually no code path that would lead to this exact error message, other than the one which we're fixing with the patch.  Are you sure the email was sent at the time when you already had applied the patch?

Comment 26 velifera 2016-08-22 10:48:48 UTC
Hi,

works fine if "update_cmd = default" is set in /etc/yum/yum-cron.conf.
Fails if "update_cmd = security" is set. Hope that helps to fix it.

# cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core) 
# uname -r
3.10.0-327.28.2.el7.x86_64
# rpm -qa yum-cron
yum-cron-3.4.3-132.el7.centos.0.1.noarch

Comment 27 Michal Domonkos 2016-08-23 13:04:47 UTC
(In reply to velifera from comment #26)
> Hi,
> 
> works fine if "update_cmd = default" is set in /etc/yum/yum-cron.conf.
> Fails if "update_cmd = security" is set. Hope that helps to fix it.

Hey,

Yes, that's right.  We have already fixed this and the commit has been merged upstream:
https://github.com/rpm-software-management/yum/commit/ae22bcdbacc01b12175304e14df59bdda45aa108

Thank you for your input, though!

Comment 28 Yuri Arabadji 2016-09-23 17:56:48 UTC
When will it be fixed/pushed to el7 updates? It's been 1.5 years.

Comment 29 Orion Poplawski 2016-09-23 19:00:35 UTC
It's in 7.3beta, so presumably in a couple months when it is released.

Comment 31 errata-xmlrpc 2016-11-04 05:27:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2397.html