Google TTS doesn't work after update to 2.5

After the update to 2.5 I get an error when storing the google credentials (the json file).
Any ideas please?

2020-03-10 18:19:37.314 [INFO ] [.googletts.internal.GoogleTTSService] - Using cache folder /var/lib/openhab2/cache/org.openhab.voice.googletts
2020-03-10 18:19:37.316 [ERROR] [org.openhab.voice.googletts         ] - bundle org.openhab.voice.googletts:2.5.2 (268)[org.openhab.voice.googletts.internal.GoogleTTSService(276)] : The activate method has thrown an exception
java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
com/google/auth/oauth2/OAuth2Utils.<clinit>()V @47: putstatic
  Reason:
Type 'com/google/api/client/json/jackson2/JacksonFactory' (current frame, stack[0]) is not assignable to 'com/google/api/client/json/JsonFactory'
  Current Frame:
bci: @47
flags: { }
locals: { }
stack: { 'com/google/api/client/json/jackson2/JacksonFactory' }
  Bytecode:
0000000: 1229 b800 2ab3 002b 122c b800 2ab3 002d
0000010: 122e b800 2ab3 002f bb00 3059 b700 31b3
0000020: 0032 bb00 3359 b700 34b3 0035 b800 36b3
0000030: 0006 1237 b800 38b3 0039 123a b300 1012
0000040: 3bb3 0015 b1

	at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:141) ~[?:?]
	at org.openhab.voice.googletts.internal.GoogleCloudAPI.createCredentials(GoogleCloudAPI.java:169) ~[?:?]
	at org.openhab.voice.googletts.internal.GoogleCloudAPI.setConfig(GoogleCloudAPI.java:144) ~[?:?]
	at org.openhab.voice.googletts.internal.GoogleTTSService.updateConfig(GoogleTTSService.java:215) ~[?:?]
	at org.openhab.voice.googletts.internal.GoogleTTSService.activate(GoogleTTSService.java:122) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228) ~[bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664) ~[bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510) [bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:317) [bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:307) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:340) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:982) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:955) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:900) [bundleFile:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) [org.eclipse.osgi-3.12.100.jar:?]
	at java.security.AccessController.doPrivileged(Native Method) [?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) [org.eclipse.osgi-3.12.100.jar:?]
	at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39) [bundleFile:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) [osgi.core-6.0.0.jar:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) [osgi.core-6.0.0.jar:?]
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) [osgi.core-6.0.0.jar:?]
	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) [osgi.core-6.0.0.jar:?]
	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) [osgi.core-6.0.0.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:920) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.setProperties(ServiceRegistrationImpl.java:168) [org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.updateServiceRegistration(SingleComponentManager.java:622) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:819) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:709) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:673) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:435) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:316) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$2.configurationEvent(RegionConfigurationSupport.java:118) [bundleFile:?]
	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1709) [bundleFile:?]
	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1651) [bundleFile:?]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [bundleFile:?]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [bundleFile:?]
	at java.lang.Thread.run(Thread.java:844) [?:?]

The bundle:list shows the addon on waiting status:

57 │ Active  │  80 │ 2.5.2                   │ openHAB Add-ons :: Bundles :: Voice :: VoiceRSS Text-to-Speech
259 │ Active  │  80 │ 3.4.0                   │ RRD4J
261 │ Active  │  80 │ 1.7.0                   │ Google API Common
262 │ Active  │  80 │ 1.42.0                  │ Google API GAX
263 │ Active  │  80 │ 0.13.0                  │ Google Auth Credentials
264 │ Active  │  80 │ 0.13.0                  │ Google Auth OAuth2 HTTP
265 │ Active  │  80 │ 20.0.0                  │ Guava: Google Core Libraries for Java
266 │ Active  │  80 │ 1.27.0                  │ Google HTTP Client Library for Java
267 │ Active  │  80 │ 1.10.0                  │ Apache Commons Codec
268 │ Waiting │  80 │ 2.5.2                   │ openHAB Add-ons :: Bundles :: Voice :: Google Cloud Text-to-Speech
269 │ Active  │  80 │ 1.3.3                   │ ThreeTen backport
270 │ Active  │  80 │ 1.27.0                  │ Google OAuth Client Library for Java
1 Like

First thing that comes to mind: did you clear the cache and tmp folder?
Sometimes you need to do that again, even when the upgrade script does it as well. And make sure to let OH run for a while and restart again (without clearing cache or tmp).

And welcome to the forum! :smiley:

1 Like

Thank you Ron for the reply and for the welcome message! And thank you all for building such a great tool!
Regarding my issue: I’ve just stopped OH, run openhab-cli clean-cache and start again. The problem still exists.
In the community I found a similar problem here:

but I don’t know how to use/adapt the solution to my problem… :frowning:

1 Like

That post is about missing dependencies, which may not be applicable to your issue. To check that, did you try bundle:diag? Any errors when you restart the binding bundle:restart?

1 Like
openhab> bundle:diag
openHAB Add-ons :: Bundles :: Voice :: Google Cloud Text-to-Speech (255)
------------------------------------------------------------------------
Status: Waiting
Declarative Services
org.openhab.voice.googletts.internal.GoogleTTSService (274)

Bundle:restart doesn’t show anything in the console, but I get the same exception in the logs.

2020-03-12 10:50:30.128 [INFO ] [.googletts.internal.GoogleTTSService] - Using cache folder /var/lib/openhab2/cache/org.openhab.voice.googletts
2020-03-12 10:50:30.129 [ERROR] [org.openhab.voice.googletts         ] - bundle org.openhab.voice.googletts:2.5.2 (255)[org.openhab.voice.googletts.internal.GoogleTTSService(280)] : The activate method has thrown an exception
java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/google/auth/oauth2/OAuth2Utils.<clinit>()V @47: putstatic
  Reason:
    Type 'com/google/api/client/json/jackson2/JacksonFactory' (current frame, stack[0]) is not assignable to 'com/google/api/client/json/JsonFactory'
  Current Frame:
    bci: @47
    flags: { }
    locals: { }
    stack: { 'com/google/api/client/json/jackson2/JacksonFactory' }
  Bytecode:
    0000000: 1229 b800 2ab3 002b 122c b800 2ab3 002d
    0000010: 122e b800 2ab3 002f bb00 3059 b700 31b3
    0000020: 0032 bb00 3359 b700 34b3 0035 b800 36b3
    0000030: 0006 1237 b800 38b3 0039 123a b300 1012
    0000040: 3bb3 0015 b1

	at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:141) ~[?:?]
	at org.openhab.voice.googletts.internal.GoogleCloudAPI.createCredentials(GoogleCloudAPI.java:169) ~[?:?]
	at org.openhab.voice.googletts.internal.GoogleCloudAPI.setConfig(GoogleCloudAPI.java:144) ~[?:?]

Can it be that I have a wrong version for some dependency?

1 Like

Sorry, can’t help you any further as I’m not using Google TTS…

1 Like

Sorry I cant be much of a help here. But I´m using Oh 2.5.0 on my Rpi 3B+ system and Google TTS without any issues.
I wonder if this could be a bug in the newer release, which I assume you´ve got?

1 Like

Thank you for your support.
I rolled back to 2.4 since anyway I noticed other issues also that came with 2.5 and I can tell you that with 2.4 it works again.
So the problem must come from the upgrade to 2.5, either due to the way I upgraded, or due to a bug or an error in the release itself…

And btw. the error doesn’t come from the Google TTS service, but from the library used to authenticate to Google services in general. I use also the Google Calendar add-on and this service also didn’t work with 2.5.

1 Like

Now you mention it… I think I recall there has been some changes to this… I´m not sure which thread though :frowning:

1 Like