Problem with REST response

Hi!

I’m facing a problem with the REST response. I discovered this while playing around with Node-RED, because the module I use there calls OH2’s REST API to get all available items.

If I open this URL (http://10.10.1.155:8080/rest/items?recursive=false) in a browser, the response is “cut off”.

I tested a dedicated REST client application, the response is not complete there, too. If I fire the request several times, it is cut off at different locations. Sometimes the response in 64KB, but sometimes it’s only 56KB. Everytime the request gets a HTTP/200 OK.

When I try to execute this request via the API documentation, there is an error code shown.

The OH2 installation runs virtualized on Ubuntu 18.04 on a VMWare ESXi with 4 CPUs / 16 GB RAM / 200GB SSD storage, so I don’t think that the sizing is a problem here.

Has anybody discovered a similiar behavior?

OH version: 2.4.0-1

Nope, works for me, all 551 items turn up

It was working for me, too, for approx. 30 seconds. Both API documentation “Try Me” and REST client got a complete, parsable response.
Now - without changing anything, it is cut off, again. :frowning:

I got two successful responses in the tests. Basically it’s working 5% of the time. I have no idea where to look, now :slight_smile:

The successful response weights 66.6 KB:

It works for me on 2.5M3. I know there have been REST API changes between 2.4 and 2.5M3.

I watched the log files closely, there is only one error from the amazonecho-binding, where some Amazon-URL-calls are failing. I nevertheless uninstalled the binding, restarted OH2, and now it is working. 10/10 REST tests were successfully. I will continue to watch this, and I’m trying to check why the amazonecho-binding was failing.

But strange, that an individual binding error leads to incomplete REST responses.

One remark: now the request is handled within 50ms, with the incomplete responses before I was >2000ms. Probably some timeout somewhere while constructing the response…

I think there are some dependencies issues between some and the REST api that are being worked on.
It would be worth raising an issue on Github about your particular case, though

1 Like