Bug 1202680 - yum-cron crash
Summary: yum-cron crash
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Michal Domonkos
QA Contact: Eva Mrakova
Depends On:
TreeView+ depends on / blocked
Reported: 2015-03-17 08:05 UTC by Frank Büttner
Modified: 2016-11-04 05:28 UTC (History)
6 users (show)

Fixed In Version: yum-3.4.3-138.el7
Doc Type: If docs needed, set a value
Doc Text:
no docs required
Clone Of:
Last Closed: 2016-11-04 05:28:40 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2397 0 normal SHIPPED_LIVE yum bug fix and enhancement update 2016-11-03 13:55:12 UTC

Description Frank Büttner 2015-03-17 08:05:29 UTC
Description of problem:
yum-cron crash when sending the email.

Version-Release number of selected component (if applicable):

How reproducible:
every time

Steps to Reproduce:
emit_via = email
email_from = foo
email_to = foo2
email_host = localhost

Actual results:

Traceback (most recent call last):
  File "/usr/sbin/yum-cron", line 711, in <module>
  File "/usr/sbin/yum-cron", line 708, in main
  File "/usr/sbin/yum-cron", line 623, in updatesCheck
    self.downloadUpdates(not self.opts.apply_updates)
  File "/usr/sbin/yum-cron", line 534, in downloadUpdates
  File "/usr/sbin/yum-cron", line 694, in emitMessages
    map(lambda x: x.sendMessages(), self.emitters)
  File "/usr/sbin/yum-cron", line 694, in <lambda>
    map(lambda x: x.sendMessages(), self.emitters)
  File "/usr/sbin/yum-cron", line 227, in sendMessages
    msg = MIMEText(''.join(self.output))
  File "/usr/lib64/python2.7/email/mime/text.py", line 30, in __init__
    self.set_payload(_text, _charset)
  File "/usr/lib64/python2.7/email/message.py", line 226, in set_payload
  File "/usr/lib64/python2.7/email/message.py", line 262, in set_charset
    self._payload = self._payload.encode(charset.output_charset)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 222-223: ordinal not in range(128)

Expected results:
Yum sends an mail about the update.

Comment 2 Milan Kerslager 2015-04-15 12:59:15 UTC
Same problem here. The error message is not produced every time, but sometimes I receive a bunch of them. Then it stop making noise until another bunch of them.

Comment 5 Frank Büttner 2015-11-04 21:44:24 UTC
Today I found the problem.
In the files:
the line
exec /usr/sbin/yum-cron
exec /usr/sbin/yum-cron /etc/yum/yum-cron-hourly.conf
must change to
LANG=C exec /usr/sbin/yum-cron
LANG=C exec /usr/sbin/yum-cron /etc/yum/yum-cron-hourly.conf
than it will work

Comment 6 Frank Büttner 2015-11-26 08:51:38 UTC
The real problem is this line:
msg = MIMEText(''.join(self.output))
from /usr/sbin/yum-cron
If the message contains non ascii char's it crash.
This will happens, because yum will generate it output in respect of the system language. So there are two options, first fix from comment #5 or fix  /usr/sbin/yum-cron by change
msg = MIMEText(''.join(self.output))
msg = MIMEText(''.join(self.output),_charset='utf-8')

Comment 7 Michal Domonkos 2016-02-19 10:48:13 UTC
Upstream pull request:

Comment 11 Felix Schwarz 2016-04-08 08:21:20 UTC
upstream pull request merged since Feb 29 - any extra action required to get this included in RHEL?

Comment 12 Valentina Mukhamedzhanova 2016-04-29 11:37:24 UTC
(In reply to Felix Schwarz from comment #11)
> upstream pull request merged since Feb 29 - any extra action required to get
> this included in RHEL?

No extra action required, this fix will be delivered in RHEL7.3.

Comment 16 errata-xmlrpc 2016-11-04 05:28:40 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.


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