ask-cli: ASK_REFRESH_TOKEN Not working in v1 and v2

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

The CLI with ASK_REFRESH_TOKEN is not working in CLI v1 and CLI v2

Expected Behavior

It should refresh the token when the tokes has expired

Current Behavior

I am deploying using environment variables. I have tested setting ASK_ACCES_TOKEN, ASK_VENDOR_ID, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

When I set these variables and also add the profile ENVIRONMENT_ASK_PROFILE in ./ask/config works both in cli v1.7.23 and v2.1.1 and it seems to be ok. But the problem is when I set the variable ASK_REFRESH_TOKEN in order to have that token to automatically refresh the access token when I am using envirnmonent variables.

The problem is that in CLI v1 when I set this variable, I get the error:

-------------------- Update Skill Project --------------------

  • skill status checking…Error: Bad Request Failed to refresh access token.

the .ask/config in v1 is:

{ "deploy_settings": { "default": { "skill_id": "amzn1.ask.skill.ed038d5e-61eb-4383-a480-04e3398b398d", "was_cloned": false, "merge": {}, "resources": { "manifest": { "eTag": "689365afa95f4182154f2b7af78f6072" }, "interactionModel": { "es-ES": { "eTag": "7f2f7bea2c1a6fe426e79007d7cf1798" } }, "lambda": [ { "alexaUsage": [ "custom/default" ], "arn": "arn:aws:lambda:us-east-1:141568529918:function:ask-custom-alexa-nodejs-lambda-helloworld-default", "awsRegion": "us-east-1", "codeUri": "lambda/custom", "functionName": "ask-custom-alexa-nodejs-lambda-helloworld-default", "handler": "index.handler", "revisionId": "cbb0fc82-d875-4697-a85d-9235871551d3", "runtime": "nodejs10.x" } ] } }, "__ENVIRONMENT_ASK_PROFILE__": { "skill_id": "amzn1.ask.skill.ed038d5e-61eb-4383-a480-04e3398b398d", "was_cloned": false, "merge": {}, "resources": { "manifest": { "eTag": "689365afa95f4182154f2b7af78f6072" }, "interactionModel": { "es-ES": { "eTag": "56f78f703b60473a73bf6f35648e3647" } }, "lambda": [ { "alexaUsage": [ "custom/default" ], "arn": "arn:aws:lambda:us-east-1:141568529918:function:ask-custom-alexa-nodejs-lambda-helloworld-default", "awsRegion": "us-east-1", "codeUri": "lambda/custom", "functionName": "ask-custom-alexa-nodejs-lambda-helloworld-default", "handler": "index.handler", "revisionId": "3db9aa7d-d76d-4adc-ab41-f9b546eb384a", "runtime": "nodejs10.x" } ] } } } }

And in CLI v2 I get the error: [Error]: CliError: Skill package src is not found in ask-resources.json.

the .ask/config in v2 is: { "askcliStatesVersion": "2020-03-31", "profiles": { "default": { "skillInfrastructure": { "@ask-cli/lambda-deployer": { "deployState": { "default": { "iamRole": "arn:aws:iam::141568529918:role/ask-lambda-testv2-1587847346433", "lambda": { "arn": "arn:aws:lambda:us-east-1:141568529918:function:ask-testv2-default-default-1587847348324", "lastModified": "2020-04-25T20:50:07.654+0000", "revisionId": "ef44443e-bca3-48de-bcee-17a0a1601411" } } } } }, "skillId": "amzn1.ask.skill.713627f2-6490-49cd-9dd4-f574006f33cc", "skillMetadata": { "lastDeployHash": "iEs1uMb1/iBLqsI5tmrQWAx+dJw=" }, "code": { "default": {} } }, "__ENVIRONMENT_ASK_PROFILE__": { "skillInfrastructure": { "@ask-cli/lambda-deployer": { "deployState": { "default": { "iamRole": "arn:aws:iam::141568529918:role/ask-lambda-testv2-1587847346433", "lambda": { "arn": "arn:aws:lambda:us-east-1:141568529918:function:ask-testv2-default-default-1587847348324", "lastModified": "2020-04-25T20:50:07.654+0000", "revisionId": "ef44443e-bca3-48de-bcee-17a0a1601411" } } } } }, "skillId": "amzn1.ask.skill.713627f2-6490-49cd-9dd4-f574006f33cc", "skillMetadata": { "lastDeployHash": "iEs1uMb1/iBLqsI5tmrQWAx+dJw=" }, "code": { "default": {} } } } }

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

@xavidop just released version 2.5.1. It should be fixed in this version.

UPDATE: In ASK CLI v1 if I am using the ASK_ACCESS_TOKEN, ASK_REFRESH_TOKEN and ASK_VENDOR_ID located in my ~/.ask/cli_config that was auto generated when I run ask init, it WORKS. but when I use the tokens generated by the command ask util generate-lwa-tokens the behaviour is the one explained above.