Ask deploy returns with error message: The CloudFormation deploy failed for Alexa region "default"

I am trying to deploy the alexa-skill with the command:

ask deploy

The skill seems to be deployed but the lambda function is not.
The last lines of output returned by the deploy command are:

added 91 packages, and audited 92 packages in 17s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Skill code built successfully.
Code for region default built to /root/openhab-new-metatags/openhab-alexa/.ask/lambda/build.zip successfully with build flow NodeJsNpmBuildFlow.

==================== Deploy Skill Infrastructure ====================
  ✖ Deploy Alexa skill infrastructure for region "default"
[Error]: CliError: The CloudFormation deploy failed for Alexa region "default": AlexaSkillFunction[AWS::Lambda::Function]  CREATE_FAILED (alexa-openhab3 already exists in stack arn:aws:cloudformation:eu-west-1:528425453548:stack/ask-openHAB3-default-skillStack-1640022305826/931dc370-61bc-11ec-8ca6-0210327efef5)

I made changes to rename the skill from openhab to openhab3 to be able to do some experiments before completely switching over to openhab3 with new hardware.

What could be the reason for above error message ?

Hi @Wolfgang_S
I got the same error message. Did you ever fix it?
Best regards

The message is explicit. The CloudFormation stack is unable to create a Lambda function with the name listed in the error as it already exists. You can either delete that function using the AWS console or configure a different name in the config file ask-resources.json.

You should also check if you didn’t deploy multiple CloudFormation stacks for the skill. This can happen if you decided to redeploy from a new location, ASK-CLI may not be aware of the existing stack. If this is the case, delete the existing stack before deploying.

Hi @jeshab ,

there are no functions or stacks in my aws console, that’s why I did not know what to do.
Changing the name made the message go away. Now I’m stuck at

Skill api domain \"smartHome\" cannot be enabled. Skipping the enable process.

I did the account linking which was successful.
I will do some more research and if I can’t figure it out (what will probably be the case) I will open up a new thread.

Thanks for the help!

Best regards

That warning message is expected since ASK CLI can’t enable a skill that requires account linking. You need to manually enable the skill through the Alexa app after you set the skill account linking information as per the documentation.

Thank you for your answer, that helps!

Now it seems like I have a account linking problem but I don’t think it is a good idea to hijack this thread, so I will open a new thread and post the link here. :slight_smile:

Best regards

Hi @jeshab
I finally understand why I did not see the lambda function when the error with the already existing function occurred, I was looking at the wrong region. :see_no_evil:
I was looking at eu-central-1 but it was set to eu-west-1. Now I would like to change the region, but only changing it in ask-resources.json results in the error The CloudFormation deploy failed for Alexa region "default": UnknownError. What else needs to be changed?

Btw that’s the tread I opened

Best regards

I did it from scratch and tried to set it up for region eu-central-1 but it seems like this region is not supported. I did it again from scratch with region eu-west-1 and now it works. :hugs:

@jeshab Thank you very much for your help!

Best regards

2 Likes