Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecobee binding logging stack trace for java.net.UnknownHostException #10235

Closed
robnielsen opened this issue Feb 25, 2021 · 1 comment · Fixed by #10255
Closed

Ecobee binding logging stack trace for java.net.UnknownHostException #10235

robnielsen opened this issue Feb 25, 2021 · 1 comment · Fixed by #10255
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@robnielsen
Copy link
Contributor

My internet service was down for a bit and openhab.log contains multiple log entries like:

2021-02-24 04:18:01.797 [INFO ] [inding.ecobee.internal.api.EcobeeApi] - API: Call to Ecobee API failed
java.io.IOException: java.util.concurrent.ExecutionException: java.net.UnknownHostException: api.ecobee.com: Temporary failure in name resolution
        at org.openhab.core.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:260) ~[bundleFile:?]
        at org.openhab.core.io.net.http.HttpUtil.executeUrl(HttpUtil.java:155) ~[bundleFile:?]
        at org.openhab.core.io.net.http.HttpUtil.executeUrl(HttpUtil.java:130) ~[bundleFile:?]
        at org.openhab.binding.ecobee.internal.api.EcobeeApi.executeGet(EcobeeApi.java:283) [bundleFile:?]
        at org.openhab.binding.ecobee.internal.api.EcobeeApi.performThermostatSummaryQuery(EcobeeApi.java:215) [bundleFile:?]
        at org.openhab.binding.ecobee.internal.handler.EcobeeAccountBridgeHandler.refreshThermostats(EcobeeAccountBridgeHandler.java:217) [bundleFile:?]
        at org.openhab.binding.ecobee.internal.handler.EcobeeAccountBridgeHandler.refresh(EcobeeAccountBridgeHandler.java:210) [bundleFile:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.util.concurrent.ExecutionException: java.net.UnknownHostException: api.ecobee.com: Temporary failure in name resolution
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[bundleFile:9.4.20.v20190813]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:685) ~[bundleFile:9.4.20.v20190813]
        at org.openhab.core.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:251) ~[bundleFile:?]
        ... 12 more
Caused by: java.net.UnknownHostException: api.ecobee.com: Temporary failure in name resolution
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
        at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929) ~[?:?]
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515) ~[?:?]
        at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848) ~[?:?]
        at java.net.InetAddress.getAllByName0(InetAddress.java:1505) ~[?:?]
        at java.net.InetAddress.getAllByName(InetAddress.java:1364) ~[?:?]
        at java.net.InetAddress.getAllByName(InetAddress.java:1298) ~[?:?]
        at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) ~[?:?]
        ... 1 more

The binding should log the exception message, not the full stack trace.

@robnielsen robnielsen added the bug An unexpected problem or unintended behavior of an add-on label Feb 25, 2021
@kaikreuzer
Copy link
Member

It actually must only log in DEBUG level in such situations - only if there is something unexpected in the binding itself (i.e. a bug that should be reported), a WARN should be done.
Not being able to reach a server/device should result in the Thing going OFFLINE with an according message through the UI.

I have created #10255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants