alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

[please forward] ask-cli deploy problem #477

Closed saifalfalah closed 5 years ago

saifalfalah commented 5 years ago

Couldn't find a better place to ask question about this. I was setting up ASK CLI on a new machine. I completed all the steps at Alexa docs and I am able to create a skill locally.

When I try to deploy it, it tells me: [Error]: Cannot find the environment variable: AWS_ACCESS_KEY_ID.

I went and took a look at the credentials file at ~/.aws/credentials and I can see that aws_access_key_id as well as aws_secret_access_key both exist. I checked with the CSV file and I confirmed that both those keys are correct.

What should I do?

tianrenz commented 5 years ago

@saifalfalah , I would recommend to post this on the Alexa developer forum to get more feedback from the community. In general, stackoverflow is another good place to post your questions as well. Please remember to tag the question with "alexa-skills-kit" for discoverability.

I've forwarded your question to the service team for reply. I'll update the thread once there's some answer.

Regards

saifalfalah commented 5 years ago

Thank you. I'll post at both those places as well. I posted here because I found a similar issue raised here earlier and it was resolved. Here

mukeshbasira commented 5 years ago

Ask cli is really so annoying to work with, getting a lot of errors. Manually uploading lambda every minute👎 .

saifalfalah commented 5 years ago

My experience with Alexa development has been similar. Half the problem is tooling itself. The other half is documentation. 🤦‍♀️

RonWang commented 5 years ago

Hey @saifalfalah

Can I ask what version of cli are you using? If you are using version under v1.4.2, we had a bug fix in that version which is very likely the fix for you: you can look at the changelog in https://www.npmjs.com/package/ask-cli. Let me know if this is the problem!

Thanks, Ron

saifalfalah commented 5 years ago

Hi @RonWang

I'm using 1.4.5.

RonWang commented 5 years ago

Hey @saifalfalah If you are using v1.4.5, can you run "$ask init --list-profiles" and check if the associated AWS profile for the profile you used for deploy is set to AWS_CREDENTIALS_IN_ENVIRONMENT_VARIABLE ?

If so, then it indicates when you set your profile, you chose to use environmental variable as your AWS profile. You can re-run "ask init --profile {yourProfile}" and select the target aws profile from CLI to overwrite it. After doing this, you can try run the deploy again.

saifalfalah commented 5 years ago

When I ran ask init --list-profiles it showed this:

Profile              Associated AWS Profile
  [default]                 "__AWS_CREDENTIALS_IN_ENVIRONMENT_VARIABLE__"

As suggested, I ran, ask init --profile default --no-browser and chose 'Use the AWS environment variables'. Entered the authorisation code. It set the Vendor ID and tells me that the Profile [default] initialized successfully.

When I go about deploying my skill again, the same error again.

RonWang commented 5 years ago

Hey @saifalfalah When you chose to use AWS env-var, it indicates CLI will use AWS env-var (which is the AWS_ACCESS_KEY_ID and the AWS_ACCESS_SECRET_KEY pair)as the credentials. However, you said you store your credentials under ~/.aws/credentials right? Therefore, you should not use AWS env-var, but select the AWS profile you set in ~/.aws/credentials file during the init process.

You should be able to see the AWS profile list when you just run "ask init --profile default --no-browser", and select the target profile. (If no profile list provided, then it's because your aws credential is not set correctly. Please refer to https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html for the credentials file's format.)

Thanks, Ron

saifalfalah commented 5 years ago

So I reinstalled ask-cli and also removed credentials file from '.aws' folder. Then again did the ask init --no-browser and it worked.

Now I can go about building my skill.

Thank you @RonWang @tianrenz