Zerquix18 / harmony-cloudwatch

1 stars 3 forks source link

Deployment failure #1

Closed givp closed 3 years ago

givp commented 3 years ago

When I try to deploy using cdk deploy I get a list of all the tests, select Y to continue and this happens. Any ideas?

Do you wish to deploy these changes (y/n)? y
HarmonyCloudwatchStack: deploying...
[0%] start: Publishing d89bf72c9e2190c0694c89f439d304552bc0a4c0e8820a54a2ecdc9db4945d66:current
[100%] success: Published d89bf72c9e2190c0694c89f439d304552bc0a4c0e8820a54a2ecdc9db4945d66:current
HarmonyCloudwatchStack: creating CloudFormation changeset...
2:05:56 PM | CREATE_FAILED        | AWS::S3::Bucket         | CanariesBucket94CD2FC3
canaries-logs-bucket already exists

    new Bucket (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/node_modules/@aws-cdk/aws-s3/lib/bucket.ts:713:2 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | HarmonyCloudwatchStack
2)
    \_ new HarmonyCloudwatchStack (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/lib/harmony-cloudwatch-stack.
ts:16:20)
    \_ Object.<anonymous> (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/bin/harmony-cloudwatch.ts:7:1)
    \_ Module._compile (internal/modules/cjs/loader.js:1063:30)
    \_ Module.m._compile (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/node_modules/ts-node/src/index.ts:1056
:23)
    \_ Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    \_ Object.require.extensions.<computed> [as .ts] (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/node_modul
es/ts-node/src/index.ts:1059:12)
    \_ Module.load (internal/modules/cjs/loader.js:928:32)
    \_ Function.Module._load (internal/modules/cjs/loader.js:769:14)
    \_ Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    \_ main (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/node_modules/ts-node/src/bin.ts:198:14)
    \_ Object.<anonymous> (/Users/giv/Documents/workspace/harmony/harmony-cloudwatch/node_modules/ts-node/src/bin.ts:288:3
)
    \_ Module._compile (internal/modules/cjs/loader.js:1063:30)
    \_ Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    \_ Module.load (internal/modules/cjs/loader.js:928:32)
    \_ Function.Module._load (internal/modules/cjs/loader.js:769:14)
    \_ Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    \_ /usr/local/lib/node_modules/npm/node_modules/libnpx/index.js:268:14

 ❌  HarmonyCloudwatchStack failed: Error: The stack named HarmonyCloudwatchStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE
    at Object.waitForStackDeploy (/usr/local/lib/node_modules/aws-cdk/lib/api/util/cloudformation.ts:305:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.deployStack (/usr/local/lib/node_modules/aws-cdk/lib/api/deploy-stack.ts:294:26)
    at CdkToolkit.deploy (/usr/local/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:180:24)
    at initCommandLine (/usr/local/lib/node_modules/aws-cdk/bin/cdk.ts:212:9)
The stack named HarmonyCloudwatchStack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE
givp commented 3 years ago

Ah, never mind. I had to change the bucket name since those are globally unique and you probably own canaries-logs-bucket 😃

givp commented 3 years ago

Now I'm getting this. It starts to create the canaries but then it rolls back and deletes due to this error:

2:32:55 PM | CREATE_FAILED        | AWS::Synthetics::Canary | Canaryhmyv2getLastCrossLinks831C66A8
Resource handler returned message: "Rate exceeded (Service: AWSLambda; Status Code: 429; Error Code: TooManyRequestsEx
ception; Request ID: 880d8375-2e93-406a-970f-9b5fd2dc68cb; Proxy: null)" (RequestToken: cdf64411-6e76-643c-4ae7-c62975
b62218, HandlerErrorCode: GeneralServiceException)

How did you get around this when you were testing? Can you do it in batches? how?

givp commented 3 years ago

Hah, never mind again! I ran it again and it worked. Thank you.

Zerquix18 commented 3 years ago

Hello! Glad you could figure it out. The Rate Limited issue seems to happen when many lambdas are created very quickly (The Canary creates a lambda for each method). I ran into it while destroy/deploying the stack :)

Let me know if you have further questions!