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

Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP statu

Hello,  I am new to Dialogflow ES and am using inline editing.

I used the default index.js file and package.json file.  These are populated when you turn on inline editing.  The only thing I changed was for an intent - to turn on fulfillment and delete all responses for that intent.

It deploys fine.  But when that intent is called there is no response and the error above is noted in the diagnostic info.

Is the problem the default index and package files?  Or is there something else?

thanks

index.js --default------------------------------------------------


'use strict';

const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');

process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
const agent = new WebhookClient({ request, response });
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers));
console.log('Dialogflow Request body: ' + JSON.stringify(request.body));

function welcome(agent) {
agent.add(`Welcome to my agent!`);
}

function fallback(agent) {
agent.add(`I didn't understand`);
agent.add(`I'm sorry, can you try again?`);
}


let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
intentMap.set('Default Fallback Intent', fallback);

agent.handleRequest(intentMap);
});

 

package.json------------------------------------------

{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "10"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^5.13.1",
"firebase-functions": "^2.0.2",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.5.0"
}
}

0 1 107
1 REPLY 1

Hi @makhwawa,

Welcome to Google Cloud Community!

It seems that the webhook service is not available during the request. With this, please check if your webhook service has met the following requirements mentioned in the documentation. This could also happen if you have misconfiguration in your DNS.

In addition, if the Agent is unresponsive, it's possible that the matching training phrases are insufficient. You may try to add more training phrases of user input that you expect for each intent and don't just rely on very broad phrases. You may check out this documentation for best practices.

If the issue persists, you may reach out to Google Cloud Support and provide your webhook URL for further assistance.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.