Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delimiter between domain and username in jenkins user is sometimes \, sometimes _ Why?

I'm seeing some odd things with jenkins and sending mail. For some users mail is sent to [email protected] - some are fine.

Jenkins is using AD for authentication - most users haven't actually logged into jenkins, the username comes from svn. my svn server is a windows2008 server using sspi to authenticate:

# authentication
AuthName "Subversion Authentication"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain COMPANY
SSPIOfferBasic On
Require valid-user

the best place to see it is in the http://jenkins/job/job-name/1234/api/json and look at culprits

"culprits":[
{"absoluteUrl":"http://jenkins/user/DOMAIN_asmith","fullName":"DOMAIN_asmith"},
{"absoluteUrl":"http://jenkins/user/DOMAIN_bobama","fullName":"DOMAIN\\bobama"}
]

Things are goign to work fine for bobama, but note asmith - the email will go to [email protected] (which won't deliver)

If I look at the users configuration page http://jenkins/user/DOMAIN_asmith/configure

I see his email is actually listed as [email protected], bobama looks fine.

These values aren't coming from the user (neither has ever logged in to jenkins) - they're coming from AD by way of SVN. I'm stuck - anyone point me in a better direction?

like image 593
thekbb Avatar asked Jul 27 '12 20:07

thekbb


2 Answers

Here are a couple of Ideas:

  • If you change to the directory where asmith was the last committer and you do svn info . What does the LastChanged Author say? "DOMAIN\asmith" or something else? What does it say for bobama?

  • If the information going into Jenkins is really identical for all users, then the difference has to be inside Jenkins. I've been looking at the source of MailAddressResolver, which is just a dispatching class that invokes other resolvers. However, I'm not sure which one is invoked in your configuration. There are fallback scenarios which try to guess the correct email if none of the resolvers succeeds. One that looks very interesting is 'MailAddressResolver problems with SVN & SSPI authentication'. This should actually replace '[email protected]' with 'DOMAIN\[email protected]'

  • I've noticed logging in Jenkins' source. If the logs don't already indicate problems during the mail address resolution, you could add more loggers in the web interface.

  • While going through the bug reports, I noticed 'E-mail to individuals who broke the build is sent to wrong address'. Which sounds a lot like the problem you're experiencing. And it's unresolved.

Possible Workaround

While searching in all directions at once I discovered the RegEx Email Plugin. It allows you to generate user email addresses from usernames using regular expressions. Maybe you could twist Jenkins' arm with this to get the mail format you need.

like image 197
djf Avatar answered Oct 17 '22 05:10

djf


I've created Additional Identities plugin for this purpose. Only a workaround until I found a better solution, but can help.

like image 30
nicolas de loof Avatar answered Oct 17 '22 03:10

nicolas de loof