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

Jetty Buffer Exception / Homematic Discovery #6963

Closed
justsendit opened this issue Feb 5, 2020 · 7 comments
Closed

Jetty Buffer Exception / Homematic Discovery #6963

justsendit opened this issue Feb 5, 2020 · 7 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@justsendit
Copy link

I am trying to connect openhab to my homematic setup (>100 HmIP Devices).
When i started with less devices it worked just fine, but now i cannot add any(thing).

In the openhab events.log it tells me the device serial is not found on the gateway:
2020-02-05 16:20:03.830 [WARN ] [ernal.handler.HomematicBridgeHandler] - Device with address '[SERIAL]' not found on gateway 'CCU3'

Restarting the openhab2 service it throws the following error, which i think is the issue:

2020-02-05 16:20:03.810 [ERROR] [very.HomematicDeviceDiscoveryService] - java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
java.io.IOException: java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
at org.openhab.binding.homematic.internal.communicator.client.XmlRpcClient.sendMessage(XmlRpcClient.java:98) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.client.XmlRpcClient.sendMessage(XmlRpcClient.java:102) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.client.XmlRpcClient.sendMessage(XmlRpcClient.java:67) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.client.RpcClient.listDevices(RpcClient.java:168) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.getDeviceDescriptions(AbstractHomematicGateway.java:448) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.AbstractHomematicGateway.loadAllDeviceMetadata(AbstractHomematicGateway.java:372) ~[?:?]
at org.openhab.binding.homematic.internal.discovery.HomematicDeviceDiscoveryService.lambda$0(HomematicDeviceDiscoveryService.java:210) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_232]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:685) ~[?:?]
at org.openhab.binding.homematic.internal.communicator.client.XmlRpcClient.sendMessage(XmlRpcClient.java:84) ~[?:?]
... 13 more
Caused by: java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
at org.eclipse.jetty.client.util.BufferingResponseListener.onHeaders(BufferingResponseListener.java:83) ~[?:?]
at org.eclipse.jetty.client.ResponseNotifier.notifyHeaders(ResponseNotifier.java:98) ~[?:?]
at org.eclipse.jetty.client.ResponseNotifier.notifyHeaders(ResponseNotifier.java:90) ~[?:?]
at org.eclipse.jetty.client.HttpReceiver.responseHeaders(HttpReceiver.java:269) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.headerComplete(HttpReceiverOverHTTP.java:256) ~[?:?]
at org.eclipse.jetty.http.HttpParser.parseFields(HttpParser.java:1192) ~[?:?]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1475) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:172) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:135) ~[?:?]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73) ~[?:?]
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133) ~[?:?]
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:154) ~[?:?]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[?:?]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[?:?]
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) ~[?:?]
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) ~[?:?]
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) ~[?:?]
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

I've read there is i fixed buffer limit of 2MB within java which might cause this. I believe jetty is invoked by the discovery service to query the CCU3 for its devices but the response is too big to fit the buffer, so it just crashes.

If i only add the CCU to my things file and nothing else, it works just fine.

Is there anything that can be done to this? I found some hints for jetty on setting a larger buffer size, but i don't know how this can be done with openhab.

Best regards
Andreas

@MHerbst
Copy link
Contributor

MHerbst commented Feb 6, 2020

Is there anything that can be done to this? I found some hints for jetty on setting a larger buffer size, but i don't know how this can be done with openhab.

As far as I can see the method that reads the responses from the CCU needs some modification to allows the processing of messages that are larger than 2 GB.

@joerghohn
Copy link

joerghohn commented Feb 19, 2020

As statet by the OP, this seems not to be homematic specific as I have the same buffer error with the Unifi Addon:

2020-02-15 15:16:05.797 [hingStatusInfoChangedEvent] - 'unifi:controller:7ef1983d' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2020-02-15 15:16:06.687 [hingStatusInfoChangedEvent] - 'unifi:controller:7ef1983d' changed from INITIALIZING to ONLINE
2020-02-15 15:16:08.611 [WARN ] [.handler.UniFiControllerThingHandler] - Unhandled exception while refreshing the UniFi Controller unifi:controller:7ef1983d - java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
2020-02-15 15:16:08.618 [hingStatusInfoChangedEvent] - 'unifi:controller:7ef1983d' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
2020-02-15 15:16:20.674 [WARN ] [.handler.UniFiControllerThingHandler] - Unhandled exception while refreshing the UniFi Controller unifi:controller:7ef1983d - java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded

@9037568
Copy link
Contributor

9037568 commented Feb 19, 2020

This solution appears to be what's needed.

@9037568 9037568 added bug An unexpected problem or unintended behavior of an add-on and removed question labels Feb 19, 2020
@MHerbst
Copy link
Contributor

MHerbst commented Feb 19, 2020

@9037568 I have found this solution on Stack Overflow, too. Should probably work with Homematic.

@joerghohn At least the Homematic binding uses its own routine for the communication via Jetty. I would assume that the Unify binding does the same. Probably it would better to create a separate issue for the Unify binding.

@MHerbst
Copy link
Contributor

MHerbst commented Mar 8, 2020

@9037568 I have modified the binding and you can download a test version from here: https://github.com/MHerbst/openhab-addons-test/raw/master/org.openhab.binding.homematic-2.5.3-SNAPSHOT.jar
I would like to get some feedback before I create a PR because I can't test it.

@MHerbst
Copy link
Contributor

MHerbst commented Apr 26, 2020

@J-N-K @cpmeister My PR did not automatically close this issue. Could one of you do it, since I lack the necessary authority? Thanks.

@J-N-K J-N-K closed this as completed Apr 26, 2020
@J-N-K
Copy link
Member

J-N-K commented Apr 26, 2020

Probably because "Solves" is not a keyword for GitHub. "Fixes" and "Closes" work.

yfre pushed a commit to yfre/openhab-addons that referenced this issue Apr 27, 2020
…penhab#7473)

Solves openhab#6963

Signed-off-by: Martin Herbst <develop@mherbst.de>
Signed-off-by: Eugen Freiter <freiter@gmx.de>
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this issue Jun 8, 2020
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this issue Jul 14, 2020
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this issue Jul 26, 2020
…penhab#7473)

Solves openhab#6963

Signed-off-by: Martin Herbst <develop@mherbst.de>
Signed-off-by: CSchlipp <christian@schlipp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this issue Sep 1, 2020
…penhab#7473)

Solves openhab#6963

Signed-off-by: Martin Herbst <develop@mherbst.de>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Sep 19, 2020
kaikreuzer pushed a commit that referenced this issue Jan 12, 2021
* Replace deprecated constructors
* Removed no longer existing settings from the documentation. They were already marked as deprecated since several versions.
* Refactored communication with the HM gateway
- simplified coding for the communication with the gateway
- buffer size for communication is now configurable to avoid problems
with too small buffers
- Previous solution for #6963 was not sufficient. Should be finally done
with these changes
* Retrieving the duty cycle is sufficient to check connection
- ping requests could therefore be safely removed problems with the automatic reconnection were solved.
* Changed to explicit list of Exception

Fixes #8808

Signed-off-by: Martin Herbst <develop@mherbst.de>
nowaterman pushed a commit to nowaterman/openhab-addons that referenced this issue Jan 19, 2021
* Replace deprecated constructors
* Removed no longer existing settings from the documentation. They were already marked as deprecated since several versions.
* Refactored communication with the HM gateway
- simplified coding for the communication with the gateway
- buffer size for communication is now configurable to avoid problems
with too small buffers
- Previous solution for openhab#6963 was not sufficient. Should be finally done
with these changes
* Retrieving the duty cycle is sufficient to check connection
- ping requests could therefore be safely removed problems with the automatic reconnection were solved.
* Changed to explicit list of Exception

Fixes openhab#8808
themillhousegroup pushed a commit to themillhousegroup/openhab2-addons that referenced this issue May 10, 2021
* Replace deprecated constructors
* Removed no longer existing settings from the documentation. They were already marked as deprecated since several versions.
* Refactored communication with the HM gateway
- simplified coding for the communication with the gateway
- buffer size for communication is now configurable to avoid problems
with too small buffers
- Previous solution for openhab#6963 was not sufficient. Should be finally done
with these changes
* Retrieving the duty cycle is sufficient to check connection
- ping requests could therefore be safely removed problems with the automatic reconnection were solved.
* Changed to explicit list of Exception

Fixes openhab#8808

Signed-off-by: Martin Herbst <develop@mherbst.de>
Signed-off-by: John Marshall <john.marshall.au@gmail.com>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
* Replace deprecated constructors
* Removed no longer existing settings from the documentation. They were already marked as deprecated since several versions.
* Refactored communication with the HM gateway
- simplified coding for the communication with the gateway
- buffer size for communication is now configurable to avoid problems
with too small buffers
- Previous solution for openhab#6963 was not sufficient. Should be finally done
with these changes
* Retrieving the duty cycle is sufficient to check connection
- ping requests could therefore be safely removed problems with the automatic reconnection were solved.
* Changed to explicit list of Exception

Fixes openhab#8808

Signed-off-by: Martin Herbst <develop@mherbst.de>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
* Replace deprecated constructors
* Removed no longer existing settings from the documentation. They were already marked as deprecated since several versions.
* Refactored communication with the HM gateway
- simplified coding for the communication with the gateway
- buffer size for communication is now configurable to avoid problems
with too small buffers
- Previous solution for openhab#6963 was not sufficient. Should be finally done
with these changes
* Retrieving the duty cycle is sufficient to check connection
- ping requests could therefore be safely removed problems with the automatic reconnection were solved.
* Changed to explicit list of Exception

Fixes openhab#8808

Signed-off-by: Martin Herbst <develop@mherbst.de>
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

No branches or pull requests

5 participants