question

Smeech avatar image
Smeech asked

Bug: ResourceNotFoundException while deploying lambda with ask-cli 1.4.1

I recently updated from ask-cli 1.4 to 1.4.1 and since then when i want to deploy my lambda code with ask deploy i get following error trace: (seems to be a problem with region settings. I tried to deploy to three different regions)

-------------------- Create Skill Project --------------------

Profile for the deployment: [default]

Skill Id: amzn1.ask.skill.b259954e-ea47-48ef-a4c6-5fbff5b36719

Skill deployment finished.

Model deployment finished.

{ ResourceNotFoundException: Functions from 'ap-northeast-1' are not reachable in this region ('us-east-1')

at Object.extractError (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/protocol/json.js:48:27)

at Request.extractError (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/protocol/rest_json.js:52:8)

at Request.callListeners (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/sequential_executor.js:105:20)

at Request.emit (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/sequential_executor.js:77:10)

at Request.emit (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/request.js:683:14)

at Request.transition (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/request.js:22:10)

at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/state_machine.js:14:12)

at /usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/state_machine.js:26:10

at Request.<anonymous> (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/request.js:38:9)

at Request.<anonymous> (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/request.js:685:12)

at Request.callListeners (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/sequential_executor.js:115:18)

at Request.emit (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/sequential_executor.js:77:10)

at Request.emit (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/request.js:683:14)

at Request.transition (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/request.js:22:10)

at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/state_machine.js:14:12)

at /usr/local/lib/node_modules/ask-cli/node_modules/aws-sdk/lib/state_machine.js:26:10

message: 'Functions from \'ap-northeast-1\' are not reachable in this region (\'us-east-1\')',

code: 'ResourceNotFoundException',

time: 2018-07-13T17:08:41.841Z,

requestId: '647f269b-86bf-11e8-8837-070c9149ba1f',

statusCode: 404,

retryable: false,

retryDelay: 3.3047734082717106 }

alexa skills kitask cli
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jenn@amazon avatar image
Jenn@amazon answered

Looks like the aws cli is configured for ap-northeast-1 for some reason.

Try updating the aws configuration and set the default region for us-east-1.

$ aws configure --profile user2
AWS Access Key ID [None]: AKIAI44QH8DHBEXAMPLE
AWS Secret Access Key [None]: je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY
Default region name [None]: us-east-1
Default output format [None]: text

Info on configuring AWS CLI - Configuring the AWS CLI

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Smeech avatar image
Smeech answered

The region is correctly swet to us-east. The problem is that i cant reach eu or northeast regions from us-east.

The aws-cli isnt installed locally instead its a dependency of the ask-cli. So the configuration is located in the ask-cli package i guess and therefore im not able to configure it by myself. Same thing happens when i try to deploy to EU region btw.

Because this wasnt a problem in ask-cli 1.3.x i think its a problem of the newest ask-cli version.

If there ist further configuration in IAM needed for deploying to regions whoch are not us-east it should be documented somewhere.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jenn@amazon avatar image Jenn@amazon commented ·

Great question and suggestion. I'll follow up with the ask-cli team and see if we can get steps on how to deploy to different regions added to the docs.

0 Likes 0 ·
Ron Wang avatar image
Ron Wang answered

Hi Smeech!

Could you share with me your "apis" object in skill.json and .ask/config file for a further diagnose?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Smeech avatar image
Smeech answered

@Ron Wang
ask config:
"apis": { "custom": { "endpoint": { "uri": "ask-custom-animal-sound-quiz-default" }, "regions": { "NA": { "endpoint": { "uri": "arn:aws:lambda:us-east-1:xxxxx:function:ask-custom-xxx-default" } }, "EU": { "endpoint": { "uri": "arn:aws:lambda:eu-west-1:xxxxx:function:ask-custom-xxx-default" } }, "FE": { "endpoint": { "uri": "arn:aws:lambda:ap-northeast-1:xxxxx:function:ask-custom-xxx-default" } } } } }

skill json:
"apis": { "custom": { "endpoint": { "sourceDir": "lambda/custom" }, "regions": { "NA": { "endpoint": { "sourceDir": "lambda/custom" } }, "EU": { "endpoint": { "sourceDir": "lambda/custom" } }, "FE": { "endpoint": { "sourceDir": "lambda/custom" } } } } },

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ron Wang avatar image
Ron Wang answered

Hi Smeech!

Can you check the "resource" setting for this lambda in your ask config? It feels to me the awsRegion for this FE lambda function is using "us-east-1" is it correct? If not can you display your "resource" config for "lambda" part?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Smeech avatar image
Smeech answered

I think it all alooks correct... @Ron Wang

{ "deploy_settings": { "default": { "skill_id": "amzn1.ask.skill.325269b6-5199-46c0-b10c-d11f2f02e363", "was_cloned": false, "merge": { "manifest": { "apis": { "custom": { "endpoint": { "uri": "ask-custom-animal-sound-quiz-default" }, "regions": { "NA": { "endpoint": { "uri": "arn:aws:lambda:us-east-1:189582055121:function:ask-custom-animal-sound-quiz-default" } }, "EU": { "endpoint": { "uri": "arn:aws:lambda:eu-west-1:189582055121:function:ask-custom-animal-sound-quiz-default" } }, "FE": { "endpoint": { "uri": "arn:aws:lambda:ap-northeast-1:189582055121:function:ask-custom-Animal_Sound_Quiz-default" } } } } } } }, "resources": { "manifest": { "eTag": "bcaefd4e2df5948406f4190e31b9f504" }, "interactionModel": { "de-DE": { "eTag": "71cb95cc3a0c967213031d8eb7a27797" }, "en-AU": { "eTag": "b6df04795c9ebf6cf68cef8617170a1a" }, "en-GB": { "eTag": "b6df04795c9ebf6cf68cef8617170a1a" }, "en-US": { "eTag": "b6df04795c9ebf6cf68cef8617170a1a" }, "en-CA": { "eTag": "b6df04795c9ebf6cf68cef8617170a1a" }, "en-IN": { "eTag": "b6df04795c9ebf6cf68cef8617170a1a" } }, "lambda": [ { "arn": "arn:aws:lambda:us-east-1:189582055121:function:ask-custom-animal-sound-quiz-default", "revisionId": "67b4fd0d-4feb-455a-a9d1-dca4ef3882a9" }, { "arn": "arn:aws:lambda:eu-west-1:189582055121:function:ask-custom-animal-sound-quiz-default", "revisionId": "852fd13c-d22f-4fdb-a402-0ca5b2d6a4fe" }, { "arn": "arn:aws:lambda:ap-northeast-1:189582055121:function:ask-custom-Animal_Sound_Quiz-default", "revisionId": "52af7c31-436e-422b-963e-590532dcb26e" } ] }, "in_skill_products": [] } } }

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.