google-home / smart-home-nodejs

A sample of the Smart Home device control APIs in Actions on Google
Apache License 2.0
894 stars 292 forks source link

Got OPEN_AUTH_FAILURE suddenly after action working well for months. #490

Closed harryz2016 closed 3 years ago

harryz2016 commented 4 years ago

Several months ago, we built our google smart home action from the sample provided here. It went well and we published it. However, a couple of weeks ago, it suddenly stopped working and giving OPEN_AUTH_FAILURE. Can you help please?

Authentication: We use Cognito with OAuth2.0 as our identity provider for Google smart Home action.

Symptoms: Google voice commands don’t reach fulfilment server, but leaves an OPEN_AUTH_FAILURE error in Google’s log viewer (related log attached below). It looks like something wrong with access/refresh token on Google’s side. The account linking is working fine and it is able to display all our devices in Google Home app.

{ insertId: "1kwa5ghga57i03c" logName: "projects/t2fi-test/logs/actions.googleapis.com%2Factions" receiveTimestamp: "2020-01-08T07:17:24.047355418Z"

resource: {

labels: { action_id: "SMART_HOME_EXECUTE" project_id: "t2fi-test" version_id: "" } type: "assistant_action" } severity: "ERROR" textPayload: "requestId 5702959872077467036 failed with code: OPEN_AUTH_FAILURE" timestamp: "2020-01-08T07:17:24.039958036Z" }

ALONG WITH: { insertId: "1kwa5ghga57i03d" logName: "projects/t2fi-test/logs/actions.googleapis.com%2Factions" receiveTimestamp: "2020-01-08T07:17:24.047355418Z"

resource: {

labels: {…} type: "assistant_action" } severity: "ERROR" textPayload: "requestId 5702959872077467036: Agent responded empty JSON." timestamp: "2020-01-08T07:17:24.039961134Z" }

Fleker commented 4 years ago

Can you go back to the console and make sure the project is in a testing state. The test may have expired.

harryz2016 commented 4 years ago

Can you go back to the console and make sure the project is in a testing state. The test may have expired.

Hi @Fleker , Thanks for your prompt response. Maybe because we have published/released the smart home action to public, there seems to be no sign of "testing state" or expiry date displayed in the console. If there is testing state to enable, can you please point it out for me?

Other parallel symptoms: When we added device to test request sync, there was an error message showing in fulfilment server's log: “{ "error": { "code": 403, "message": "The caller does not have permission", "status": "PERMISSION_DENIED" } }”. Also, we tried to unlink and then re-do the account linking. After that, the issue remains the same with nothing reaches our fulfilment server.

UPDATE: However, this morning, all voice commands (onExecute), OAuth2.0 token exchange and request sync just came back and works 100% after being “broken” for 2 weeks… We changed absolutely NOTHING before it get fixed by itself.

Is there something we can do to prevent this happening again?

Fleker commented 4 years ago

I'm not entirely sure what problem happened, but it's good that it seems to be working again.

proppy commented 3 years ago

Closing as obsolete.