RE: Jenkins Jobs hangs at sending email

636 views
Skip to first unread message

Alex Earl

unread,
Jun 7, 2012, 10:08:23 AM6/7/12
to vprasad79, jenkins...@googlegroups.com
Is this with the default mailer?

Sent from my Windows Phone

From: vprasad79
Sent: 6/7/2012 1:56 AM
To: jenkins...@googlegroups.com
Subject: Jenkins Jobs hangs at sending email

Some of our Jenkins jobs get hanged to the point where it says:

Sending email for trigger: Failure

Please can you help us.


We are using  Jenkins ver. 1.458
Following errors observed in Jenkins log

WARNING: com.gmail.sikakura.MailCommandTrigger.run() failed for MailCommander

java.lang.NullPointerException

        at com.gmail.sikakura.MailCommandTrigger.run(MailCommandTrigger.java:104)

        at hudson.triggers.Trigger.checkTriggers(Trigger.java:259)

        at hudson.triggers.Trigger$Cron.doRun(Trigger.java:207)

        at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54)

        at java.util.TimerThread.mainLoop(Timer.java:512)

        at java.util.TimerThread.run(Timer.java:462)

Jun 6, 2012 8:56:30 PM hudson.security.LDAPSecurityRealm$LDAPUserDetailsService loadUserByUsername

WARNING: Failed to search LDAP for username=USERx

org.acegisecurity.ldap.LdapDataAccessException: Failed to obtain InitialDirContext due to unexpected exception; nested exception is javax.naming.InterruptedNamingException: Interrupted during LDAP operation

        at org.acegisecurity.ldap.DefaultInitialDirContextFactory.connect(DefaultInitialDirContextFactory.java:193)

        at org.acegisecurity.ldap.DefaultInitialDirContextFactory.newInitialDirContext(DefaultInitialDirContextFactory.java:261)

        at org.acegisecurity.ldap.DefaultInitialDirContextFactory.newInitialDirContext(DefaultInitialDirContextFactory.java:241)

        at org.acegisecurity.ldap.LdapTemplate.execute(LdapTemplate.java:123)


vprasad79

unread,
Jun 7, 2012, 11:34:18 AM6/7/12
to jenkins...@googlegroups.com, vprasad79
No. we use email-ext plugin.



On Thursday, 7 June 2012 22:08:23 UTC+8, slide wrote:
Is this with the default mailer?

Sent from my Windows Phone

From: vprasad79
Sent: 6/7/2012 1:56 AM

Slide

unread,
Jun 7, 2012, 11:53:15 AM6/7/12
to jenkins...@googlegroups.com, vprasad79
It's trying to lookup the user in LDAP and it can't find it, the LDAP
plugin is throwing an exception. I have a possible fix for this (at
least catching the exception) in the works, but have not released with
it yet.

On Thu, Jun 7, 2012 at 8:34 AM, vprasad79 <venkat....@gmail.com> wrote:
> No. we use email-ext plugin.
>
>
>
> On Thursday, 7 June 2012 22:08:23 UTC+8, slide wrote:
>>
>> Is this with the default mailer?
>>
>> Sent from my Windows Phone
>> ________________________________
>> From: vprasad79
>> Sent: 6/7/2012 1:56 AM
>> To: jenkins...@googlegroups.com
--
Website: http://earl-of-code.com

vprasad79

unread,
Jun 15, 2012, 10:49:21 AM6/15/12
to jenkins...@googlegroups.com, vprasad79
Thanks for response.
But not sure why it getting hanged for one+ hour at this stage.

We need URGENT help on this issue many jobs fails due to email trigger errors though build is successful.
 
Email was triggered for: Failure
Email was triggered for: Still Failing
Trigger Failure was overridden by another trigger and will not send an email.
Sending email for trigger: Still Failing
Sending email to: xxx-...@xxx.com x...@xxx.com x...@xxx.com x...@xxxx.com xx...@xxxx.com x...@xxxxx.com
Notifying upstream projects of job completion
Notifying upstream of completion: FLO-xxxxx #382
All downstream projects complete!
Minimum result threshold not met for join project
Finished: FAILURE




On Thursday, 7 June 2012 23:53:15 UTC+8, slide wrote:
It's trying to lookup the user in LDAP and it can't find it, the LDAP
plugin is throwing an exception. I have a possible fix for this (at
least catching the exception) in the works, but have not released with
it yet.

On Thu, Jun 7, 2012 at 8:34 AM, vprasad79 <venkat....@gmail.com> wrote:
> No. we use email-ext plugin.
>
>
>
> On Thursday, 7 June 2012 22:08:23 UTC+8, slide wrote:
>>
>> Is this with the default mailer?
>>
>> Sent from my Windows Phone
>> ________________________________
>> From: vprasad79
>> Sent: 6/7/2012 1:56 AM
>> To: jenkinsci-users@googlegroups.com

Slide

unread,
Jun 15, 2012, 10:54:18 AM6/15/12
to jenkins...@googlegroups.com, vprasad79
You can try turning off the LDAP email, though I think the core Mailresolver will still use the LDAP email resolver.
--
Website: http://earl-of-code.com

vprasad79

unread,
Jun 18, 2012, 1:49:08 AM6/18/12
to jenkins...@googlegroups.com, vprasad79

I believe email-ext plugin uses jenkins default mail resolver?
Can we have timeout set to 10seconds for mail resolver?

Thank-you,
Venkat


On Friday, 15 June 2012 22:54:18 UTC+8, slide wrote:
You can try turning off the LDAP email, though I think the core Mailresolver will still use the LDAP email resolver.

On Fri, Jun 15, 2012 at 7:49 AM, vprasad79 <venkat....@gmail.com> wrote:
Thanks for response.
But not sure why it getting hanged for one+ hour at this stage.

 
Email was triggered for: Failure
Email was triggered for: Still Failing
Trigger Failure was overridden by another trigger and will not send an email.
Sending email for trigger: Still Failing
Sending email to: xxx-...@xxx.com x...@xxx.com x...@xxx.com x...@xxxx.com xx...@xxxx.com x...@xxxxx.com



--
Website: http://earl-of-code.com

vprasad79

unread,
Jun 18, 2012, 2:01:04 AM6/18/12
to jenkins...@googlegroups.com, vprasad79
Hello Slide,

Please can I know how to turn off LDAP email?
Does it means Disable LDAP security configuration?

Thanks,

Venkat

On Friday, 15 June 2012 22:54:18 UTC+8, slide wrote:

Alex Earl

unread,
Jun 18, 2012, 7:34:21 AM6/18/12
to vprasad79, jenkins...@googlegroups.com
This would be a change in the specific plugin that is trying to resolve, in this case either LDAP or Active Directory.

Sent from my Windows Phone

From: vprasad79
Sent: 6/17/2012 10:49 PM
To: jenkins...@googlegroups.com
Cc: vprasad79
Subject: Re: Jenkins Jobs hangs at sending email


I believe email-ext plugin uses jenkins default mail resolver?
Can we have timeout set to 10seconds for mail resolver?

Thank-you,
Venkat

On Friday, 15 June 2012 22:54:18 UTC+8, slide wrote:
You can try turning off the LDAP email, though I think the core Mailresolver will still use the LDAP email resolver.

On Fri, Jun 15, 2012 at 7:49 AM, vprasad79 <venkat....@gmail.com> wrote:
Thanks for response.
But not sure why it getting hanged for one+ hour at this stage.

 
Email was triggered for: Failure
Email was triggered for: Still Failing
Trigger Failure was overridden by another trigger and will not send an email.
Sending email for trigger: Still Failing
Sending email to: xxx-...@xxx.com x...@xxx.com x...@xxx.com x...@xxxx.com xx...@xxxx.com x...@xxxxx.com



--
Website: http://earl-of-code.com

Alex Earl

unread,
Jun 18, 2012, 7:35:03 AM6/18/12
to vprasad79, jenkins...@googlegroups.com
I thought there was a separate setting for it let me look.


Sent from my Windows Phone

From: vprasad79
Sent: 6/17/2012 11:01 PM

To: jenkins...@googlegroups.com
Cc: vprasad79
Subject: Re: Jenkins Jobs hangs at sending email

Hello Slide,

Please can I know how to turn off LDAP email?
Does it means Disable LDAP security configuration?

Thanks,
Venkat

On Friday, 15 June 2012 22:54:18 UTC+8, slide wrote:
You can try turning off the LDAP email, though I think the core Mailresolver will still use the LDAP email resolver.

On Fri, Jun 15, 2012 at 7:49 AM, vprasad79 <venkat....@gmail.com> wrote:
Thanks for response.
But not sure why it getting hanged for one+ hour at this stage.

We need URGENT help on this issue many jobs fails due to email trigger errors though build is successful.
 
Email was triggered for: Failure
Email was triggered for: Still Failing
Trigger Failure was overridden by another trigger and will not send an email.
Sending email for trigger: Still Failing
Sending email to: xxx-...@xxx.com x...@xxx.com x...@xxx.com x...@xxxx.com xx...@xxxx.com x...@xxxxx.com



--
Website: http://earl-of-code.com

vprasad79

unread,
Jul 3, 2012, 5:22:32 AM7/3/12
to jenkins...@googlegroups.com, vprasad79
Hi Alex,

Any update for us?

Thanks,
Venkat


On Monday, 18 June 2012 17:05:03 UTC+5:30, slide wrote:
I thought there was a separate setting for it let me look.

Sent from my Windows Phone

From: vprasad79
Sent: 6/17/2012 11:01 PM

vprasad79

unread,
Jul 3, 2012, 6:13:47 AM7/3/12
to jenkins...@googlegroups.com, vprasad79
Thanks Nathan for Analysis.
Yes even believe issue could be with subversion blame plugin.

If user not found in LDAP simply the plugin can use default email prefix instead iterating all projects latest build?
Please can anyone help us on this.

Thanks,
Venkat

nathang

unread,
Jul 3, 2012, 2:45:59 PM7/3/12
to jenkins...@googlegroups.com, vprasad79
Hello again.

we have resolved this issue by writing a small jenkins plugin extending mail resolver.

it is possible that this plugin will also solve your problem.
are your users in your SCM and your ldap and jenkins configuration all identical to their emails?
if i were in your company, and i would commit new code, will my user in svn be nathan.g...@whatever.com
will this email also be my login to your jenkins server as well? 

if so please contact me and i will check with HP administrators if i can send you a private patch, or append it to this emailing thread.
if they won't approve my hands will be tied :\ sorry

N

בתאריך יום שלישי, 3 ביולי 2012 13:13:47 UTC+3, מאת vprasad79:

nathang

unread,
Jul 3, 2012, 3:30:12 PM7/3/12
to jenkins...@googlegroups.com, vprasad79
 - oh, btw, forgot to mention - a temporary workaround for this would be to:
*. get your ldap working properly - that way it'll never reach the core emailing functionality with the performance issue, which acts as a fall back in the Chain of Responsibility used for all mail resolvers...
* dramatically reduce the number of builds you have (i.e. the history of each job). 




בתאריך יום שלישי, 3 ביולי 2012 21:45:59 UTC+3, מאת nathang:

vprasad79

unread,
Jul 26, 2012, 2:19:38 AM7/26/12
to jenkins...@googlegroups.com, vprasad79
Hello Nathan & Slide.

Our LDAP configuration works well.

Can you please let us know the changes that required for SubversionBlame source files to fix this issue.
We will do it and deploy.

Venkat

nathan grunzweig

unread,
Jul 26, 2012, 5:40:25 AM7/26/12
to jenkins...@googlegroups.com, vprasad79
Hi,

sorry, i don't know how SubversionBlame plugin is related.
the problem is in class SubversionMailAddressResolverImpl, which is in subversion plugin, not subversion blame (i think).

we preferred not to change any existing code, since we could override the behavior externally.

a chain of responsibility is used to determine the mail address resolver to use, so we just added a new one at the beginning of the chain.

see MailAddressResolver class, method resolve:
public static String resolve(User u) {
        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine("Resolving e-mail address for \""+u+"\" ID="+u.getId());
        }

        //this is chain of responsibility
        for (MailAddressResolver r : all()) {


so to resolve the issue we extended MailAdressResolver with a higher ordinal value:

//generally should be first, but leave room for unexpected...
@Extension(ordinal = (Integer.MAX_VALUE - 100))
public class UserIdAsEmailMailAddressResolver extends MailAddressResolver {


    @Override
    public String findMailAddressFor(User u) {

        final String potentialEmail = u.getId();

        if (potentialEmail != null && potentialEmail.contains("@")) {
            return potentialEmail;
        }

        return null;
    }
}




2012/7/26 vprasad79 <venkat....@gmail.com>
Reply all
Reply to author
Forward
0 new messages