jovotech / jovo-cli

🛠 Command Line Interface for the Jovo Framework: Makes voice experience deployment a breeze, including features like local development and staging.
https://www.jovo.tech/marketplace/jovo-cli
Apache License 2.0
57 stars 31 forks source link

AgentModel.defaultTimezone is required but was not provided #133

Closed asarazan closed 4 years ago

asarazan commented 4 years ago

I'm submitting a...

Expected Behavior

jovo deploy --stage dev should properly deploy to dialogflow

Current Behavior

While alexa deploys fine, Google fails at upload with an error about timezones and uuids. It should be noted that I can successfully upload the zipfile by hand using the dialogflow console.

Error log

  ❯ Deploying Google Action (stage: dev) <REDACTED>
    ↓ Creating file /googleAction/dialogflow_agent.zip [skipped]
      → Fulfillment Endpoint: <REDACTED>
    ✖ Uploading and restoring agent for project <REDACTED>
      → Validate entity failed because of the following reasons: '' is not a valid entity type ID. Must be a UUID.
      Training started
 ›   Error: There was a problem:
 ›   Error: com.google.apps.framework.request.BadRequestException: Validate AgentModel failed because of the following reasons: AgentModel.defaultTimezone is required but was not provided
 ›   AgentModel.defaultTimezone  is not a supported timezone.
 ›   Validate entity failed because of the following reasons: '' is not a valid entity type ID. Must be a UUID.

Your Environment

aswetlow commented 4 years ago

Hey @asarazan

I tried to reproduce it with my setup.

gcloud -v

Google Cloud SDK 180.0.0 bq 2.0.27 core 2017.11.10 gsutil 4.28

I don't get that error

What's the version of the glcoud cli?

asarazan commented 4 years ago

I just updated gcloud, so the output of -v is:

[130] $ gcloud -v                                                                                                                                                                                                                          
Google Cloud SDK 288.0.0
bq 2.0.56
core 2020.04.03
gsutil 4.49

Still a similar result from attempting jovo deploy --stage dev:

$ jovo deploy --stage dev
  ✔ Deploying Alexa Skill (stage: dev)
    ↓ Updating Alexa Skill project for ASK profile default [skipped]
      → Endpoint: <REDACTED>
    ✔ Deploying Interaction Model, waiting for build
      ✔ en-US
  ❯ Deploying Google Action (stage: dev) <REDACTED>
    ↓ Creating file /googleAction/dialogflow_agent.zip [skipped]
      → Fulfillment Endpoint: <REDACTED>
    ✖ Uploading and restoring agent for project <REDACTED>
      → Validate entity failed because of the following reasons: '' is not a valid entity type ID. Must be a UUID.
      Training started
 ›   Error: There was a problem:
 ›   Error: com.google.apps.framework.request.BadRequestException: Validate AgentModel failed because of the following reasons: AgentModel.defaultTimezone is required but was not provided
 ›   AgentModel.defaultTimezone  is not a supported timezone.
 ›   Validate entity failed because of the following reasons: '' is not a valid entity type ID. Must be a UUID.
asarazan commented 4 years ago

For what it's worth, the original component versions were:

$ gcloud -v
Google Cloud SDK 288.0.0
bq 2.0.56
core 2020.04.03
gsutil 4.49
aswetlow commented 4 years ago

Any fancy stuff in your language model? I tried with our simple helloworld template

What's in your project.js?

asarazan commented 4 years ago

It shouldn't be too fancy. I'll clean it all out and report back though.

asarazan commented 4 years ago

Here's the reduced model file:

{
    "invocation": "hello",
    "intents": [
        {
            "name": "Yes",
            "phrases": [
                "yes"
            ]
        }
    ],
    "inputTypes": [],
    "alexa": {
        "interactionModel": {
            "languageModel": {
                "intents": [
                    {
                        "name": "AMAZON.CancelIntent",
                        "samples": []
                    },
                    {
                        "name": "AMAZON.HelpIntent",
                        "samples": []
                    },
                    {
                        "name": "AMAZON.StopIntent",
                        "samples": []
                    },
                    {
                        "name": "AMAZON.PauseIntent",
                        "samples": []
                    },
                    {
                        "name": "AMAZON.ResumeIntent",
                        "samples": []
                    }
                ]
            }
        }
    },
    "dialogflow": {
        "intents": [
            {
                "name": "Default Fallback Intent",
                "auto": true,
                "webhookUsed": true,
                "fallbackIntent": true
            },
            {
                "name": "Default Welcome Intent",
                "auto": true,
                "webhookUsed": true,
                "events": [
                    {
                        "name": "WELCOME"
                    }
                ]
            },
            {
                "name": "actions.intent.MEDIA_STATUS",
                "auto": true,
                "webhookUsed": true,
                "events": [
                    {
                        "name": "actions_intent_MEDIA_STATUS"
                    }
                ]
            }
        ]
    }
}
asarazan commented 4 years ago

Here's project.js:

// ------------------------------------------------------------------
// JOVO PROJECT CONFIGURATION
// ------------------------------------------------------------------

module.exports = {
  defaultStage: 'dev',

  alexaSkill: {
    nlu: 'alexa',
    manifest: {
      publishingInformation: {
        locales: {
          'en-US': {
            name: '<REDACTED>',
          },
        },
      },
      apis: {
        custom: {
          interfaces: [
            {
              type: 'AUDIO_PLAYER'
            }
          ]
        }
      }
    },
  },

  googleAction: {
    nlu: 'dialogflow',
    dialogflow: {
      projectId: "<REDACTED>",
      keyFile: "google.json"
    },
  },

  stages: {
    dev: {
      endpoint: "<REDACTED>"
    }
  },
};
asarazan commented 4 years ago

It's worth noting that we have a somewhat nonstandard setup in that we don't actually utilize the jovo framework at runtime, we mostly just leverage the CLI to generate our models. We have jovo installed as a dependency though, and it's generally worked fine up until now.

aswetlow commented 4 years ago

Looks like they changed something. Nevertheless, I was able to reproduce it with a fresh Dialogflow agent.

I just published the fix. Please update the jovo-cli.

npm install jovo-cli -g

Let me know if it works now.

asarazan commented 4 years ago

Hmm looks like it's still the same. jovo -v gives 3.0.7

aswetlow commented 4 years ago

Oh, I forgot. Please delete /platforms/googleAction

asarazan commented 4 years ago

LGTM, thanks for taking care of this so quickly :+1: