aws-samples / aws-cloud9-bootstrapping-example

This example Cloudformation Code Project shows how to bootstrap AWS Cloud9 environments using Cloudformation, AWS Lambda and AWS Systems Manager
MIT No Attribution
27 stars 25 forks source link

cloud formation fails to deploy - ExampleC9BootstrapInstanceLambda timeout #9

Open seaphu opened 1 month ago

seaphu commented 1 month ago

Describe the bug When deploying this could formation I get the following error after a long 15 minute+ wait. for ExampleC9BootstrapInstanceLambda: CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [--***]. If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version.

To Reproduce Steps to reproduce the behavior:

  1. run example_setup.sh (in us-west-2)
  2. wait for cloudformation stack to fail and rollback
  3. view stack events for detailed error message (also copied above)

Expected behavior stack deployment should succeed without error.

Screenshots

Desktop (please complete the following information):

Additional context cfn stack times out on deployment and then fails.

couchgott commented 1 month ago

taking a look within the next days.

best,

David

couchgott commented 1 month ago

hey @seaphu ,

i basically could not restore the behaviour you ran into in us-west-2. can you help me and look into your cloudwatch logs and pull out the logs written by the Lambda-function doing the boostrap? i did also update the python runtime to the most current python3 version just in case :)

Ty!

David

cszhz commented 4 weeks ago

+1 I met error as well. ExampleC9BootstrapInstanceLambda

CloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [a863efff-ffb8-49e7-b37c-254770211ceb]. If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version.
couchgott commented 4 weeks ago

hi @cszhz ,

can you be so kind and add the AWS Lambda function output you get into the ticket?

Ty!

David

cszhz commented 4 weeks ago

Hi David, Thanks for your advice. The root cause is missing statement between if else (example_instancestack.yaml line 202-203), I added "pass", the lambda error disappear.

However cloud9 disk resize is still not success. So far there are two OS selection in cloud9 :amazon linux 2 and amazon linux 2023. i added the following statement, but it is no effect.

SUBAL2023="VERSION_ID=\"2023\""
                if [[ "$STR" == *"$SUBAL2"* || "$STR" == *"$SUBAL2023"* ]]

https://docs.aws.amazon.com/zh_cn/cloud9/latest/user-guide/move-environment.html#move-environment-resize

Could you please take a look? Have a nice day.