Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1108418

Summary: JDV 6.0.0.GA start up service start failed due to TeiidRuntimeException(the real exception be swallowed)
Product: [JBoss] JBoss Data Virtualization 6 Reporter: kylin <ksoong>
Component: TeiidAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: atangrin, dlesage, jstastny, vhalbert
Target Milestone: ER3Keywords: QA-Closed
Target Release: 6.1.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
JDV would fail to start due to a Teiid runtime error. Because there was no hostname IP mapping, it caused the InetAddress.getLocalHost() method to throw a java.net.UnknownHostException. The code has been changed so that no server-side exception will occur. As a result, JDV starts correctly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 08:57:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description kylin 2014-06-12 02:47:07 UTC
Description of problem:
======================

After install JDV 6.0.0.GA via
   java -jar jboss-dv-installer-6.0.0.GA-redhat-4.jar 
start JDV throw the following exception cause some of servers start failed:
~~~
17:17:35,824 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.teiid.transport.jdbc: org.jboss.msc.service.StartException in service jboss.teiid.transport.jdbc: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]
Caused by: org.teiid.core.TeiidRuntimeException: TEIID40065 Failed to resolve the bind address
    at org.teiid.transport.SocketConfiguration.resolveHostName(SocketConfiguration.java:82)
    at org.teiid.transport.SocketConfiguration.getHostAddress(SocketConfiguration.java:103)
    at org.teiid.transport.SocketListener.<init>(SocketListener.java:55)
    at org.teiid.jboss.TransportService.start(TransportService.java:157)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    ... 3 more

17:17:35,844 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.teiid.transport.odbc: org.jboss.msc.service.StartException in service jboss.teiid.transport.odbc: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]
Caused by: org.teiid.core.TeiidRuntimeException: TEIID40065 Failed to resolve the bind address
    at org.teiid.transport.SocketConfiguration.resolveHostName(SocketConfiguration.java:82)
    at org.teiid.transport.SocketConfiguration.getHostAddress(SocketConfiguration.java:103)
    at org.teiid.transport.SocketListener.<init>(SocketListener.java:55)
    at org.teiid.transport.ODBCSocketListener.<init>(ODBCSocketListener.java:43)
    at org.teiid.jboss.TransportService.start(TransportService.java:181)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    ... 3 more
~~~


Root Cause
==========
No hostname IP mapping cause InetAddress.getLocalHost() throw java.net.UnknownHostException, this trigger teiid-runtime SocketConfiguration.java as [1] line 79 throw UnknownHostException, but the exception be swallowed, instead with the TeiidRuntimeException


How reproducible:
================

The following steps for reproduce the issue in Rad Hat Linux 6

1. edit the /etc/sysconfig/network, set a hostname, below is the setting in my machine:
~~~
NETWORKING=yes
HOSTNAME=kylin.redhat.com
~~~
Note: the logout is necessary for let hostname take effect

2. start the JDV 
~~~
/standalone.sh
~~~
Note the TeiidRuntimeException throw, this due to SocketConfiguration as [1] line 79 InetAddress.getLocalHost() return UnknownHostException, the swallowed exception like below:
~~~
Caused by: java.net.UnknownHostException: kylin.redhat.com: Name or service not known
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
	at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
	... 1 more
~~~

3. edit /etc/hosts, add hostname IP mapping as below:
~~~
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 kylin.redhat.com
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 kylin.redhat.com
~~~
Note: the kylin.redhat.com are new appended


Expected results
================

Change the SocketConfiguration resolveHostName() method, InetAddress.getLocalHost()have risk while look up local address via hostname, if no address are mapped the code throw exception, cause service start up failed

[1] https://github.com/teiid/teiid/blob/master/runtime/src/main/java/org/teiid/transport/SocketConfiguration.java

Comment 2 JBoss JIRA Server 2014-09-12 14:35:57 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3124 to Resolved

Comment 3 JBoss JIRA Server 2014-11-20 15:06:55 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3124 to Closed