Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Dialogflow ES Fulfillment Errors (INVALID_ARGUMENT, URL_ERROR, ERROR_OTHER)

Hi all, I've had success with Dialogflow fulfillment in the past with other projects, but am running into some errors I cannot seem to debug or find elsewhere. When logging the errors, this is what the payload shows:


Dialogflow fulfillment error : Webhook call failed. Error: INVALID_ARGUMENT, State: URL_ERROR, Reason: ERROR_OTHER, HTTP status code: 400.


I have, of course, tested my fulfillment webhook in isolation, and everything seems to work as expected. I've tested the fulfillment request in Postman, and gotten the following result, which seems to match the fulfillment response spec (Note, I actually changed my webhook to only give back `fulfillmentMessages` to attempt to simplify this debugging process):

 

 

 

 

{
    "fulfillmentMessages": [
        {
            "text": {
                "text": [
                    "This is a sample webhook response"
                ]
            }
        }
    ]
}

 

 

 

 

 If it helps, here's what the webhook request looks like:

 

 

 

 

{
  "responseId": "287e9f23-45b0-434a-9dc2-2b179fb71a5c-e9bf988c",
  "queryResult": {
    "queryText": "Read sequence",
    "parameters": {},
    "allRequiredParamsPresent": true,
    "fulfillmentMessages": [
      {
        "text": {
          "text": [
            ""
          ]
        }
      }
    ],
    "outputContexts": [
      {
        "name": "projects/my-project/agent/sessions/e28407c5-4b07-51f7-8bae-41ae3ea1d7db/contexts/store_restocking_event_id",
        "lifespanCount": 5,
        "parameters": {
          "user_id.original": "6659838d-ce64-413d-bb56-f1a2057f5a3d",
          "store_restocking_event_id.original": "26ec5c5b-b352-42ea-9b14-bd8f9a985850",
          "store_restocking_event_id": "26ec5c5b-b352-42ea-9b14-bd8f9a985850",
          "user_id": "6659838d-ce64-413d-bb56-f1a2057f5a3d"
        }
      },
      {
        "name": "projects/my-project/agent/sessions/e28407c5-4b07-51f7-8bae-41ae3ea1d7db/contexts/read_sequence",
        "lifespanCount": 5
      }
    ],
    "intent": {
      "name": "projects/my-project/agent/intents/ea98d2df-939b-4b05-8c39-8c6bbed8df3c",
      "displayName": "Read sequence"
    },
    "intentDetectionConfidence": 1,
    "diagnosticInfo": {
      "webhook_latency_ms": 190
    },
    "languageCode": "en",
    "sentimentAnalysisResult": {
      "queryTextSentiment": {}
    }
  },
  "webhookStatus": {
    "code": 3,
    "message": "Webhook call failed. Error: INVALID_ARGUMENT, State: URL_ERROR, Reason: ERROR_OTHER, HTTP status code: 400."
  }
}

 

 

Thanks for the help!

Solved Solved
0 7 1,487
1 ACCEPTED SOLUTION

can you please turn on the log on your webhook to make sure that the call from dialogflow is being successfully executed?

View solution in original post

7 REPLIES 7

how did you configure your webhook on the dialogflow agent? also, is your webhook using HTTPS (it is a requirement)?

Best,

Xavi

Here are some redacted details for my webhook configuration:

  1. My webhook url is: https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/test/fulfillment.
  2. Note, I don't have any headers or security configured at the moment to make things easier to debug

Thanks,

Andrew

what are the logs on your end saying? I mean, in your backend

Sorry, I'm not sure I understand-- my backend is taking the webhook request I've supplied, processing it correctly as expected, and returning the expected fulfillment response without any logs or errors. Both the request and response and included in the original post, and the only logs/errors I'm getting are from Cloud Logging + Dialogflow:

{
insertId: "45yzk4f2nxuca"
labels: {4}
logName: "projects/my-project/logs/dialogflow_agent"
receiveTimestamp: "2024-03-15T23:40:01.789572127Z"
resource: {2}
severity: "ERROR"
textPayload: "Dialogflow fulfillment error : Webhook call failed. Error: INVALID_ARGUMENT, State: URL_ERROR, Reason: ERROR_OTHER, HTTP status code: 400."
timestamp: "2024-03-15T23:40:01.775925Z"
trace: "e28407c5-4b07-51f7-8bae-41ae3ea1d7db"
}

 

can you please turn on the log on your webhook to make sure that the call from dialogflow is being successfully executed?

Wow thank you so much, I think you've helped identify the problem for sure-- I see an AWS API Gateway issue about a bad request, I'll have to do a deep dive into my request validation and see if anything's going on. I feel really stupid right now for not checking this originally, just was a bit too confident when testing in isolation... honestly still a bit perplexed at what could be different between my Postman testing + fulfillment request and what Dialogflow is actually sending to my backend. I'll do some extensive logging and report back here, thanks!

happy to see some progress here 🙂