Google Assistant Integration Errors - API Logs

Tags: #<Tag:0x00007fc3e5043930>

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: