Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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 merged since Feb 29 - any extra action required to get this included in RHEL?
Comment 12Valentina 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.
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
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.