[Buildbot-devel] Problem with Using MailNotifier
Nikunj Badjatya
nikunjbadjatya at gmail.com
Thu May 12 06:12:35 UTC 2011
Dear Fulvio,
Thanks a lot for the hint.. I checked the twistd.log for any 'Error' . I
found that
{{{
* Unhandled Error*
Traceback (most recent call last):
File
"/usr/local/lib/python2.6/site-packages/buildbot-0.7.12-py2.6.egg/buildbot/status/builder.py",
line 1349, in buildFinished
w.callback(self)
File
"/usr/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py",
line 238, in callback
self._startRunCallbacks(result)
File
"/usr/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py",
line 307, in _startRunCallbacks
self._runCallbacks()
File
"/usr/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-i686.egg/twisted/internet/defer.py",
line 323, in _runCallbacks
self.result = callback(self.result, *args, **kw)
--- <exception caught here> ---
File
"/usr/local/lib/python2.6/site-packages/buildbot-0.7.12-py2.6.egg/buildbot/status/builder.py",
line 1979, in _buildFinished
w.buildFinished(name, s, results)
File
"/usr/local/lib/python2.6/site-packages/buildbot-0.7.12-py2.6.egg/buildbot/status/mail.py",
line 275, in buildFinished
return self.buildMessage(name, build, results)
File
"/usr/local/lib/python2.6/site-packages/buildbot-0.7.12-py2.6.egg/buildbot/status/mail.py",
line 391, in buildMessage
msgdict = self.messageFormatter(self.mode, name, build, results,
self.master_status)
File "/home/buildmaster/SERVER/master.cfg", line 165, in
messageformatter
text.append("name of builder:"% name)
* exceptions.TypeError: not all arguments converted during string
formatting*
}}}
I then changed my master.cfg to add "*%s*" at all *text.append()* lines. It
is now working fine and mails are triggered as desired. !! Thanks a ton !
I see log files are very important and should not be ignored.! My bad !
Please reply to Q.2) and Q.3) also.
Q.2)
Is it possible to trigger a mail just before sometime ( say 1 hr ) the build
process starts.?? Please guide as to how it can be accomplished.!
Q.3)
For every build step, buildbot places a link (like *stdio*,* interrupt*, or
*err.htm*l etc. ). What if I wanted to put myown URL for each build step. ?
Thanks,
Nikunj
On Thu, May 12, 2011 at 10:38 AM, Fulvio Cervone <fcervone at me.com> wrote:
> Check the log file in the master directory; if there is a problem you will
> see it there printed out in the logs.
>
> Usually you will see something like an exception, if the problem is on the
> mail notifier, and most of the times you can get the error just looking at
> the line that the log is pointing out.
>
> Can you trigger the mail notifier and then post the log entry? That would
> help to figure out what is going wrong (and believe me , with the mail
> notifier many things could go wrong).
>
> -f
>
>
> On May 11, 2011, at 9:39 PM, Nikunj Badjatya wrote:
>
> Dear Members,
>
> I have recently started to use Buildbot for my C library build purpose.
> I am using "MailNotifier" for triggering automatic mails at various stages
> of the build.
>
> Buildbot version: 0.7.12
> Twisted version: 9.0.0
> Python version 2.6.6
> CentOS 5.6
>
> *Q.1)*
> The following code snippet is failing to send a mail.
> {{{
> *from buildbot.status.mail import MailNotifier
> from buildbot.status.builder import Results
> def messageformatter(mode, name, build, results, master_status):
> result = Results[results]
>
> text = list()
> text.append('Testing Mail Trigger..cooperate')
> text.append("name of builder:"% name)
> text.append("URL :"% master_status.getURLForThing(build))
> text.append("slavename :"% build.getSlavename())
> text.append("STATUS : %s" % result.title())
> return {
> 'body' : "\n".join(text),
> 'type' : 'plain'
> }
>
> mn = MailNotifier(fromaddr="buildmaster at localhost",
> sendToInterestedUsers=False,
> subject='Testing Buildbot Mail Trigger',
> mode='all',
> extraRecipients=['abc at xxx.com'],
> messageFormatter=messageformatter)*
> ...
> ...
> c['status'].append(mn)
>
> }}}
>
> But when I simply use:
> {{{
> *
> ml = MailNotifier(fromaddr="buildmaster at localhost",
> sendToInterestedUsers=False,
> subject='Testing Buildbot Mail Trigger',
> extraRecipients=['abc at xyz.com'],
> )*
> ...
> ...
> c['status'].append(ml)
>
> }}}
>
> It could send a mail. !
>
> *Q.2)*
> Is it possible to trigger a mail just before sometime ( say 1 hr ) the
> build process starts.?? Please guide as to how it can be accomplished.!
>
>
>
> Please help to solve these .!
>
>
> Thanks,
>
> Nikunj
> Bangalore, India
>
>
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
>
> http://p.sf.net/sfu/intel-dev2devmay_______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110512/f9aabff3/attachment.html>
More information about the devel
mailing list