Hide Forgot
Description of problem: yum-cron crash when sending the email. Version-Release number of selected component (if applicable): yum-cron-3.4.3-118.el7 How reproducible: every time Steps to Reproduce: configuration: emit_via = email email_from = foo email_to = foo2 email_host = localhost Actual results: /etc/cron.hourly/0yum-hourly.cron: Traceback (most recent call last): File "/usr/sbin/yum-cron", line 711, in <module> main() File "/usr/sbin/yum-cron", line 708, in main base.updatesCheck() 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 self.emitMessages() 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 self.set_charset(charset) 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.
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.
Today I found the problem. In the files: /etc/cron.daily/0yum-daily.cron /etc/cron.hourly/0yum-hourly.cron 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
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)) to msg = MIMEText(''.join(self.output),_charset='utf-8')
Upstream pull request: https://github.com/rpm-software-management/yum/pull/7
upstream pull request merged since Feb 29 - any extra action required to get this included in RHEL?
(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.
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