openhab1-addons icon indicating copy to clipboard operation
openhab1-addons copied to clipboard

[FritzboxTr064]: Error while executing background thread FritzboxTr064 Refresh Service

Open staehler opened this issue 8 years ago • 10 comments

After some time running openhab this error appears:

2017-10-16 11:21:12.694 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread FritzboxTr064 Refresh Service
java.lang.IllegalStateException: Auth scheme is null
        at org.apache.http.util.Asserts.notNull(Asserts.java:52) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.auth.HttpAuthenticator.ensureAuthScheme(HttpAuthenticator.java:229) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.auth.HttpAuthenticator.generateAuthResponse(HttpAuthenticator.java:184) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:262) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.readSoapResponse(Tr064Comm.java:456) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.openhab.binding.fritzboxtr064.internal.Tr064Comm.getTr064Values(Tr064Comm.java:247) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.openhab.binding.fritzboxtr064.internal.FritzboxTr064Binding.execute(FritzboxTr064Binding.java:197) [209:org.openhab.binding.fritzboxtr064:1.11.0.201710050110]
        at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) [178:org.openhab.core.compat1x:2.2.0.201710112009]
        at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [178:org.openhab.core.compat1x:2.2.0.201710112009]

Expected Behavior

This error is new, as it worked for month before the upgrade. I made an upgrade from openhab2_2.2.0-20170725225428-1_all.deb to openhab2_2.2.0-20171011224825-1. So this behaviour must have been imported in between July and October.

Current Behavior

When this error happens, it doesn't disappear untill a restart of openhab or of the tr064 bundle in karaf. With this error, no actions work (like switch WLAN ON/OFF).

Workaround

Restart openhab or restart tr064 bundle

Steps to Reproduce (for bugs)

I can not reproduce it. It seems to be dependent on the time running this binding.

Your Environment

Debian GNU/Linux 8 openhab2_2.2.0-20171011224825-1 Java(TM) SE Runtime Environment (build 1.8.0_144-b01)

staehler avatar Oct 16 '17 09:10 staehler

Moved to openhab2-addons (https://github.com/openhab/openhab2-addons/issues/2784)

staehler avatar Oct 16 '17 09:10 staehler

Actually I think this project was the right one. The FritzboxTr064 is an openhab 1 binding, because it is able to work with openhab in version one and two.

So if you reopen this issue, I'll send a pull request.

oprobst avatar Jan 18 '18 16:01 oprobst

Reopened, per request.

9037568 avatar Jan 18 '18 18:01 9037568

Still having this issue with Snapshot release from April 14th of 2018.

ghost avatar Apr 15 '18 09:04 ghost

Indeed, the error itself still exists, this merge fixes only the re-init of the http connection in case of any exception.

[...] it doesn't disappear untill a restart of openhab or of the tr064 bundle in karaf.

When there is an exception (like a wrong fritzbox call in this case) the connection will be reset and established again. Using the Snapshot release, you will get this error, but afterwards you should be able to request the fritzbox again without restarting openhab (or the Fritzboxr064 plugin).

The actual failure is a wrong (not thread safe) call to the fritzbox. I described (and fixed) it in #5441. The same bug was found earlier (#4548), but the fix these days was not sufficient.

oprobst avatar Apr 16 '18 10:04 oprobst

@hartmood, I fixed this in another ticket, are you interested in testing the fix?

oprobst avatar Jun 15 '18 10:06 oprobst

@oprobst Absolutely. Is there a jar I can download or will it be added as a snapshot?

ghost avatar Jun 15 '18 11:06 ghost

I simply uploaded it to dropbox: https://www.dropbox.com/s/j29naz1h5mkmc2p/org.openhab.binding.fritzboxtr064-1.12.0-SNAPSHOT.jar?dl=0 Place it in the 'addons' folder and the newer version should be loaded on next startup.

oprobst avatar Jun 15 '18 17:06 oprobst

Having the same issue. I loaded it down from your dropbox folder and moved it to the 'addons' folder. But the old binding is still loaded ever after reboot. Deleting temporary and cached filed did not change anything. After another reboot is received this: FrameworkEvent ERROR - org.openhab.binding.fritzboxtr064 org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.fritzboxtr064 [11] Unresolved requirement: Import-Package: org.apache.commons.httpclient.params; version="3.1.0"

and this

Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.fritzboxtr064-1.12.0-SNAPSHOT.jar org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.fritzboxtr064 [11] Unresolved requirement: Import-Package: org.apache.commons.httpclient.params; version="3.1.0"

What can I do?

marewe avatar Sep 14 '18 18:09 marewe

For me the addon stopped working completly. Error log says Error while executing background thread FritzboxTr064 Refresh Service. java.lang.IllegalStateException: Auth scheme is null I have OH 2.3 running on Openhabian. Restarting of Openhabian and or the Binding itself does not solve the problem.

FabiJa avatar Nov 22 '18 07:11 FabiJa