Google Assistant Health Checks Failing

google-assistant

#1

I’m having a problem with the Actions on Google Health checks. In the simulator and on test devices things are running fine. The Actions on Google team has also approved the action and deployed it to production. However once it was approved and deployed, the health checks (every 5 min) are causing an error I can’t figure out the cause of, and it’s slowly driving me crazy :stuck_out_tongue_closed_eyes:.

These Health Checks are supposed to ping the launch intent (I included the request to the fulfilment function from the Health Check).

Some things I already tested:
Using toIntent() in the Launch intent is not causing an error.
Not a problem with the Cloud Function Cold starting

Here’s what Google Assistant support told me about what the health checks are doing:
Please note that Google monitors deployed Actions to verify that they’re available and responding to user requests. Each Action’s endpoint is required to respond to a default, no parameter, explicit invocation intent. This supports the scenario where the user asks to talk to the Action without providing any specific need (e.g. “I want to talk to invocation name”).

Health check is being done by sending a request to your Action. Google adds an argument to the request body so that you can detect a health check in your analytics. The launch intent request from Google will have an “is_health_check” argument passed to the intent. If there’s no response received, your Action will be tagged as “Unhealthy” and will be suspended. Please ensure that your Action is always in good standing (healthy and policy compliant) and webhook server is always accessible and responds within 5 seconds.

I’m really not sure what to make of the error message, other than it’s something to do with the Firestore integration I’m using.

Thank you in advance.

Log / Error Trace:

{
        "responseId": "9c15d8f9-bc1a-49c4-88cf-c5192e2c5d1e",
        "queryResult": {
                "queryText": "GOOGLE_ASSISTANT_WELCOME",
                "parameters": {},
                "allRequiredParamsPresent": true,
                "outputContexts": [
                        {
                                "name": "projects/wyzefind-jovo-integration/agent/environments/__aog-2/users/-/sessions/ABwppHFVubQ6jAeRz12-hsxqjezrm__0poztFy-yD-TtIoqE7VJW87jG2oAGXs5fRln79iOW1PMXXp5Vq1naPzqvFtfijrr40g/contexts/google_assistant_welcome"
                        },
                        {
                                "name": "projects/wyzefind-jovo-integration/agent/environments/__aog-2/users/-/sessions/ABwppHFVubQ6jAeRz12-hsxqjezrm__0poztFy-yD-TtIoqE7VJW87jG2oAGXs5fRln79iOW1PMXXp5Vq1naPzqvFtfijrr40g/contexts/actions_capability_audio_output"
                        },
                        {
                                "name": "projects/wyzefind-jovo-integration/agent/environments/__aog-2/users/-/sessions/ABwppHFVubQ6jAeRz12-hsxqjezrm__0poztFy-yD-TtIoqE7VJW87jG2oAGXs5fRln79iOW1PMXXp5Vq1naPzqvFtfijrr40g/contexts/google_assistant_input_type_voice"
                        }
                ],
                "intent": {
                        "name": "projects/wyzefind-jovo-integration/agent/intents/26aca5a6-0548-4b75-9df0-6d35a4b0cd6a",
                        "displayName": "Default Welcome Intent"
                },
                "intentDetectionConfidence": 1,
                "languageCode": "en-us"
        },
        "originalDetectIntentRequest": {
                "source": "google",
                "version": "2",
                "payload": {
                        "surface": {
                                "capabilities": [
                                        {
                                                "name": "actions.capability.AUDIO_OUTPUT"
                                        }
                                ]
                        },
                        "inputs": [
                                {
                                        "rawInputs": [
                                                {
                                                        "query": "Health News",
                                                        "inputType": "VOICE"
                                                }
                                        ],
                                        "arguments": [
                                                {
                                                        "textValue": "1",
                                                        "name": "is_health_check",
                                                        "boolValue": true
                                                }
                                        ],
                                        "intent": "actions.intent.MAIN"
                                }
                        ],
                        "user": {
                                "profile": {
                                        "givenName": "Google",
                                        "familyName": "Crawler"
                                },
                                "locale": "en-US",
                                "userId": "v/AK0c4GPUGl9li2HES4iSwV4tdv6z+9490BQXivC5U="
                        },
                        "conversation": {
                                "conversationId": "ABwppHFVubQ6jAeRz12-hsxqjezrm__0poztFy-yD-TtIoqE7VJW87jG2oAGXs5fRln79iOW1PMXXp5Vq1naPzqvFtfijrr40g",
                                "type": "NEW"
                        }
                }
        },
        "session": "projects/wyzefind-jovo-integration/agent/environments/__aog-2/users/-/sessions/ABwppHFVubQ6jAeRz12-hsxqjezrm__0poztFy-yD-TtIoqE7VJW87jG2oAGXs5fRln79iOW1PMXXp5Vq1naPzqvFtfijrr40g"
}
  
  Error -----------------------------------------------------------------
  
  Message:
  Argument "documentPath" must point to a document, but was "v/AK0c4GPUGl9li2HES4iSwV4tdv6z+9490BQXivC5U=". Your path does not contain an even number of components.
  
  Stack:
  Error: Argument "documentPath" must point to a document, but was "v/AK0c4GPUGl9li2HES4iSwV4tdv6z+9490BQXivC5U=". Your path does not contain an even number of components.
      at CollectionReference.doc (/Users/milanarezina/WebstormProjects/wyzefind-jovo-integration/node_modules/@google-cloud/firestore/build/src/reference.js:1659:19)
      at Firestore.load (/Users/milanarezina/WebstormProjects/wyzefind-jovo-integration/node_modules/jovo-db-firestore/src/Firestore.ts:126:117)
      at JovoUser.loadDb (/Users/milanarezina/WebstormProjects/wyzefind-jovo-integration/node_modules/jovo-framework/src/middleware/user/JovoUser.ts:325:50)
      at Middleware.run (/Users/milanarezina/WebstormProjects/wyzefind-jovo-integration/node_modules/jovo-core/src/Middleware.ts:85:30)
      at App.handle (/Users/milanarezina/WebstormProjects/wyzefind-jovo-integration/node_modules/jovo-core/src/BaseApp.ts:223:49)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
  
   ----------------------------------------------------------------------
  
  
  Request details:
  this.$googleAction initialized
  this.$type: {"type":"LAUNCH"}
  this.$session.$data : {}
  this.$nlu : {}
  this.$inputs : {}
  
  
   ----------------------------------------------------------------------

#2

Hey @Marko_Arezina!

Looks like the userId (provided by the request) doesn’t work with Firestore.

A quick workaround for now could be:

app.hook('request', (error, host, jovo) => {
    host.$request.originalDetectIntentRequest.payload.user.userId = 'Health_Check_User';
});

This hook would overwrite the health check userid.

That’s a temporary solution. We need a better ON_HEALTH_CHECK handling here. I put it on the list.


#3

Thank you @AlexSwe. Just added the hook, and the Health Checks are passing now :+1: