dcmeglio / hubitat-bond

BOND Home Integration for Hubitat
32 stars 20 forks source link

Error message in the log file #7

Closed jsarcone closed 4 years ago

jsarcone commented 4 years ago

I'm getting this error message every so often. Is this an issue

2020-03-16 08:13:40.749 pm errorgroovy.lang.MissingMethodException: No signature of method: org.apache.http.conn.ConnectTimeoutException.getResponse() is applicable for argument types: () values: [] Possible solutions: getMessage() on line 982 (updateDevices)

Thanks,

Joe

apwelsh commented 4 years ago

I just looked at the code and can confirm this is likely a bug. ConnectTimeoutException does not support getResponse(). I believe the author meant the call to be getMessage() since this is a common method for this scenario.

This is rather benign at this point though. Because your system is not available for the app to talk to. Likely the IP address may have changed, try making sure your bond has a DHCP reservation on your router. This will ensure the bond never changes IP addresses.

[update] fixed typos introduced by auto-correct.

jsarcone commented 4 years ago

OK thank you.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10


From: Armand Welsh notifications@github.com Sent: Tuesday, March 17, 2020 3:37:33 AM To: dcmeglio/hubitat-bond hubitat-bond@noreply.github.com Cc: jsarcone jsarcone@hotmail.com; Author author@noreply.github.com Subject: Re: [dcmeglio/hubitat-bond] Error message in the log file (#7)

I just looked at the code and can confirm this is likely a bug. ConnectTimeoutException does not support getResponse(). I believe the author meant the call to be getMessage() since this is a common method for this scenario.

This is rather benign at this point though. Because your system is not available for the app to talk to. Likely the IP address may have changed, try making sure your bind has a dhcp reservation on your router. This will ensure the bind never changes IP addresses.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdcmeglio%2Fhubitat-bond%2Fissues%2F7%23issuecomment-599921041&data=02%7C01%7C%7C96906e0be4eb46d2092a08d7ca460ea2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637200274542368622&sdata=a9oVDrkAGKJ4YdiFmUIuotoFTO6%2FL8gAudA5WB7tfWw%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFRGIAT6TGNELW35O4M4S73RH4SD3ANCNFSM4LM22BFA&data=02%7C01%7C%7C96906e0be4eb46d2092a08d7ca460ea2%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637200274542378604&sdata=tJGl8THCNKoziGlSYK8BcfVnUKaWqkVJGS%2FQjlIIptk%3D&reserved=0.

bofisher commented 4 years ago

Noticed this as well when I had the device powered down for a few days. A bug, but only an issue if your device changes IP or is offline.

dcmeglio commented 4 years ago

I can improve the error logging so it's a bit more useful, but there is nothing I can do if the IP changes. Right now we have a situation where BOND and Hubitat use different technologies. Hubitat uses SSDP as a way to detect IP changes and BOND advertises using mDNS. Hubitat "plans" to add mDNS but there is no timeline. When it is added I'll definitely support it.

apwelsh commented 4 years ago

To be clear @dcmeglio , What I am referring to is

checkHttpResponse("getState",` e.getResponse())

the java Exception class, which is what the code catches, does not have a getResponse() method. I believe what you want is e.getMessage() and to create another parser that beautifies the Java Throwable's message to a log message. 100% every as depicted above will throw an exception, since no throwable offers getResponse() as a method.

Personally, I would just change it to

log.error "getState: Unexpected HTTP failure: ${e.getMessage()}"
dcmeglio commented 4 years ago

@apwelsh thanks for the clarification. Yup, I added a nicer catch for the Connection Timeout. That being said, hopefully one day I can prevent the root cause using mDNS.

jsarcone commented 4 years ago

No. I still get the error even though I have a static IP.