HomeGraph API requestSync 404 error
See original GitHub issueI’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:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
@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.
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’ } ] }