jovotech / jovo-framework

πŸ”ˆ The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.68k stars 309 forks source link

Various Credentials Errors w/ Deployment #225

Closed ckhicks closed 6 years ago

ckhicks commented 6 years ago

I'm submitting a...

Expected Behavior

After a successful jovo build, I attempt to run jovo deploy -p alexaSkill and expect to see the lambda endpoint updated. My app.json has the following:

{
  "alexaSkill": {
    "nlu": {
      "name": "alexa"
    },
    "skill_id": <my skill id>,
    "askProfile": "default"
  },
  "googleAction": {
    "nlu": {
      "name": "dialogflow"
    },
    "dialogflow": {
      "projectId": <my project id>,
      "keyFile": <my key file>
    }
  },
  "endpoint": <my lambda endpoint>
}

Current Behavior

Result of above commands:

Error log

Deploying Alexa Skill
     βœ– Updating Alexa Skill project for ASK profile default
       -> askApiUpdateSkill:Resource not found.

Your Environment

jankoenig commented 6 years ago

Can you try again with "skillId"?

ckhicks commented 6 years ago

I tried replacing skill_id with either skillid or skillId in my app.json and am getting the same error.

I also see that I'm getting the following for googleAction deployments as well:

   ❯ Deploying Google Action
     βœ” Creating file /googleAction/dialogflow_agent.zip
       Language model: en-US
       Fulfillment Endpoint: <my lambda endpoint>
     βœ” Uploading and restoring agent for project crucible-radio
     βœ” Training started
     βœ– Uploading to lambda
       -> Missing credentials in config

Possibly related?

jankoenig commented 6 years ago

Could you show me the content of your skill.json after jovo build?

ckhicks commented 6 years ago

Yessir, here it is!

{
    "manifest": {
        "publishingInformation": {
            "locales": {
                "en-US": {
                    "summary": "Sample Short Description",
                    "examplePhrases": [
                        "Alexa open hello world"
                    ],
                    "name": "alexa-crucible-radio",
                    "description": "Sample Full Description"
                }
            },
            "isAvailableWorldwide": true,
            "testingInstructions": "Sample Testing Instructions.",
            "category": "EDUCATION_AND_REFERENCE",
            "distributionCountries": []
        },
        "apis": {
            "custom": {
                "endpoint": {
                    "sslCertificateType": "Wildcard",
                    "uri": <my lambda endpoint>
                }
            }
        },
        "manifestVersion": "1.0"
    }
}
jankoenig commented 6 years ago

OK. Is your AWS default config linked to the ASK default user? You can see all the ASK users with ask init

ckhicks commented 6 years ago

It appears to be:

Profile              Associated AWS Profile
[default]          "__AWS_CREDENTIALS_IN_ENVIRONMENT_VARIABLE__"
jankoenig commented 6 years ago

Hm, could you maybe try to create a default AWS profile, not the environment variables? It's explained here: https://www.jovo.tech/guides/deploy-lambda-cli#set-up-credentials-with-ask-cli

ckhicks commented 6 years ago

Ah, it seems that was the issue! I had set one up before but somewhere along the line my .aws/config file had become malformed with spaces between the variables and their values. Probably something my IDE did when I checked that earlier. Now I just have to sort out my interaction model bugs that didn't show until now. πŸ€¦β€β™‚οΈ Thanks for the help!

jankoenig commented 6 years ago

No problem πŸ‘

kaaloo commented 6 years ago

I can confirm these issues with setting up ask-cli to use environment variables. :(

jankoenig commented 6 years ago

Hi @kaaloo, have you tried setting it up again without the environment variables (https://www.jovo.tech/guides/deploy-lambda-cli#set-up-credentials-with-ask-cli) or is it that you specifically want to use those?

kaaloo commented 6 years ago

Yes works fine without env vars but I prefer using tools like envchain for sensitive values in the environment.

jankoenig commented 6 years ago

You're correct @kaaloo . Will consider this for v2 of the CLI (@janober is currently working on it)

spham commented 5 years ago

Hi, i have same issue when trying to deploy for alexa model

  ❯ Deploying Alexa Skill 
      βœ– Updating Alexa Skill project for ASK profile default
       -> askApiUpdateSkill:Resource not found.
        Deploying Interaction Model, waiting for build
aswetlow commented 5 years ago

Is it an existing skill in your ASK console, @spham?

If yes: Make sure the skill with the skill id in /platforms/alexaSkill/.ask/config is accessible by the default ASK profile

If no: Set skillId to "" in /platforms/alexaSkill/.ask/config