Chromecast Binding Log Errors

2.3.0

I have looked at several topics regarding log spamming by the Chromecast binding. Either it doesn’t seem to be what I’m seeing or they are old, or they are idle.

Is there some way to trace which particular Chromecast generated the logged errors. The log output does not seem to provide any kind of link. Is there anything uniquely identifiable that I can take into, say Karaf, to figure this out?

@vzorglub had made this suggested workaround - [SOLVED] Chromecast binding freezes openHab?

I have given this a try but, alas, it seems that I am still seeing Chromecast binding errors in the log. I have installed the Network binding to ping the “physical” Chromecasts. But I also have two Chromecast audio groups (i.e., no ping option for these). I edited each network device I added to set the refresh interval to 1000ms. @vzorglub - Is there anything else I needed to do?

The log does not give information on which Chromecast generated the error (if it does, I haven’t been able to decipher it). I wonder if there’s a similar narcolepsy issue with audio groups? If so, I don’t know of a way to keep them “awake”.

Regards.

Mike

No, but then I only have one device…

Did you try upgrading to the snapshot (or milestone release). As @wborn suggested one of the issues you reported is solved in the snapshot version.

I’ve created a org.openhab.binding.chromecast-2.4.0-SNAPSHOT.jar that also contains the forthcoming chromecast-java-api-v2 fixes for:

It also includes the following 2.4.0-SNAPSHOT specific PRs:

So that should resolve quite some issues compared to the Chromecast Binding that is part of the openHAB 2.3.0 release. :slight_smile:

I gave this 2.4.0-SNAPSHOT JAR a brief test with 2.3.0 and it seems to work properly so far.


To use it:

  1. Uninstall the existing Chromecast Binding (Paper UI -> Add-ons -> Bindings)
  2. Copy org.openhab.binding.chromecast-2.4.0-SNAPSHOT.jar to the openHAB addons directory

To revert to the default 2.3.0 Chromecast Binding:

  1. Delete org.openhab.binding.chromecast-2.4.0-SNAPSHOT.jar again from the openHAB addons directory
  2. Install the Chromecast Binding (Paper UI -> Add-ons -> Bindings)

With this JAR you’ll probably still occasionally see some disconnection warnings (issue #3770)

These can be suppressed by raising the log level in the Console with:

log:set error su.litvak.chromecast.api.v2

  • I have installed the 2.4.0 snapshot of the binding
  • I have set logging to the Litvak library to ERROR
  • I have the Network binding pinging each Chromecast every minute
  • I have set a custom logger for the binding set to TRACE level logging

I will let openHAB run for a few hours to collect data in the log. I’ll provide an update then.

Regards.

Mike

P.S. Should I replace my chromecast-java-api-v2 library with the latest development branch version? I understand that it is not prudent to put that development version in the openHAB package. But for testing purposes, I could put in in my environment. If so, where can I get that newer library and how do I replace it (and archive the current version)?

Preliminary information… the binding appears to be experiencing an “event” approximately every 30 seconds. It is logging a set of these for each event.

20-Sep-2018 00:05:09.627 [DEBUG] [inding.chromecast.internal.ChromecastEventReceiver] - Received an 'UNKNOWN' event (class=class org.codehaus.jackson.JsonNode)
20-Sep-2018 00:05:20.217 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Scheduling connection
20-Sep-2018 00:05:20.220 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Canceling connection
20-Sep-2018 00:05:32.778 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Scheduling connection
20-Sep-2018 00:05:32.783 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Canceling connection
20-Sep-2018 00:05:36.556 [DEBUG] [ab.binding.chromecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out

The number of pairs of Scheduling connection and Canceling connection log entries between the Received and Failed log entries varies - I’m seeing anywhere between 1 to 3 pairs per event.

I’ve seen no Chromecast related errors or warnings in the openhab log. Before tonight’s changes (new binding, litvak library logging level), even with the custom Chromecast binding logger setup, I was seeing openhab.log Chromecast related log entries.

You are already using it because it is contained within the org.openhab.binding.chromecast-2.4.0-SNAPSHOT.jar. If you would unzip it you’ll find a lib directory with a api-v2-0.10.4.jar. :slight_smile:

These fixes are now part of the latest openHAB 2.4.0-SNAPSHOT build (#1​37​3) which uses chromecast-java-api-v2 version 0.10.4 that got released recently. See also PR #4032.

So the JAR is no longer necessary when using the latest SNAPSHOT build. :slight_smile:

I’m holding off on taking the plunge on the full openHAB 2.4.0-SNAPSHOT. I’m probably too conservative, but I’m a little reticent to try anything other than the “released” openHAB. I’m OK with some baby steps, e.g., one binding at a time. Can I still just “upgrade” my Chromecast binding to this latest update on top of my 2.3.0 openHAB by downloading the latest Chromecast binding JAR? Can you make it available in the same download location as before?

Regards.

Mike

It should still work and you can download the same JAR that is used with the latest openHAB 2.4.0-SNAPSHOT downloads from:

https://openhab.jfrog.io/openhab/online-repo-snapshot/2.4/org/openhab/binding/org.openhab.binding.chromecast/2.4.0-SNAPSHOT/org.openhab.binding.chromecast-2.4.0-SNAPSHOT.jar

That JAR was build by the openHAB Jenkins build server today.

OK, new binding deployed. Getting repeated BaseThingHandler warnings. These appear to be generated roughly every 13 seconds.

2018-09-26 16:52:40.230 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:xxx' to inbox.
2018-09-26 16:52:40.248 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:xxx' to inbox.
2018-09-26 16:52:40.257 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:xxx' to inbox.
2018-09-26 16:52:40.268 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:audiogroup:xxx' to inbox.
2018-09-26 16:52:40.345 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:xxx' to inbox.
2018-09-26 16:52:40.363 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:audio:xxx' to inbox.
2018-09-26 16:52:40.375 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:audiogroup:xxx' to inbox.
2018-09-26 16:52:40.386 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:xxx' to inbox.
2018-09-26 16:52:40.400 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'chromecast:chromecast:xxx' to inbox.
2018-09-26 16:54:21.968 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:54:33.012 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:54:46.128 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:54:59.248 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:55:12.368 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:55:25.557 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:55:38.688 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:55:51.809 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:56:04.928 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:56:18.048 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:56:31.173 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:56:44.288 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:56:58.048 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:57:11.168 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:57:24.287 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:57:37.408 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:57:50.528 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:58:03.088 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:58:16.208 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:58:29.328 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:58:42.448 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:58:55.568 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:59:08.128 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.
2018-09-26 16:59:21.248 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler ChromecastHandler tried updating the thing status although the handler was already disposed.

I created a fix for those in 2.4.0-SNAPSHOT after seeing Handler disposed?. Haven’t seen them myself thereafter. Restarting openHAB should normally solve it.

In the openHAB 2.4.0-SNAPSHOT? In other words, the fix in in some other part of the openHAB package… and not in the Chromecast 2.4.0-SNAPSHOT itself; yes?

I ask because I retrieved the Chromecast binding you updated today, I stopped OH2, deployed the new binding, and restarted OH2. This is when the warnings began.

In order to resolve this, I should go ahead and bite the bullet and update openHAB to 2.4.0-SNAPSHOT; yes?

Regards.

Mike

It was fixed in the binding itself. So either the 2.3.0 binding was running again or the issue is not fully solved.

Regarding the Chromecast binding it will not fix anything that’s not already in the JAR.

If you like to help out testing and/or SNAPSHOT builds fix your major issues or bring features you want to use now it may be worth it.

You could use also a more stable 2.4.0 milestone build instead. See:

Wouter,

I stopped openHAB and then started it again a few seconds later (to avoid the Jetty error 503 problem).

This time the Chromecast Things were not added (I suppose because they’d been added the first time this new binding started up). This time I am not getting the Handler already disposed warnings either. Maybe it only occurs the very first time? Perhaps a clue in finding what caused the issue?

It does appears that I have the latest Chromecast binding JAR.

/srv/openhab2-addons# jar -tvf *.jar
  1226 Wed Sep 26 19:42:52 EDT 2018 META-INF/MANIFEST.MF
     0 Wed Sep 26 19:42:52 EDT 2018 META-INF/
     0 Wed Sep 26 19:42:50 EDT 2018 OSGI-INF/
     0 Wed Sep 26 19:42:50 EDT 2018 org/
     0 Wed Sep 26 19:42:50 EDT 2018 org/openhab/
     0 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/
     0 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/
     0 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/
     0 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/handler/
     0 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/
     0 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/binding/
     0 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/thing/
     0 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/config/
     0 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/i18n/
     0 Wed Sep 26 19:34:44 EDT 2018 lib/
     0 Wed Sep 26 19:42:52 EDT 2018 META-INF/maven/
     0 Wed Sep 26 19:42:52 EDT 2018 META-INF/maven/org.openhab.binding/
     0 Wed Sep 26 19:42:52 EDT 2018 META-INF/maven/org.openhab.binding/org.openhab.binding.chromecast/
   877 Wed Sep 26 19:42:50 EDT 2018 OSGI-INF/org.openhab.binding.chromecast.internal.ChromecastHandlerFactory.xml
  1331 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/config/config.xml
   469 Wed Sep 26 19:42:50 EDT 2018 OSGI-INF/org.openhab.binding.chromecast.internal.ChromecastDiscoveryParticipant.xml
  1580 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/i18n/chromecast_de.properties
  4302 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastDiscoveryParticipant.class
596435 Wed Sep 26 19:34:44 EDT 2018 lib/protobuf-java-2.6.0.jar
 13154 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastStatusUpdater.class
131909 Wed Sep 26 19:34:44 EDT 2018 lib/api-v2-0.10.4.jar
  5575 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastHandlerFactory.class
765648 Wed Sep 26 19:34:44 EDT 2018 lib/jackson-mapper-asl-1.9.2.jar
  8790 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastCommander.class
   563 Wed Sep 26 19:34:44 EDT 2018 META-INF/maven/org.openhab.binding/org.openhab.binding.chromecast/pom.xml
   144 Wed Sep 26 19:42:52 EDT 2018 META-INF/maven/org.openhab.binding/org.openhab.binding.chromecast/pom.properties
  9228 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/handler/ChromecastHandler.class
  1198 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/handler/ChromecastHandler$Coordinator$1.class
228286 Wed Sep 26 19:34:44 EDT 2018 lib/jackson-core-asl-1.9.2.jar
  7059 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/handler/ChromecastHandler$Coordinator.class
  2942 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastAudioSink.class
  3316 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastBindingConstants.class
  3807 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastEventReceiver.class
  2608 Wed Sep 26 19:42:50 EDT 2018 org/openhab/binding/chromecast/internal/ChromecastScheduler.class
  2169 Wed Sep 26 19:34:44 EDT 2018 about.html
 12642 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/thing/thing-types.xml
   762 Wed Sep 26 19:34:44 EDT 2018 ESH-INF/binding/binding.xml

Cheers!

Mike

P.S.

“more stable” - yes, I might indeed give this a go :wink:

@wborn Wouter,

I updated to the latest openHAB SNAPSHOT (2.4.0~20180929001318-1 (Build #1375)) using openhabian-config. Doing so cleared my Karaf log setting for the litvak library log level back to WARN. The library is still generating warnings:

2018-09-29 01:14:03.350 [WARN ] [su.litvak.chromecast.api.v2.Channel ] - Error while reading
su.litvak.chromecast.api.v2.ChromeCastException: Remote socket closed
	at su.litvak.chromecast.api.v2.Channel.read(Channel.java:425) ~[188:org.openhab.binding.chromecast:2.4.0.201809261735]
	at su.litvak.chromecast.api.v2.Channel.access$200(Channel.java:51) ~[188:org.openhab.binding.chromecast:2.4.0.201809261735]
	at su.litvak.chromecast.api.v2.Channel$ReadThread.run(Channel.java:137) [188:org.openhab.binding.chromecast:2.4.0.201809261735]
2018-09-29 01:14:03.359 [WARN ] [su.litvak.chromecast.api.v2.Channel ] -  <--  null payload in message 
2018-09-29 01:17:40.515 [WARN ] [su.litvak.chromecast.api.v2.Channel ] - Error while reading
su.litvak.chromecast.api.v2.ChromeCastException: Remote socket closed
	at su.litvak.chromecast.api.v2.Channel.read(Channel.java:425) ~[188:org.openhab.binding.chromecast:2.4.0.201809261735]
	at su.litvak.chromecast.api.v2.Channel.access$200(Channel.java:51) ~[188:org.openhab.binding.chromecast:2.4.0.201809261735]
	at su.litvak.chromecast.api.v2.Channel$ReadThread.run(Channel.java:137) [188:org.openhab.binding.chromecast:2.4.0.201809261735]
2018-09-29 01:17:40.523 [WARN ] [su.litvak.chromecast.api.v2.Channel ] -  <--  null payload in message 

These may only be debug messages and normal, but I wanted to include them for you to be aware. The Chromecast log is full of these (as before):

29-Sep-2018 02:41:12.747 [DEBUG] [inding.chromecast.internal.ChromecastEventReceiver] - Received an 'UNKNOWN' event (class=class org.codehaus.jackson.JsonNode)
29-Sep-2018 02:41:12.888 [DEBUG] [ab.binding.chromecast.internal.ChromecastCommander] - Failed to request media status with a running app: Waiting for response timed out
29-Sep-2018 02:41:12.928 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Scheduling connection
29-Sep-2018 02:41:12.930 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Canceling connection
29-Sep-2018 02:41:26.609 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Scheduling connection
29-Sep-2018 02:41:26.610 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Canceling connection
29-Sep-2018 02:41:39.728 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Scheduling connection
29-Sep-2018 02:41:39.730 [DEBUG] [ab.binding.chromecast.internal.ChromecastScheduler] - Canceling connection
29-Sep-2018 02:41:44.625 [DEBUG] [inding.chromecast.internal.ChromecastEventReceiver] - Received an 'UNKNOWN' event (class=class org.codehaus.jackson.JsonNode)

Yes that is to be expected because issue #3770 is still open which needs to be fixed.

@wborn

OK. I’ll set the logging level back to ERROR to avoid that logging.

BTW, the “handler” issue did not occur after this “complete” openHAB update.

Should I set the Chromecast logging back to WARN or ERROR now instead of DEBUG? Have you all the information you want?

Thanks.

Mike

I would set it to the default log level which is: INFO

Yes I have more than enough info! :smile: I also still see the exceptions on my own setup.

EDIT: I answer myself :wink:

  1. Locate the URL of the jar file
  2. Find the ID of the binding you want to update in openHAB console using: bundle:list -s |grep YOURBINDING
  3. Run: bundle:update ID BINDINGURL

hey Michael,

could you give me a hint and explain how to just add this new binding to OH 2.3 rather than upgrading OH to the lastest snapshot?

Stefan