2

I'm creating a demo for Actions on Google.
When running the following command:

./gactions --verbose test --action_package action.json --project chatbot-36b55

I'm getting the following error:

Checking for updates...
Successfully fetched update metadata
Finished checking for updates -- no updates available
Pushing the app for the Assistant for testing...
POST /v2/users/me/previews/chatbot-36b55:updateFromAgentDraft?updateMask=previewActionPackage.actionPackage.actions%2Cpre
viewActionPackage.actionPackage.conversations%2CpreviewActionPackage.actionPackage.types%2CpreviewActionPackage.startTime
stamp%2CpreviewActionPackage.endTimestamp HTTP/1.1
Host: actions.googleapis.com
User-Agent: Gactions-CLI/2.0.7 (linux; amd64; stable/6f4c996f8ee63dc5760c7728f674abe37bfe5fc4)
Content-Length: 329
Content-Type: application/json
Accept-Encoding: gzip
{"name":"users/me/previews/chatbot-36b55","previewActionPackage":{"actionPackage":{"actions":[{"fulfillment":{"conversati
onName":"HelloWorld"},"intent":{"name":"actions.intent.MAIN"},"name":"MAIN"}],"conversations":{"HelloWorld":{"name":"Hell
oWorld","url":"http://35.189.xx.xx/"}}},"name":"users/me/previews/chatbot-36b55"}}
Reading credentials from: creds.data
ERROR: Failed to test the app for the Assistant
ERROR: Request contains an invalid argument.
Field Violations:
#  Field  Description
1         URL is invalid 'http://35.189.xx.xx/'
2017/07/20 14:42:50 Server did not return HTTP 200

I just followed the steps to create the actions package. This is my actions.json file:

{
  "actions": [
    {
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "HelloWorld"
        },
      "intent": {
        "name": "actions.intent.MAIN"
      }
    }
  ],
  "conversations": {
    "HelloWorld": {
      "name": "HelloWorld",
      "url": "http://35.189.xx.xx/"
    }
  }
}

Do I need to have https set up to test this? Anyone know how I can get around it if that is the issue?

Yoshua Nahar
  • 1,304
  • 11
  • 28

1 Answers1

0

The documentation at https://developers.google.com/actions/reference/rest/Shared.Types/ConversationFulfillment states for the url parameter:

The HTTPS endpoint for the conversation (HTTP is not supported).

Additionally, the URL must be accessible from the public Internet (you don't show the full IP address, for good reason, so I can't tell if this is true or not).

Either way, you may be able to use something like ngrok to create an HTTPS endpoint and secure tunnel to your 35.189.x.x host. This will give you a public DNS entry and HTTPS endpoint. See also https://developers.google.com/actions/tools/ngrok for some details about using ngrok with Actions.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • @tieorange - I'm not sure what "the same issue" is in this case, since I don't know why you'd be specifying google.com as a url for an actions.json file. Sounds like it might be best if you created your own SO question and posted as many details about your problem as you can. – Prisoner Oct 06 '17 at 12:22
  • It's weird, in my case only one Actions project works fine with ngrok, all the other ones I make fail as described in this Question. – Josh Oct 07 '20 at 18:36
  • Are the other ones also using ngrok? Using an HTTPS server? You may want to create a new question with your own details if you're having a problem and this didn't solve it. – Prisoner Oct 07 '20 at 19:08
  • Hi @Prisoner, without `creds.data` I am pushing the `action.json` file. But am getting `Access blocked: Assistant CLI’s request is invalid` message after copy paste this URL in browser `https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=337711033195-pf6h6bt6d4o2f9l4371os795pj9j79gb.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Factions.builder&state=state` – Ramesh S Mar 21 '23 at 09:21
  • @Prisoner https://stackoverflow.com/questions/75541029/gactions-access-blocked-assistant-cli-s-request-is-invalid – Ramesh S Mar 21 '23 at 09:22