question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SmartHomeApp.reportState error

See original GitHub issue

Is this error below because the grpc-core version is too low?

io.grpc.internal.ManagedChannelOrphanWrapper line:163 -*~*~*~ Channel ManagedChannelImpl{logId=144961, target=homegraph.googleapis.com} was not shutdown properly!!! ~*~*~*
    Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
	at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:103) [grpc-core-1.15.1.jar:1.15.1]
	at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:53) [grpc-core-1.15.1.jar:1.15.1]
	at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:44) [grpc-core-1.15.1.jar:1.15.1]
	at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:410) [grpc-core-1.15.1.jar:1.15.1]
	at com.google.actions.api.smarthome.SmartHomeApp.reportState(SmartHomeApp.kt:126) [actions-on-google-1.5.0.jar:?] 

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:32 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
proppycommented, Jun 15, 2020

Sorry for not seeing the @mention earlier.

It seems that action-on-google-java creates a new ManagedChannel on every request: https://github.com/actions-on-google/actions-on-google-java/blob/master/src/main/kotlin/com/google/actions/api/smarthome/SmartHomeApp.kt#L126

As pointed by @cbeaujoin in https://github.com/actions-on-google/actions-on-google-java/issues/30#issuecomment-529400776 and comments in the official gRPC sample for Java: https://github.com/grpc/grpc-java/blob/master/examples/src/main/java/io/grpc/examples/helloworld/HelloWorldClient.java#L96 such channels should be explicitly shutdown when no longer being used to prevent leaks.

A workaround could be for client to directly depends on the HomeGraph API Client Library for Java https://github.com/googleapis/google-api-java-client-services/tree/master/clients/google-api-services-homegraph/v1 instead of using the reportState helper and reuse a single channel tied to the lifetime of the application.

1reaction
kingskylarcommented, Aug 13, 2020

@Fleker Hi,how is this issue?it’s a long time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SmartHomeApp: reportState on Java always returning ...
I'm guessing the problem is that I'm not passing the device name or any device identifier, but it doesn't seems to have an...
Read more >
Report State | Cloud-to-cloud - Google Home Developers
Prerequisites; Deploy the Report State dashboard. Error Responses. Key Point: You must implement Report State in order to submit a smart ...
Read more >
Understand State and Change Reporting | Alexa Skills Kit
You report state to Alexa in three ways: Alexa requests the state with an Alexa.ReportState directive. For example, a customer opens the Alexa...
Read more >
actions-on-google@3.0.0 - jsDocs.io
SmartHome; SmartHomeApp ... HTTP Code 403 will be thrown by default on verification error. ... This is used for report state.
Read more >
App | Local Home SDK | Actions on Google Smart Home
import App = smarthome.App; const localHomeApp: App = new App("1.0.0"); localHomeApp .onIdentify(identifyHandler) .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found