Google Assistant Integration Errors - API Logs

Hello community! I’m trying to track communications errors between Google Cloud Platform and my local Home Assistant. I followed the official guide for the integration and it works, I’m able to expose my devices and control them via Google Home BUT at night (8pm-11pm) I am getting connection errors more and more often.

Initially I thought it could be a network problem so I checked my firewall policy and logs and confirmed that every time I got an error there was a log accepting and allowing the traffic on my firewall and no errors on Home Assistant, so I started looking somewhere else and I noticed latency and token errors on the Google Cloud project.

{
  "textPayload": "requestId 6028005896104290641 failed with code: OPEN_AUTH_FAILURE",
  "insertId": "6nwgajg2jflrrw",
  "resource": {
    "type": "assistant_action",
    "labels": {
      "project_id": "Dark_Wolf_HA",
      "version_id": "",
      "action_id": "SMART_HOME_QUERY"
    }
  },
  "timestamp": "2021-05-18T03:30:30.117741314Z",
  "severity": "ERROR",
  "logName": "projects/Dark_Wolf_HA/logs/actions.googleapis.com%2Factions",
  "receiveTimestamp": "2021-05-18T03:30:30.125297895Z"
}

{
  "textPayload": "requestId 6028005896104290641: Agent responded empty JSON.",
  "insertId": "6nwgajg2jflrrx",
  "resource": {
    "type": "assistant_action",
    "labels": {
      "project_id": "Dark_Wolf_HA",
      "version_id": "",
      "action_id": "SMART_HOME_QUERY"
    }
  },
  "timestamp": "2021-05-18T03:30:30.117743617Z",
  "severity": "ERROR",
  "logName": "projects/Dark_Wolf_HA/logs/actions.googleapis.com%2Factions",
  "receiveTimestamp": "2021-05-18T03:30:30.125297895Z"
}

{
  "insertId": "4pwga1b8a",
  "jsonPayload": {
    "request": {
      "uri": "https://darkwolfslv.********.com:8123/auth/token",
      "method": "POST",
      "body": "grant_type=refresh_token&refresh_token=REDACTED_VALUE&client_id=https://oauth-redirect.googleusercontent.com/r/Dark_Wolf_HA&client_secret=REDACTED_VALUE"
    },
    "errorReason": "Failed to get response from 3P. 3P returned malformed response like invalid response code or un-inflatble body.",
    "step": "REFRESH_ACCESS_TOKEN",
    "@type": "type.googleapis.com/google.identity.accountlinking.type.AccountLinkingError"
  },
  "resource": {
    "type": "assistant_action_project",
    "labels": {
      "project_id": "Dark_Wolf_HA"
    }
  },
  "timestamp": "2021-05-18T03:30:30.125Z",
  "severity": "ERROR",
  "logName": "projects/Dark_Wolf_HA/logs/accountlinking-pa.googleapis.com%2Ferror",
  "receiveTimestamp": "2021-05-18T03:30:30.643615475Z"
}

{
  "textPayload": "requestId 17816129285757813047: Agent responded empty JSON.",
  "insertId": "qxgb67g18mposr",
  "resource": {
    "type": "assistant_action",
    "labels": {
      "project_id": "Dark_Wolf_HA",
      "version_id": "",
      "action_id": "SMART_HOME_QUERY"
    }
  },
  "timestamp": "2021-05-18T03:30:38.692974263Z",
  "severity": "ERROR",
  "logName": "projects/Dark_Wolf_HA/logs/actions.googleapis.com%2Factions",
  "receiveTimestamp": "2021-05-18T03:30:38.698618570Z"
}

{
  "insertId": "1e89c3g297fcij",
  "jsonPayload": {
    "executionLog": {
      "executionResults": [
        {
          "latencyMsec": "2275",
          "actionResults": [
            {
              "action": {
                "actionType": "STATE_QUERY"
              },
              "device": {
                "deviceType": "LIGHT"
              },
              "status": {
                "externalDebugString": "Failed to add authorization token to the HTTP header. Error: 'generic::failed_precondition: Failed to fetch access token.",
                "statusType": "EXECUTION_OPEN_AUTH_FAILURE"
              }
            },
            {
              "status": {
                "externalDebugString": "Failed to add authorization token to the HTTP header. Error: 'generic::failed_precondition: Failed to fetch access token.",
                "statusType": "EXECUTION_OPEN_AUTH_FAILURE"
              },
              "action": {
                "actionType": "STATE_QUERY"
              },
              "device": {
                "deviceType": "LIGHT"
              }
            },
            {
              "device": {
                "deviceType": "LIGHT"
              },
              "action": {
                "actionType": "STATE_QUERY"
              },
              "status": {
                "externalDebugString": "Failed to add authorization token to the HTTP header. Error: 'generic::failed_precondition: Failed to fetch access token.",
                "statusType": "EXECUTION_OPEN_AUTH_FAILURE"
              }
            }
          ],
          "requestId": "17816129285757813047",
          "executionType": "PARTNER_CLOUD"
        }
      ]
    },
    "locale": "en-US"
  },
  "resource": {
    "type": "assistant_action_project",
    "labels": {
      "project_id": "Dark_Wolf_HA"
    }
  },
  "timestamp": "2021-05-18T03:30:38.699501280Z",
  "severity": "ERROR",
  "logName": "projects/Dark_Wolf_HA/logs/assistant_smarthome%2Fassistant_smarthome_logs",
  "receiveTimestamp": "2021-05-18T03:30:38.699501280Z"
}

{
  "insertId": "c7l7zsb7z",
  "jsonPayload": {
    "errorReason": "Failed to get response from 3P. 3P returned malformed response like invalid response code or un-inflatble body.",
    "@type": "type.googleapis.com/google.identity.accountlinking.type.AccountLinkingError",
    "request": {
      "body": "grant_type=refresh_token&refresh_token=REDACTED_VALUE&client_id=https://oauth-redirect.googleusercontent.com/r/Dark_Wolf_HA&client_secret=REDACTED_VALUE",
      "uri": "https://darkwolfslv.********.com:8123/auth/token",
      "method": "POST"
    },
    "step": "REFRESH_ACCESS_TOKEN"
  },
  "resource": {
    "type": "assistant_action_project",
    "labels": {
      "project_id": "Dark_Wolf_HA"
    }
  },
  "timestamp": "2021-05-18T03:30:38.701Z",
  "severity": "ERROR",
  "logName": "projects/Dark_Wolf_HA/logs/accountlinking-pa.googleapis.com%2Ferror",
  "receiveTimestamp": "2021-05-18T03:30:38.819961896Z"
}

And to be honest I do not know where to start to try to fix them. Do you have any ideas? Is this the best place to report this type of errors?

Thank you!

Bump :thinking: - Bump :thinking: - Bump :thinking:

Is there a better place to report this? I tried on Reddit and Discord but nobody has been able to help me :frowning:

I have similar error: I must tell twice what I want to google home. the first attempt always fails

Hi Marrav, I never got a recommendation from the community but I followed this video that follows a slightly different version on how to link the account to HA (compared with the official guide and the error reduced, but still present.

I hope this helps.

Hi, thank you for reply. I have this same setup and it’s has worked without problem for a couple of years.
My problem has begun in the last four months.
Thanks anyway,
Mario.

Getting something very similar in the logs also - anyone been able to resolve this? I can control devices though the google home app, trying to sync or control devices via voice tells me HASS is not repsonding.

  "textPayload": "requestId 4612116576012706658 failed with code: BACKEND_FAILURE",
  "insertId": "ozls5vft6v4l2",
  "resource": {
    "type": "assistant_action",
    "labels": {
      "version_id": "",
      "project_id": "hass-*****",
      "action_id": "SMART_HOME_EXECUTE"
    }
  },
  "timestamp": "2021-11-01T01:41:37.181194684Z",
  "severity": "ERROR",
  "logName": "projects/hass-******/logs/actions.googleapis.com%2Factions",
  "receiveTimestamp": "2021-11-01T01:41:37.188414188Z"
}

{
  "textPayload": "requestId 4612116576012706658: Agent responded empty JSON.",
  "insertId": "ozls5vft6v4l3",
  "resource": {
    "type": "assistant_action",
    "labels": {
      "project_id": "hass-*****",
      "action_id": "SMART_HOME_EXECUTE",
      "version_id": ""
    }
  },
  "timestamp": "2021-11-01T01:41:37.181197332Z",
  "severity": "ERROR",
  "logName": "projects/hass-*****/logs/actions.googleapis.com%2Factions",
  "receiveTimestamp": "2021-11-01T01:41:37.188414188Z"
}

@grantc
Hey Grant, I have a similar issue, I’m getting this error in the integration:

Retrying setup: Device manager error: Error from API: 400: FAILED_PRECONDITION: Precondition check failed.: Bad Request
image

Where did you find the logs? I see lots of errors in the Device Mgt API, but just a numeric total. I’m not sure where to read the specific errors

Also under Device Access Console is says “Sandbox”, is that ok?
image