actions-on-google / actions-on-google-nodejs

Node.js client library for Actions on Google
https://actions-on-google.github.io/actions-on-google-nodejs
Apache License 2.0
900 stars 193 forks source link

Simulator shows "My test app isn't responding right now. Try again soon" but works perfectly fine in Try it now #79

Closed apal21 closed 6 years ago

apal21 commented 6 years ago

I have written a code to test this app which returns the same string in the request. It has no errors in try it now.

image

But in simulator it shows : MalformedResponse 'final_response' must be set.

image

I've not enabled API v2.

In "try it now", my webhook is triggered successfully and gives me the response code 200 but in simulator, my webhook is never triggered.

I also tried to set an input hello in Default Welcome Intent with default responses without any webhooks but the result is always same.

chilno commented 6 years ago
  1. Do you have a text response in your welcome intent regardless of using webhook fulfillment? If Yes, and you still see the error => Go to 2, otherwise there is an issue with the response you are sending from your webhook.
  2. Check the Debug tab and see if the parameter "curlCommand" in the AoG simulator contains the same token value as the one "Client access token" in the Dialogflow project under API keys. If not you might need to re-link your AoG project with the DIalogflow one.
apal21 commented 6 years ago

Ohh. My client access token in project setting and the token in curlCommand are different. How to re-link this project?

chilno commented 6 years ago

In Dialogflow > Integrations > Google Assistant > Update Draft

apal21 commented 6 years ago

I did that but that didn't work. I also tried to refresh the keys but in curlCommand it shows the same key every time even after updating the draft.

chilno commented 6 years ago

Make sure you click on TEST DRAFT again in the AoG Console

apal21 commented 6 years ago

Yes I did that too and I also restart my browser. I cleared cookies and cache. but none of them worked.

this is my client access token: 577fffec1013406db87b8ca6149659b2

this is the curlCommand: "curlCommand": "curl -v 'https://api.api.ai/api/integrations/google?token=16d1c6c808f04dce95cdedbc09dd3543' -H 'Content-Type: application/json;charset=UTF-8' -H 'Google-Actions-API-Version: 2' -H 'Authorization: eyJhbGciOiJSUzI1NiIsImtpZCI6Ijc5MWM0YjcxNWE1YzNiYTdhY2EyYmQzODgyMTE4MzFkZDMxNjZiNjIifQ.eyJhdWQiOiJ0ZXN0LWdhcy1zZXJ2ZXIiLCJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJqdGkiOiI5OWZiMzNlMzlkOThkYjMxM2FkNzZjMjE2NzY0OThlOGY4ZWFmZjFlIiwiaWF0IjoxNTEyOTgyOTY1LCJleHAiOjE1MTI5ODMwODUsIm5iZiI6MTUxMjk4MjY2NX0.s4NCy6nMJrMu5kaNJ18x-DkXA_rUcmPwS3JnBC_gtWSWYf3oSra0mONnr8drgtORzkYs0vF_9GotTkiPKe8bWqbDh3MMG9lk-5CCF0utuC3DHG3cLqLsWXOX8lp2IdifI2kOuY9iiKYmC5dxzRoGR5CTlaYCRpmLGx8BPmXt3ZCOvC5dKbfvdRpEVNrzvSB6QLnQF6dRxqix6CeI2OJoMd_wTpOy6Xz6Y0HEBnWma3Wj-ltU9O33wyVimWp2mjuOu_ik320PIug_WUEPzSE8iE08XOGoJ1fYOeKt2ACmT7xYan-bLZpR_Rx6l69XRj8LMSYAbw8Q237Phucvj9dCyQ' -A 'Mozilla/5.0 (compatible; Google-Cloud-Functions/2.1; +http://www.google.com/bot.html)' -X POST -d '{\"user\":{\"userId\":\"ABwppHGZZMcTM7QsAv1aGAh3zOLDIzZYEU7yfEQtZyQIm12FlCFn2WRxRq2KdX9MTbF4csXJ1lrW0CUSoPt2\",\"locale\":\"en-US\",\"lastSeen\":\"2017-12-11T08:55:32Z\"},\"conversation\":{\"conversationId\":\"1512982965898\",\"type\":\"NEW\"},\"inputs\":[{\"intent\":\"actions.intent.MAIN\",\"rawInputs\":[{\"inputType\":\"KEYBOARD\",\"query\":\"Talk to my test app\"}]}],\"surface\":{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]},\"isInSandbox\":true,\"availableSurfaces\":[{\"capabilities\":[{\"name\":\"actions.capability.AUDIO_OUTPUT\"},{\"name\":\"actions.capability.SCREEN_OUTPUT\"}]}]}'" }

chilno commented 6 years ago
  1. In Dialogflow, make sure the Project ID is the same as the one you are using in the AoG console.
  2. In Dialog flow, click on the "Refresh key" for the "Client access token" then redo the Integration > Google Assistant > Update Draft > Visit Console > Test Draft
apal21 commented 6 years ago

I just delete this app, created a new one with different name and different google project but in simulator it shows the same token. I also deleted previous Google project and I am using correct Project in simulator

apal21 commented 6 years ago

I don't know why but it is working now. I did nothing.

humphriest commented 6 years ago

Any working solution I can use? I'm getting this error as well

apal21 commented 6 years ago

First delete all the google console projects and then just wait.

phuclm commented 6 years ago

i'm faced with this issue, how to fix it. Waiting is too bad

Anton-Prab commented 6 years ago

Seriously guys.. Nothing worked out. Tried all sorts that mentioned above. Did anyone managed to get it right ? If so, please help us out.

NoRulesJustFeels commented 6 years ago

If you continue having issues with the simulator, contact support: https://developers.google.com/actions/support/

apal21 commented 6 years ago

@phuclm @Anton-Prab it took 3-4 days for me after deleting all the google projects and agents.

phuclm commented 6 years ago

@apal21 I was created new project using new Google to meet time condition :(

apal21 commented 6 years ago

@phuclm I can understand and Google should improve this. We cannot do anything.

AshwiniBS commented 6 years ago

I exported the data first and deleted the Dialogflow agent. And again created new one with the same name and imported the data. Everything works now. Hope it helps

niranjan-infofaces1 commented 6 years ago

hi am also face the same error right now. 2

felixfrtz commented 6 years ago

I am also facing the same issue.

Overall I have to say, developing for Alexa is so much easier than the mess that is Dialogflow, Actions SDK and the Assistant Console. Too many settings spread over too many different services, after 1,5 days I still don't know what the best setup might be for an Action I already have on Alexa. It's ridicolously confusing and not pleasing to work with.

dearlk commented 6 years ago

You might want to provide your feedback at their google plus community.

I second your feelings by the way

arnabsen commented 6 years ago

Sometimes the Intents -> Response -> Google Assistant tab -> Use response from the DEFAULT tab as the first response gets unselected, so I resolved this error after re-enabling that.

loretoparisi commented 6 years ago

@chilno we are facing the same issue, and we use v2, and we can see that the DialogFlow Client Access Token i.e. the one defined in the Dialogflow dashboard differs from the one we can see from the API Response in the simulator i.e. the field accessToken in the json response. Is that correct?

felixfrtz commented 6 years ago

@loretoparisi Try relinking the Dialogflow Agent with the Actions Simulator: Go to Integrations > Google Action > Settings > Test.

loretoparisi commented 6 years ago

Thanks that, now we did a step forward, but I have furtherly debugged and I get internally this error: Failed to parse the dialog flow response into AppResponse because of empty speech response. I assume that we we are doing like agent.add("I didn't understand"); this should be enough to send a response. What happens is that, while in the explicit invocation it works fine i.e. the default welcome message it works, all the other invocations that makes async responses do not. For async I mean the invocation will call an api service and then will call the agent.add api. What happens is that the api call works, and when we do agent.add(someText) it breaks wit the empty speech response error.

davidalbertonogueira commented 6 years ago

Agreed, @warhost.

loretoparisi commented 6 years ago

@davidalbertonogueira take a look at the referenced issue...the problem seems to be elsewhere.

davidalbertonogueira commented 6 years ago

I already fixed my problem. I was using a python library and I would get this error message when using their "card". Now I'm sending just the speech text and it works.

loretoparisi commented 6 years ago

@davidalbertonogueira ok thanks. Question: are you sending the speech as plain text or are you using SSML tags? Thanks a lot!

SiddAjmera commented 6 years ago

@loretoparisi like you said, that's what's happening. But if we return a promise from it, a response get's sent out. Now initially I tried with a simple text response and it worked for me on the simulator.

But it's giving me this error when I'm trying to send out a custom response as Payload.

image

@matthewayne , please help!

wangkekekexili commented 6 years ago

This issue happened to me today. I fixed it by adding "Google Assistant Welcome" to the "Default Welcome Intent" Events section.

dariuxmx commented 6 years ago

Try to update your draft in simulator.

elyutrading commented 5 years ago

dialogflaw

irvingDevMobi commented 2 years ago

For me, the solution was to set a name and use it instead of "my test app"

image