History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CIB-1250
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Hacksaw
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Pulse

pulse can't resolve my mail server FQDN

Created: 05/Sep/07 09:11 PM   Updated: 12/Dec/08 04:11 AM
Component/s: Setup/Install
Affects Version/s: 1.2.36
Fix Version/s: x.x

File Attachments: 1. Java Archive File nettest.jar (2 kb)

Environment:
FC5 x86_64, java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)


 Description  « Hide
I put in the FQDN of our mailserver, but it insists it can't resolve the name.
I can resolve it using getent without any problem on the box where I am testing pulse.

Stacktrace:

Sep 5, 2007 5:03:38 PM com.zutubi.pulse.web.ajax.TestSmtpAction execute
SEVERE: Unable to send test email: Unknown SMTP host: mail.wardrobe.irobot.com;
  nested exception is:
        java.net.UnknownHostException: mail.wardrobe.irobot.com
javax.mail.MessagingException: Unknown SMTP host: mail.wardrobe.irobot.com;
  nested exception is:
        java.net.UnknownHostException: mail.wardrobe.irobot.com
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1211)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:311)
        at javax.mail.Service.connect(Service.java:233)
        at javax.mail.Service.connect(Service.java:134)
        at javax.mail.Service.connect(Service.java:86)
        at com.sun.mail.smtp.SMTPTransport.connect(SMTPTransport.java:144)
        at com.zutubi.pulse.model.EmailContactPoint.sendMail(EmailContactPoint.java:182)
        at com.zutubi.pulse.web.ajax.TestSmtpAction.execute(TestSmtpAction.java:109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:353)
        at com.opensymphony.xwork.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:208)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:182)
        at com.zutubi.pulse.xwork.interceptor.ErrorHandlingInterceptor.intercept(ErrorHandlingInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.zutubi.pulse.xwork.interceptor.ErrorHandlingInterceptor.intercept(ErrorHandlingInterceptor.java:31)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:125)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.zutubi.pulse.xwork.interceptor.CancelWorkflowInterceptor.intercept(CancelWorkflowInterceptor.java:37)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.zutubi.pulse.xwork.interceptor.LicensedInterceptor.intercept(LicensedInterceptor.java:81)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:136)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:32)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.zutubi.pulse.xwork.interceptor.HibernateSessionInterceptor.intercept(HibernateSessionInterceptor.java:36)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:180)
        at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)
        at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:202)
        at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
        at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
        at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:195)
        at com.zutubi.pulse.spring.FilterWrapper.doFilter(FilterWrapper.java:46)
        at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
        at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
        at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
        at org.mortbay.http.HttpServer.service(HttpServer.java:927)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)


 All   Comments   Change History      Sort Order:
jason - 06/Sep/07 05:07 AM
Hi,

This is a puzzler. AFAIK, the JavaMail system we use should just be doing a normal connect to the specified host on port 25, which should mean a regular host lookup. Perhaps the way lookups happen from Java is not the same as getent. It may be possible to get more debug information by setting the system property "mail.debug" to true. The simplest way to do this is to hit the URL:

http://<pulse host>/admin/addSystemProperty.action?mail.debug=true

Then, next time you test the SMTP settings, you should get debug output to Pulse's standard out (may be $PULSE_HOME/logs/wrapper.log if you started as a service). Other things to try:

1) Do a lookup using nslookup. I believe this removes some of the things that getent takes into account, and it may be interesting if it returns a different result to getent.
2) Try using the IP address instead. If this works then at least it will get you going for now.

Sorry I can't be more specific at this stage!

Hacksaw - 06/Sep/07 12:54 PM
Using an ip address worked, no surprise.

nslookup produced the same result as getent.


Some debug spew, the stack trace under this looks the same as the last one, so I cut it off:

DEBUG: JavaMail version 1.3.2
DEBUG: java.io.FileNotFoundException: /usr/java/jre1.5.0_12/lib/javamail.providers (No such file or directory)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: /usr/java/jre1.5.0_12/lib/javamail.address.map (No such file or directory)
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "mail.wardrobe.irobot.com", port 25, isSSL false
Sep 6, 2007 8:48:28 AM com.zutubi.pulse.web.ajax.TestSmtpAction execute
SEVERE: Unable to send test email: Unknown SMTP host: mail.wardrobe.irobot.com;
  nested exception is:
        java.net.UnknownHostException: mail.wardrobe.irobot.com
javax.mail.MessagingException: Unknown SMTP host: mail.wardrobe.irobot.com;
  nested exception is:
        java.net.UnknownHostException: mail.wardrobe.irobot.com

jason - 06/Sep/07 02:06 PM
Hi again,

Thanks for the info. Unfortunately the debug output does not say any more about the problem. Perhaps there is something unusual about the network setup on this machine? Does the machine have multiple NICs/IP addresses? Also, I have attached a simple JAR to this issue that may help debug. You can run it like so to do a Java name lookup:

$ java -cp nettest.jar com.zutubi.nettest.DNSTest google.com
72.14.207.99
64.233.187.99
64.233.167.99

It would be interesting to know if this gives you an unknown host exception for your FQDN. It would also be interesting if other lookups work with this JAR.

Hacksaw - 06/Sep/07 09:28 PM
It failed.

I looked at it in strace, to see whether the resolver was engaged the right way. It appeared that the mdns4_minimal was being asked, but it wasn't then going on to ask DNS.

So I stuck dns in front of mdns4_minimal in the nsswitch.conf file, and it worked.

So this is the situation:

With nsswitch correctly configured, I can resolve all addresses normally with getent, but not with your program:


dtodd@ethanol:~/src> grep hosts /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
#hosts: files dns mdns4_minimal [NOTFOUND=return] dns mdns4
__________________________________________________________________________
[17:24:33]
dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest google.com
java.net.UnknownHostException: google.com: google.com
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName(Unknown Source)
        at com.zutubi.nettest.DNSTest.main(DNSTest.java:20)
__________________________________________________________________________
[17:24:43]
dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest hackmac.local
java.net.UnknownHostException: hackmac.local: hackmac.local
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName(Unknown Source)
        at com.zutubi.nettest.DNSTest.main(DNSTest.java:20)
__________________________________________________________________________
[17:24:46]
dtodd@ethanol:~/src> getent hosts google.com
64.233.167.99 google.com
72.14.207.99 google.com
64.233.187.99 google.com
__________________________________________________________________________
[17:24:49]
dtodd@ethanol:~/src> getent hosts hackmac.local
192.168.161.75 hackmac.local



With it configured incorrectly:

__________________________________________________________________________
[17:24:51]
dtodd@ethanol:~/src> sudo vi /etc/nsswitch.conf
__________________________________________________________________________
[17:25:07]
dtodd@ethanol:~/src> grep hosts /etc/nsswitch.conf
#hosts: db files nisplus nis dns
#hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts: files dns mdns4_minimal [NOTFOUND=return] dns mdns4
__________________________________________________________________________
[17:25:18]
dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest google.com
72.14.207.99
64.233.187.99
64.233.167.99
__________________________________________________________________________
[17:25:25]
dtodd@ethanol:~/src> java -cp nettest.jar com.zutubi.nettest.DNSTest hackmac.local
java.net.UnknownHostException: hackmac.local: hackmac.local
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName0(Unknown Source)
        at java.net.InetAddress.getAllByName(Unknown Source)
        at com.zutubi.nettest.DNSTest.main(DNSTest.java:20)
__________________________________________________________________________
[17:25:28]
dtodd@ethanol:~/src> getent hosts google.com
64.233.187.99 google.com
64.233.167.99 google.com
72.14.207.99 google.com
__________________________________________________________________________
[17:25:32]
dtodd@ethanol:~/src> getent hosts hackmac.local
192.168.161.75 hackmac.local



So it appears that your program, or maybe java, doesn't play well with mdns4_minimal.

I can't have that, we use mdns extensively here.

jason - 07/Sep/07 01:33 AM
Hi again,

Thanks for the detailed debugging. I have little experience with mdns, so forgive me if my ignorance is showing :). The test program I sent does the simplest possible lookup in Java. Thus this is a problem that would affect all Java programs using the standard Java networking APIs on your machine. Your correct nsswitch.conf setup is very common, indeed it appears to be the default on a lot of recent releases of various distros. Thus, if all Java networking failed on all machines with this nsswitch.conf, I would expect to be able to find a lot of error reports out there. My searches turned up nothing this specific. I guess part of the reason may be that many people do not use mdns and may not even have the requisite packages installed for its use to be attempted at all. It may also be that something else in your machine configuration is interacting badly with Java. One of the more promising leads was a bug report against Debian, where a dist-upgrade to sid caused nsswitch.conf to be updated to exactly your configuration:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=392813

The interesting thing here is that it only affected users with "search local" or "search <something>.local" in their resolv.conf. The conclusion was that this is incompatible with mdns4_minimal and in fact is not recommended for use with MDNS. Do you have such a line in resolv.conf? The one thing I cannot explain by this is why getent would still work, but otherwise it fits the symptoms perfectly (i.e. not trying dns after mdns4_minimal as search local will case a search for everything under .local).

Hacksaw - 10/Sep/07 12:56 PM
No, my search line only contains the domain of our internal network, not local.