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.

HomeGraph API requestSync 404 error

See original GitHub issue

I’m following the readme to setup this demo smart home project, but struggling to make request-sync to work.

Here’s what I have done:

  • Created new project in Google Cloud Console and enabled Google HomeGraph API
  • Created API key for HomeGraph API
  • Set up smart-home-provider-cloud.js on a hosted server (HTTPS on port 433 with a valid certificate)
  • Logged in as ‘rick’ to nodejs webapp and created lamp device
  • Created new project in Google Actions Console and added new smart home app
  • Filled in all required data (including account linking) and executed TEST DRAFT
  • Added (linked) my test app inside Google Home devices page (on my phone) (as default user ‘rick’ with id ‘1234’)
  • Seen all the OAuth magic in the webapp logs and original post /smarthome SYNC with "agentUserId":"1234" in response payload

At this moment:

  • I see my lamp device in my projects’ device list in Google Assistant settings
  • I can control/query lamp status with “Hey google, turn off the lights”

But when I add new device inside webapp I see request-sync response 404 Not Found in the logs. curl request from the docs also gives me 404 error (Requested entity was not found.). I’ve tried wrong API key, this gives me 403 error, as expected. I’ve tried malformed JSON payload (like {"age1nt_user_id": "1234"}), this gives me 400 error, as expected. I’ve tried to disable/enable Google HomeGraph API to no result.

Is there anything else to try to troubleshoot the issue?

The only think I’m unsure about is the word “enable” in the manual here:

Enable Request-Sync API using these instructions.

I don’t see any way to enable/disable this API. It seems to me that it is a method of HomeGraph API which I can call as long as I have valid agentUserId (I do – it’s 1234 as hardcoded in the webapp and sent as response to original SYNC request) and API key (I do), but still have a 404 response.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
berliccommented, Feb 17, 2018

@Fleker Thanks for the hint about different accounts. I checked every step from scratch very carefully and it appeared that when one add new project to “Actions on Google”, a dropdown appears that allows to select existing project from Google Cloud Platform. That was the answer! My actions app and HomeGraph API was on different projects. I guess it is worth mentioning in readme that those must be on the same project to work correctly.

0reactions
manikanta14038commented, Jan 2, 2020

getting this error for google home.

Error: Requested entity was not found. at Gaxios._request (/srv/node_modules/googleapis/node_modules/gaxios/build/src/gaxios.js:85:23) at <anonymous> at process.tickDomainCallback (internal/process/next_tick.js:229:7) response: { config: { url: ‘https://homegraph.googleapis.com/v1/devices:requestSync’, method: ‘POST’, paramsSerializer: [Function], data: [Object], headers: [Object], params: {}, validateStatus: [Function], retry: true, body: ‘{“agentUserId”:“1234”}’, responseType: ‘json’, retryConfig: [Object] }, data: { error: [Object] }, headers: { ‘alt-svc’: ‘quic=“:443”; ma=2592000; v=“46,43”,h3-Q050=“:443”; ma=2592000,h3-Q049=“:443”; ma=2592000,h3-Q048=“:443”; ma=2592000,h3-Q046=“:443”; ma=2592000,h3-Q043=“:443”; ma=2592000’, ‘cache-control’: ‘private’, connection: ‘close’, ‘content-encoding’: ‘gzip’, ‘content-type’: ‘application/json; charset=UTF-8’, date: ‘Thu, 02 Jan 2020 10:58:04 GMT’, server: ‘ESF’, ‘transfer-encoding’: ‘chunked’, vary: ‘Origin, X-Origin, Referer’, ‘x-content-type-options’: ‘nosniff’, ‘x-frame-options’: ‘SAMEORIGIN’, ‘x-xss-protection’: ‘0’ }, status: 404, statusText: ‘Not Found’, request: { responseURL: ‘https://homegraph.googleapis.com/v1/devices:requestSync’ } }, config: { url: ‘https://homegraph.googleapis.com/v1/devices:requestSync’, method: ‘POST’, paramsSerializer: [Function], data: { agentUserId: ‘1234’ }, headers: { ‘x-goog-api-client’: ‘gdcl/3.2.0 gl-node/8.16.0 auth/5.7.0’, ‘Accept-Encoding’: ‘gzip’, ‘User-Agent’: ‘google-api-nodejs-client/3.2.0 (gzip)’, Authorization: 'Bearer ya29.c.KpUBtwcfCyWn9GqWxbwghQNyxhJGpN7H5BRkxJD3zfzGLRgmwB1-ag1RDWjrNFki7qtwICPowS39YanY6SZE8W84TbMNOMxXnutUh1cru543HwhwtBEx3MRpn5pujCMt8KTly6BebwvuH9NvvTfRcWWX7UruEEOXr8IlsNmoNzZt37UPkO8HGTaPYEyIXERj_eZHdG-BY0’, ‘Content-Type’: ‘application/json’, Accept: ‘application/json’ }, params: {}, validateStatus: [Function], retry: true, body: ‘{“agentUserId”:“1234”}’, responseType: ‘json’, retryConfig: { currentRetryAttempt: 0, retry: 3, retryDelay: 100, httpMethodsToRetry: [Array], noResponseRetries: 2, statusCodesToRetry: [Array] } }, code: 404, errors: [ { message: ‘Requested entity was not found.’, domain: ‘global’, reason: ‘notFound’ } ] }

Read more comments on GitHub >

github_iconTop Results From Across the Web

HomeGraph API 404 : r/homeassistant - Reddit
The request_sync service may fail with a 404 if the project_id of the HomeGraph API differs from the project_id of the Actions SDK...
Read more >
Failed to get device list from HomeGraph: Requested entity ...
Request Sync always returns 404 : "Error: Requested entity was not found." 1 · Google Smart Home Action: Account linking successful, SYNC ...
Read more >
Third party integrations - Home Assistant Community
Hi, I'm running v0.104.3, and setup Google Assistant with a service account. I have the HomeGraph API enabled yet the message persists.
Read more >
Request Sync | Cloud-to-cloud - Google Home Developers
Enable the Google HomeGraph API; Create a Service Account Key; Call the API. Error responses. Key Point: You must implement Request Sync in ......
Read more >
google.homegraph - googleapis documentation
... API Key for the request */ auth?: | string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth; /**...
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