Ticket #2285 (closed defect: fixed)
MailNotifier fails to send mail when the build is forced with ForceScheduler
| Reported by: | daviddev | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | undecided |
| Version: | 0.8.6p1 | Keywords: | |
| Cc: | krf@… |
Description
When you force a build with ForceScheduler? and want to send an email with a summary using MailNotifier?, you get the following error:
2012-04-17 15:29:44+0200 [-] Unhandled error in Deferred:
2012-04-17 15:29:44+0200 [-] Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py", line 551, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py", line 802, in _cbDeferred
self.callback(self.resultList)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py", line 368, in callback
self._startRunCallbacks(result)
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py", line 464, in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "/usr/local/lib/python2.6/dist-packages/Twisted-12.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py", line 551, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.6p1-py2.6.egg/buildbot/status/mail.py", line 448, in _gotBuilds
buildset['results'])
File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.6p1-py2.6.egg/buildbot/status/mail.py", line 644, in buildMessage
results, builds, patches, logs)
File "/usr/local/lib/python2.6/dist-packages/buildbot-0.8.6p1-py2.6.egg/buildbot/status/mail.py", line 554, in createEmail
"Subject cannot contain newlines"
exceptions.AssertionError: Subject cannot contain newlines
This seems to be due to the following line in buildbot/schedulers/forcedsched.py:
r = ("The web-page 'force build' button was pressed by '%s': %s " % (owner, reason))
If you remove the ' ', it works properly, but I guess it is there by a reason.
Change History
Note: See
TracTickets for help on using
tickets.
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
Don't add a newline to force-build reasons
And also make MailNotifier? a bit more resilient to newlines in the reason. Fixes #2285.