Track down UnknownHostException on non-existent server
Asked by Richard Sochor:

I upgraded Confluence to the latest version and now on startup I get the error logged below. Confluence will come up in the browser but only in a 'text' mode.

The exception UnknownHostException: is raised for a server that no longer exists and didn't exist when the upgrade was done. But now it throws the following. I can't find any reference to the server in configurations so wondering how to resolve. Any ideas appreciated.

2016-09-22 07:49:01,070 ERROR \[AtlassianEvent::CustomizableThreadFactory-2\] \[renderer.internal.http.HttpClientFetcher\] fetch Unable to retrieve response  
[java.net](http://java.net).UnknownHostException: ssiroa031  
at [java.net](http://java.net).Inet6AddressImpl.lookupAllHostAddr(Native Method)  
at [java.net](http://java.net).InetAddress$2.lookupAllHostAddr(InetAddress.java:928)  
at [java.net](http://java.net).InetAddress.getAddressesFromNameService(InetAddress.java:1323)  
at [java.net](http://java.net).InetAddress.getAllByName0(InetAddress.java:1276)  
at [java.net](http://java.net).InetAddress.getAllByName(InetAddress.java:1192)  
at [java.net](http://java.net).InetAddress.getAllByName(InetAddress.java:1126)  
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)  
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:259)  
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159)  
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)  
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)  
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)  
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:882)  
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)  
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)  
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)  
at com.atlassian.gadgets.renderer.internal.http.HttpClientFetcher.fetch(HttpClientFetcher.java:97)  
at org.apache.shindig.gadgets.DefaultGadgetSpecFactory.fetchObjectAndCache(DefaultGadgetSpecFactory.java:126)  
at org.apache.shindig.gadgets.DefaultGadgetSpecFactory.getGadgetSpec(DefaultGadgetSpecFactory.java:91)  
at com.atlassian.gadgets.renderer.internal.local.LocalGadgetSpecFactory.getGadgetSpec(LocalGadgetSpecFactory.java:61)  
at com.atlassian.gadgets.renderer.internal.local.LocalGadgetSpecFactory.getGadgetSpec(LocalGadgetSpecFactory.java:48)  
at com.atlassian.gadgets.renderer.internal.GadgetSpecFactoryImpl.getGadgetSpec(GadgetSpecFactoryImpl.java:128)  
at com.atlassian.gadgets.renderer.internal.GadgetSpecFactoryImpl.getGadgetSpec(GadgetSpecFactoryImpl.java:83)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)  
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)  
at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)  
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)  
at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)  
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)  
at com.sun.proxy.$Proxy1837.getGadgetSpec(Unknown Source)  
at com.atlassian.confluence.plugins.gadgets.metadata.GadgetsMacroMetadataProvider.getGadgetSpecs(GadgetsMacroMetadataProvider.java:208)  
at com.atlassian.confluence.plugins.gadgets.metadata.GadgetsMacroMetadataProvider.getMacroMetadata(GadgetsMacroMetadataProvider.java:95)  
at com.atlassian.confluence.plugins.gadgets.metadata.MetadataCacheLoader.load(MetadataCacheLoader.java:41)  
at com.atlassian.confluence.plugins.gadgets.metadata.MetadataCacheLoader.load(MetadataCacheLoader.java:20)  
at com.atlassian.cache.ehcache.LoadingCache.getFromLoader(LoadingCache.java:145)  
at com.atlassian.cache.ehcache.LoadingCache.loadValueAndReleaseLock(LoadingCache.java:100)  
at com.atlassian.cache.ehcache.LoadingCache.get(LoadingCache.java:76)  
at com.atlassian.cache.ehcache.DelegatingCache.get(DelegatingCache.java:96)  
at com.atlassian.confluence.cache.ehcache.DefaultConfluenceEhCache.get(DefaultConfluenceEhCache.java:41)  
at com.atlassian.confluence.cache.ConfluenceMonitoringCache.get(ConfluenceMonitoringCache.java:44)  
at com.atlassian.confluence.plugins.gadgets.metadata.CachingGadgetsMacroMetadataProvider.getData(CachingGadgetsMacroMetadataProvider.java:142)  
at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.buildMacroMetadata(DefaultMacroMetadataManager.java:144)  
at com.atlassian.confluence.macro.browser.DefaultMacroMetadataManager.onPluginFrameworkStartedEvent(DefaultMacroMetadataManager.java:72)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)  
at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimingListenerHandler$1$1.invoke(ConfluenceListenerHandlersConfiguration.java:69)  
at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory.lambda$null$0(ConfluenceEventDispatcher.java:76)  
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:48)  
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:82)  
at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:72)  
at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:47)  
at com.atlassian.confluence.event.ConfluenceEventDispatcher$VCacheRequestContextRunnableFactory.lambda$getRunnable$1(ConfluenceEventDispatcher.java:76)  
at com.atlassian.confluence.event.ConfluenceEventDispatcher.lambda$null$0(ConfluenceEventDispatcher.java:56)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)  
2016-09-22 07:49:01,075 WARN \[AtlassianEvent::CustomizableThreadFactory-2\] \[gadgets.renderer.internal.GadgetSpecFactoryImpl\] getGadgetSpec Error occurred while retrieving gadget spec for <http://ssiroa031/jira/rest/gadgets/1.0/g/com.atlassian.jira.gadgets:pie-chart-gadget/gadgets/piechart-gadget.xml>  
2016-09-22 07:49:01,075 WARN \[AtlassianEvent::CustomizableThreadFactory-2\] \[plugins.gadgets.metadata.GadgetsMacroMetadataProvider\] getGadgetSpecs Unable to parse gadget spec \[ <http://ssiroa031/jira/rest/gadgets/1.0/g/com.atlassian.jira.gadgets:pie-chart-gadget/gadgets/piechart-gadget.xml> \]: org.apache.shindig.gadgets.GadgetException: Unable to retrieve gadget xml. HTTP error 500  
2016-09-22 07:49:01,086 WARN \[AtlassianEvent::CustomizableThreadFactory-2\] \[gadgets.renderer.internal.GadgetSpecFactoryImpl\] getGadgetSpec Error occurred while retrieving gadget spec for <http://projects/jira/rest/gadgets/1.0/g/com.pyxis.greenhopper.jira:greenhopper-gadget-project-dashboard/gadgets/greenhopper-project-dashboard.xml>  
2016-09-22 07:49:01,087 WARN \[AtlassianEvent::CustomizableThreadFactory-2\] \[plugins.gadgets.metadata.GadgetsMacroMetadataProvider\] getGadgetSpecs Unable to parse gadget spec \[ <http://projects/jira/rest/gadgets/1.0/g/com.pyxis.greenhopper.jira:greenhopper-gadget-project-dashboard/gadgets/greenhopper-project-dashboard.xml> \]: org.apache.shindig.gadgets.GadgetException: Unable to retrieve gadget xml. HTTP error 404


Answers:
author: Richard Sochor
body: Thanks for the quick response. I have already tried that without success. The server does not exist anymore thus it won't resolve via DNS. I have tried modifying the host file and pointing to both localhost and the production server without success.

Removing or correcting would seem best but I cannot find any reference in any configuration file in either Confluence or JIRA. I have grepped the entire Atlassian folder without success.

comments: author: noamdah
body: This happend to me when migrating a vm server, changing the base url and removing all the irrelevant lines in the etc hosts file of the vm worked for me. If you have taken these steps but still facing the issue you can open a support ticket at [Atlassian Support](https://support.atlassian.com/customer/servicedesk-portal).


author: noamdah
body: Check out this [link](https://confluence.atlassian.com/stashkb/stash-fails-to-start-up-with-java-net-unknownhostexception-exception-313463426.html)and this [link](https://confluence.atlassian.com/confkb/java-net-unknownhostexception-exceptions-in-confluence-log-file-due-to-dns-lookups-failing-394465548.html).


Tags: confluence-administration