[Buildbot-devel] Problem with Using MailNotifier

Fulvio Cervone fcervone at me.com
Thu May 12 06:39:02 UTC 2011


Glad that you found the error :)

The usefulness of an error message is only directly related to how helpful it is, in giving you a hint of what is broken, and that was pretty good and clear :)

Q2:Not sure if a mailnotifier can be triggered (I will leave it to who is more knowledgeable); honestly the only solution that would pop in my head is to use a cron job to send an email instead of using buildbot; while if you want to use buildbot you could maybe create a scheduler that one hour before the build process starts, will just execute a script that send an email...is not really elegant and nice but I don't think that the mailnotifier was made with that functionality in mind (after all is just a way to tell you what went bad or what was successful after doing a sequence of steps).

Q3: Depends from what you wanna link there: you can create a log and append it to the page, modifying the behavior of the step "createSummary function;  hiding the stdio and warnings if you want. 

If you want to add a link to another page (on the server or somewhere else), probably you wanna look at the Buildstep URL section on the manual (never tried it so i am not really knowledgeable about that topic), at first glance seems to do what you are looking for.

Hope that this helps.

-f




On May 11, 2011, at 11:12 PM, Nikunj Badjatya wrote:

> 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.html 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/20110511/e4f4aaeb/attachment.html>


More information about the devel mailing list