Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google HomeGraph requestResync return status 500 #20960

Open
kalwinskidawid opened this issue May 8, 2024 · 0 comments
Open

Google HomeGraph requestResync return status 500 #20960

kalwinskidawid opened this issue May 8, 2024 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@kalwinskidawid
Copy link

kalwinskidawid commented May 8, 2024

Hey,
I have a problem with resync request send via HomeGraph dependency.
The problem is that your service returns error 500, but the SYNC from agentUserId goes out correctly. I've checked my request - it looks okay, moreover I receive SYNC from that agentUserId but your server's endpoint return wrong status code. Could you check it? I'd expect status 200.
I use com.google.apis:google-api-services-homegraph:v1-rev20230707-2.0.0

Code example

    public GoogleCredentials getCredentials() throws IOException {
        return this.googleServiceConfiguration.googleCredentials()
                .createScoped(List.of("https://www.googleapis.com/auth/homegraph"));
    }

    public HomeGraphService getHomeGraphService() throws GeneralSecurityException, IOException {
        return new HomeGraphService.Builder(
                GoogleNetHttpTransport.newTrustedTransport(),
                GsonFactory.getDefaultInstance(),
                new HttpCredentialsAdapter(this.getCredentials()))
                .setApplicationName("HomeGraphExample/1.0")
                .build();
    }

    public RequestSyncDevicesResponse requestToRereadDevicesByAgentUser(final String agentUserId) throws GeneralSecurityException, IOException {
        final RequestSyncDevicesRequest request = new RequestSyncDevicesRequest().setAgentUserId(agentUserId).setAsync(false);
        return this.getHomeGraphService().devices().requestSync(request).execute();
    }

Stack trace

com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
POST https://homegraph.googleapis.com/v1/devices:requestSync
{
  "code": 500,
  "errors": [
    {
      "domain": "global",
      "message": "Internal error encountered.",
      "reason": "backendError"
    }
  ],
  "message": "Internal error encountered.",
  "status": "INTERNAL"
}
        at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:428) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111) ~[google-http-client-1.42.3.jar!/:1.42.3]
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:514) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:455) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565) ~[google-api-client-1.33.0.jar!/:1.33.0]
        at net.auth.service.google.home.action.GoogleHomeGraphService.requestToRereadDevicesByAgentUser(GoogleHomeGraphService.java:50) ~[!/:0.0.1-SNAPSHOT]
@mpeddada1 mpeddada1 added type: question Request for information or clarification. Not an issue. priority: p2 Moderately-important priority. Fix may not be included in next release. labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants