dougmoscrop / serverless-plugin-split-stacks

A plugin to generate nested stacks to get around CloudFormation resource/parameter/output limits
299 stars 71 forks source link

Rate exceeded #34

Closed brunocascio closed 6 years ago

brunocascio commented 6 years ago

Hi Folks!

I'm trying to build my project on CircleCI and I got this error:

Serverless: Invoke webpack:package
Serverless: Zip service: /home/ubuntu/project/.webpack/service [239 ms]
Serverless: Packaging service...
Serverless: Remove /home/ubuntu/project/.webpack
Serverless: Invoke aws:package:finalize

Serverless Error ---------------------------------------

  Rate exceeded

  Stack Trace --------------------------------------------

ServerlessError: Rate exceeded
    at BbPromise.fromCallback.catch.err (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:258:33)
From previous event:
    at persistentRequest (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:247:13)
    at doCall (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:205:9)
    at BbPromise (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:216:14)
From previous event:
    at persistentRequest (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:203:38)
    at Object.request.requestQueue.add [as promiseGenerator] (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:237:49)
    at Queue._dequeue (/home/ubuntu/project/node_modules/promise-queue/lib/index.js:149:30)
    at /home/ubuntu/project/node_modules/promise-queue/lib/index.js:156:26
From previous event:
    at Queue._dequeue (/home/ubuntu/project/node_modules/promise-queue/lib/index.js:151:18)
    at /home/ubuntu/project/node_modules/promise-queue/lib/index.js:108:18
From previous event:
    at Queue.add (/home/ubuntu/project/node_modules/promise-queue/lib/index.js:93:16)
    at AwsProvider.request (/home/ubuntu/project/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:237:39)
    at listStackResources (/home/ubuntu/project/node_modules/serverless-plugin-split-stacks/lib/utils.js:261:23)
    at ServerlessPluginSplitStacks.getStackSummary (/home/ubuntu/project/node_modules/serverless-plugin-split-stacks/lib/utils.js:273:12)
    at Promise.all.nestedStacks.map.stack (/home/ubuntu/project/node_modules/serverless-plugin-split-stacks/lib/migrate-existing-resources.js:19:21)
    at Array.map (native)
    at getStackSummary.catch.then.then.nestedStacks (/home/ubuntu/project/node_modules/serverless-plugin-split-stacks/lib/migrate-existing-resources.js:15:39)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at ServerlessPluginSplitStacks.getCurrentState [as migrateExistingResources] (/home/ubuntu/project/node_modules/serverless-plugin-split-stacks/lib/migrate-existing-resources.js:14:6)
    at Promise.resolve.then (/home/ubuntu/project/node_modules/serverless-plugin-split-stacks/split-stacks.js:67:24)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           6.11.5
     Serverless Version:     1.26.1

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn deploy --stage ${CIRCLE_BRANCH} --verbose returned exit code 1

Action failed: yarn deploy --stage ${CIRCLE_BRANCH} --verbose

My serverless.yml configuration:

splitStacks:
    perFunction: true
    perType: true

Any idea?

dougmoscrop commented 6 years ago

Yes, with the large number of sub-stacks, this:

https://github.com/dougmoscrop/serverless-plugin-split-stacks/blob/26799e0d315eae0a2deed13543e5c0537b476a85/lib/migrate-existing-resources.js#L15

Is probably doing too many concurrent requests to AWS.

I will push some kind of workaround.

brunocascio commented 6 years ago

Yes, I have 324 resources and 25 stacks đŸ˜†

brunocascio commented 6 years ago

@dougmoscrop After latest merge, I got this error:

Serverless: Packaging service...
Serverless: Remove /home/ubuntu/project/.webpack
Serverless: Invoke aws:package:finalize
Unhandled rejection Error: Retry limit exceeded
    at module.exports.logError.errorHandlingError (/home/ubuntu/project/node_modules/serverless/lib/classes/Error.js:94:11)
    at initializeErrorReporter.then.catch.e (/home/ubuntu/project/node_modules/serverless/bin/serverless:45:3)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at __dirname (/home/ubuntu/project/node_modules/serverless/bin/serverless:43:9)
    at Object.<anonymous> (/home/ubuntu/project/node_modules/serverless/bin/serverless:46:4)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:505:3
brunocascio commented 6 years ago

I removed cache and it works.......

codingmeow commented 5 years ago

@brunocascio I know this is old, but can you elaborate on which cache you removed?

brunocascio commented 5 years ago

Hi @codingmeow. I removed node_modules, .webpack and .serverless folders

codingmeow commented 5 years ago

@brunocascio Thank you!