Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

SSE connection crashes on DateTime event updates #4678

Closed
d3rh3ld opened this issue Dec 4, 2017 · 3 comments
Closed

SSE connection crashes on DateTime event updates #4678

d3rh3ld opened this issue Dec 4, 2017 · 3 comments
Labels

Comments

@d3rh3ld
Copy link

d3rh3ld commented Dec 4, 2017

I want to refer my thread in the community:
https://community.openhab.org/t/basicui-offline-waiting-for-connection-to-become-available-message-triggered-by-item-update/36828

It seems the message “Offline: waiting for connection to become available” occours when an item, which is visible in the sitemap, gets updated.
And it does not matter if the update is triggered by the user in the basicUI or by an automated update.
My example with the NTP binding:

DateTime CurrentDate   "Datum [%1$tA, %1$td.%1$tm.%1$tY %1$tH:%1$tM]" <calendar>  {channel="ntp:ntp:local:dateTime"}

sitemap:
Text item=CurrentDate

Log:

11:25:40.373 [INFO ] [smarthome.event.ItemStateChangedEvent] - CurrentDate changed from 2017-12-01T11:25:15.362+0100 to 2017-12-01T11:25:40.365+0100
11:25:40.379 [ERROR] [ge.internal.WriterInterceptorExecutor] - MessageBodyWriter not found for media type=text/event-stream, type=class org.glassfish.jersey.media.sse.OutboundEvent, genericType=class org.glassfish.jersey.media.sse.OutboundEvent.

11:26:05.386 [INFO ] [smarthome.event.ItemStateChangedEvent] - CurrentDate changed from 2017-12-01T11:25:40.365+0100 to 2017-12-01T11:26:05.372+0100
11:26:05.396 [ERROR] [ge.internal.WriterInterceptorExecutor] - MessageBodyWriter not found for media type=text/event-stream, type=class org.glassfish.jersey.media.sse.OutboundEvent, genericType=class org.glassfish.jersey.media.sse.OutboundEvent.

In BasicUI i get the message “Offline: waiting for connection to become available” everytime the error is logged.

After removing the sitemap element:

11:33:35.434 [INFO ] [smarthome.event.ItemStateChangedEvent] - CurrentDate changed from 2017-12-01T11:33:10.420+0100 to 2017-12-01T11:33:35.422+0100
11:34:00.488 [INFO ] [smarthome.event.ItemStateChangedEvent] - CurrentDate changed from 2017-12-01T11:33:35.422+0100 to 2017-12-01T11:34:00.479+0100
11:34:25.493 [INFO ] [smarthome.event.ItemStateChangedEvent] - CurrentDate changed from 2017-12-01T11:34:00.479+0100 to 2017-12-01T11:34:25.481+0100
11:34:50.492 [INFO ] [smarthome.event.ItemStateChangedEvent] - CurrentDate changed from 2017-12-01T11:34:25.481+0100 to 2017-12-01T11:34:50.484+0100

But as expected I still get the error, when other items which are still in the sitemap are getting updated.
When i close the browser, the errors in the log are gone.
Even opening an subpage (group) in the basicui results in no more errors.
After returning to the mainpage the errors are back again.
I tested this in Chrome and Firefox

I’m running the OH2 snapshot #1106

@kaikreuzer kaikreuzer changed the title [basicUI] “Offline: waiting for connection to become available” Message triggered by item update SSE connection crashes on DateTime event updates Dec 4, 2017
@kaikreuzer
Copy link
Contributor

Thanks for the report - from what it seems, it is unrelated to the Basic UI itself, but the SSE connection breaks on the server. I have updated the issue title accordingly.

@triller-telekom
Copy link
Contributor

I just tried to reproduce the issue but it worked for me....

@d3rh3ld How does your sitemap look like exactly? Can you reproduce it with this one, i.e. by adding a Frame element around your item?

sitemap demo label="Demo Sitemap" {
	Frame label="Demo Items" {
		Text item=CurrentDate
	}
}

I left this basicui main page open for about 5 minutes now and it always shows me the correct date and I also do not get any errors.

@d3rh3ld
Copy link
Author

d3rh3ld commented Dec 11, 2017

Sorry for the late answer, but i tried a lot of things.
Actually i did an apt-get purge and set up everything step by step from scratch.
Now i have a running minimal system only containing the ntp thing.

The cyclic error is gone, also i don't have to delete the cache folder in order to get successfull restarts of the openhab service.

But the CurrentDate enty in the sitemap doesn't update on its own, i have to do a manual refresh in the browser. Any ideas how to get rid of this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants