Dialogflow - Firestore - Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500 - google-cloud-firestore

I am trying for a fulfillment in Dialogflow using Firebase. There is data in Firestore and the intent is expected to retrieve the results based on the given parameter in the related intent. The intent is enables for webhook call. But the intent returns with one of the predefined responses.
I always get the error "message": "Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500."
Following is the Diagnostic Info from the test console
{
"responseId": "e27d24ba-cb14-4170-a7d8-a97314aee001-cad07fe1",
"queryResult": {
"queryText": "novaluron",
"parameters": {
"chemical": "novaluron"
},
"allRequiredParamsPresent": true,
"fulfillmentText": "This molecule is useful",
"fulfillmentMessages": [
{
"text": {
"text": [
"This molecule is useful"
]
}
}
],
"intent": {
"name": "projects/ppcagent-ahe9/agent/intents/6d9df198-9517-4d61-a480-87c158accdc5",
"displayName": "ChemicalDetails"
},
"intentDetectionConfidence": 0.3,
"diagnosticInfo": {
"webhook_latency_ms": 106
},
"languageCode": "en",
"sentimentAnalysisResult": {
"queryTextSentiment": {
"score": 0.3,
"magnitude": 0.3
}
}
},
"webhookStatus": {
"code": 14,
"message": "Webhook call failed. Error: UNAVAILABLE, State: URL_UNREACHABLE, Reason: UNREACHABLE_5xx, HTTP status code: 500."
}
}
Any help will be greatly appreciated.

This error could be due to different reasons, you can check these points:
Use of insecure connection.
You need to use HTTP requests. The service must use HTTPS and the URL must be publicly accessible in order for the fulfillment to function. DialogFlow does not support self-signed SSL certs. For information on SSL setup:
Permission errors.
Server files and folders need correct permissions and ownerships set in order to work properly. If Websites request files for which the server has no access then it will lead to an error.You can see more documentation about permission.
Bad scripting.
You need to check the code and check if there are any errors and modify them.

Related

Linkedin Api to delete creative unable to call (getting 500)

Trying to make a call to linkedin api https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-creatives-new?view=li-lms-2022-10&tabs=http#delete-a-creative
to delete a creative however am receiving a 500 error
{
"code": "GATEWAY_INTERNAL_ERROR",
"message": "Gateway Internal Error"
}
body of the request is:
"patch": {
"$set": {
"status": "PENDING_DELETION"
}
}
}
as per the documentation passed the header
X-RestLi-Method
as
DELETE
The issue was field name
"intendedStatus": "PENDING_DELETION"

"The agent returned an empty TTS" when action is not opened separately to asking an intent

When I invoke the skill with 'okay Google, ask {skillname} to {utterance}' I get the response 'The agent returned an empty tts" and the conversation closes. It doesn't even seem to hit my backend - I've tried hosting the backend code on both a local server and on AWS and the same issue happens in both cases. There's no log of the request being made either on Stackdriver on Google or on CloudWatch on AWS. The only response I get is the following in the debug tab:
{
"response": "The agent returned an empty TTS.",
"expectUserResponse": false,
"conversationToken": "EosDS2o4d0...",
"audioResponse": "",
"ssmlMarkList": [],
"debugInfo": {
"sharedDebugInfoList": [
{
"name": "Response Validation",
"debugInfo": "The agent returned an empty TTS.",
"subDebugEntryList": []
}
],
"conversationBuilderExecutionEventsList": []
},
"visualResponse": {
"visualElementsList": [
{
"displayText": {
"content": "The agent returned an empty TTS."
}
}
],
"suggestionsList": [],
"agentLogoUrl": ""
},
"clientError": 0,
"is3pResponse": true,
"clientOperationList": [],
"projectName": "",
"renderedHtml": ""
}
Nothing in any of the other tabs. When I try invoking the phrases in the same way on my phone, I just see a loading symbol and again nothing in the logs to say it's even hitting the backend.
Weirdly, this doesn't happen when I say 'okay Google, talk to {skillname} {utterance}' - this works absolutely fine.
All the intents work perfectly well when I've opened my action first, and then invoke them. I've built this using Jovo and published on Alexa also and the problem is only happening on Google.

cakephp crud plugin return validation errors

When PATCHing to a record using the Crud plugin and Crud.Api listener, a successful PATCH returns a 200 OK with an empty data array in the response.
{
"success": true,
"data": []
}
When validation fails after a PATCH, a 422 Unprocessable Entity with the following response is returned:
{
"message": "A validation error occurred",
"url": "\/admin\/users\/edit\/4.json",
"code": 422,
"file": "\/app\/vendor\/friendsofcake\/crud\/src\/Listener\/ApiListener.php",
"line": 189
}
but I expected something like:
{
"success": false,
"data": [
"errors": [...]
]
}
https://crud.readthedocs.io/en/latest/listeners/api.html#http-put-edit
If success is false a HTTP response code of 422 will be returned,
along with a list of validation errors from the model in the data
property of the response body.
Does the plugin need to be configured to return the errors?
I'm not overly familiar with the Crud plugin, but that response looks like the default CakePHP exception renderer response, so I'd guess that you probably haven't configured your app to use the Crud exception renderer:
config/app.php
'Error' => [
'exceptionRenderer' => \Crud\Error\ExceptionRenderer::class,
// ...
],
Quote from the docs:
Note: However if you are using CakePHP 3.3+’s PSR7 middleware feature the exceptionRenderer config won’t be used and instead you will have to set the Error.exceptionRenderer config in config/app.php to 'Crud\Error\ExceptionRenderer' as following
See Crud Docs > Listeners > API > Exception handler

Validation Error (Error Code 422) while trying to POST Hyperledger Transaction on REST API using POSTMAN

I was trying to test Transactions via Playground, Composer-Rest-server and Finally POSTMAN.
The Transactions worked perfectly on Playground (Figure 1 and 2) and also on the Composer-Rest-Server (Figure 3 and 4). But then I tried the same using POSTMAN, for which I am getting an Error ( Status Code 422 )(Figure 5).
I'm using the basic-sample-network. And the Transaction just updates the value of the asset.
Figure 1 - Executing Sample Transaction On Playground
Figure 2 - Updated Value of Asset #3952
Figure 3 - Executing the Transaction on the composer Rest Server
Figure 4 - Updated Value of Asset #3952 after the Rest Server Transaction
Figure 5 - Error While Using POSTMAN
The Error
"error": {
"statusCode": 422,
"name": "ValidationError",
"message": "The `org_example_basic_SampleTransaction` instance is not valid. Details: `asset` can't be blank (value: undefined); `newValue` can't be blank (value: undefined).",
"details": {
"context": "org_example_basic_SampleTransaction",
"codes": {
"asset": [
"presence"
],
"newValue": [
"presence"
]
},
"messages": {
"asset": [
"can't be blank"
],
"newValue": [
"can't be blank"
]
}
},
"stack": "ValidationError: The `org_example_basic_SampleTransaction` instance is not valid. Details: `asset` can't be blank (value: undefined); `newValue` can't be blank (value: undefined).\n at ...
What is the reason for this Error and How can I solve it?
You have to post data in JSON format.

Smartsheet - An error occurred during SSL handshake

It would be extremely useful to replace our existing interface with Smartsheets, since the client already uses Smartsheets and our prototype is a bit clunky. To that end, I'm building a prototype in order to the learn the Smartsheet API, and it breaks when I try to set up a webhook.
Here's the output when I attempt to update/enable a webhook:
{"message": "SUCCESS",
"resultCode": 0,
"result": {
"id": 4253946970695556,
"name": "Webhook_test",
"apiClientId": "3oqnphhimgqzyimk40",
"apiClientName": "ChoiceIP",
"scope": "sheet",
"scopeObjectId": 7055538769946500,
"events": [
"*.*"
],
"callbackUrl": "https://ghwd.net/write_requests_to_log.php",
"sharedSecret": "kpnc4nz7gwy91yjzcah2s6neq",
"enabled": false,
"status": "DISABLED_VERIFICATION_FAILED",
"disabledDetails": "An error occurred during SSL handshake. (ref id: fwhc0949r7km)",
"version": 1,
"createdAt": "2016-07-06T12:04:13Z",
"modifiedAt": "2016-07-07T06:04:20Z"
}
}
Here's the code from the script that is supposed to create a response:
$headers = getallheaders();
if( isset( $headers['smartsheet-hook-challenge'] ) ) {
header("Smartsheet-Hook-Response: " . $headers['smartsheet-hook-challenge']);
echo $headers['smartsheet-hook-challenge'];
return;
} else if( isset( $_POST['smartsheet-hook-challenge'] ) ) {
header("Smartsheet-Hook-Response: " . $_POST['smartsheet-hook-challenge']);
echo $_POST['smartsheet-hook-challenge'];
return;
} else {
header("Smartsheet-Hook-Response: debug");
}
Why is the SSL handshake failing?
You will need to have a valid SSL certificate setup for the domain ghwd.net or use a domain that has a valid SSL certificate.
When you create a webhook, Smartsheet will first try to connect to your callback URL over a secure connection. If a secure connection cannot be made the webhook will be disabled with the status you are seeing, DISABLED_VERIFICATION_FAILED.
Smartsheet Webhook Documentation