Skip to content

Template outputs limit reached #2853

Closed
Closed

Description

@JakubMatejka

This is a Bug Report

Description

Deployment is failing with message Template format error: Outputs count 69 is greater than max allowed 60. after upgrade to 1.3. There is a similar issue #2466 however it doesn't look to be related, the deployment ends well when I downgrade back to 1.2.

Additional Data

  • Serverless Framework Version you're using: 1.3.0
  • Operating System: macOS 10.12.1

Activity

  1. pmuens commented on Dec 3, 2016

    @pmuens
    Contributor

    Thanks for reporting @JakubMatejka 👍
    Could you do a serverless info --verbose to see all the stuff which is in your Outputs section?

    This might have something todo with the Lambda versioning support #2676

    /cc @eahefnawy @mthenw @nikgraf

  2. added this to the 1.4 milestone on Dec 3, 2016
  3. JakubMatejka commented on Dec 3, 2016

    @JakubMatejka
    Author

    Well, there are 37 outputs (and v1.2 shows the same).

    Here is whole output of serverless info --verbose:

    Service Information
    service: jakub-dev-portal-novpc
    stage: dev
    region: eu-west-1
    api keys:
      None
    endpoints:
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/admin/apps/{id}/approve
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/admin/apps/{id}
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/admin/apps
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/admin/users
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/admin/users/{email}/admin
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/admin/users/{email}/enable
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}/approve
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}/versions/{version}
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}/icons
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps
      PATCH - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}/versions
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendor/apps/{appId}/versions/{version}/rollback
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/confirm/{email}/{code}
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/confirm/{email}/{code}
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/confirm
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/forgot/{email}
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/forgot/{email}/confirm
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/login
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/profile
      PUT - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/profile
      POST - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/auth/signup
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/apps/{appId}
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/apps/{appId}/versions/{version}
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/apps
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/apps/{appId}/versions
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendors
      GET - https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev/vendors/{vendor}
    functions:
      jakub-dev-portal-novpc-dev-authConfirmResend: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authConfirmResend
      jakub-dev-portal-novpc-dev-authForgot: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authForgot
      jakub-dev-portal-novpc-dev-adminUsersMakeAdmin: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminUsersMakeAdmin
      jakub-dev-portal-novpc-dev-vendorAppsList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsList
      jakub-dev-portal-novpc-dev-authProfileChange: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authProfileChange
      jakub-dev-portal-novpc-dev-vendorAppsVersionsList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsVersionsList
      jakub-dev-portal-novpc-dev-vendorAppsIconsLinks: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsIconsLinks
      jakub-dev-portal-novpc-dev-vendorAppsUpdate: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsUpdate
      jakub-dev-portal-novpc-dev-vendorAppsIconsUpload: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsIconsUpload
      jakub-dev-portal-novpc-dev-vendorDetail: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorDetail
      jakub-dev-portal-novpc-dev-vendorAppsVersionsRollback: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsVersionsRollback
      jakub-dev-portal-novpc-dev-appsVersionsList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-appsVersionsList
      jakub-dev-portal-novpc-dev-adminUsersList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminUsersList
      jakub-dev-portal-novpc-dev-appsList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-appsList
      jakub-dev-portal-novpc-dev-adminAppsList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminAppsList
      jakub-dev-portal-novpc-dev-adminAppsDetail: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminAppsDetail
      jakub-dev-portal-novpc-dev-authConfirmPost: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authConfirmPost
      jakub-dev-portal-novpc-dev-authLogin: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authLogin
      jakub-dev-portal-novpc-dev-authorizer: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authorizer
      jakub-dev-portal-novpc-dev-vendorAppsDetail: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsDetail
      jakub-dev-portal-novpc-dev-adminAppsApprove: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminAppsApprove
      jakub-dev-portal-novpc-dev-authProfile: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authProfile
      jakub-dev-portal-novpc-dev-authEmailTrigger: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authEmailTrigger
      jakub-dev-portal-novpc-dev-vendorAppsApprove: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsApprove
      jakub-dev-portal-novpc-dev-vendorsList: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorsList
      jakub-dev-portal-novpc-dev-authForgotConfirm: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authForgotConfirm
      jakub-dev-portal-novpc-dev-authSignup: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authSignup
      jakub-dev-portal-novpc-dev-vendorAppsCreate: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsCreate
      jakub-dev-portal-novpc-dev-authConfirmGet: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authConfirmGet
      jakub-dev-portal-novpc-dev-logger: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-logger
      jakub-dev-portal-novpc-dev-adminUsersEnable: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminUsersEnable
      jakub-dev-portal-novpc-dev-appsDetail: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-appsDetail
    
    Stack Outputs
    AuthConfirmResendLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authConfirmResend
    CloudFrontUri: d122tfpplergup.cloudfront.net
    AuthForgotLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authForgot
    AdminUsersMakeAdminLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminUsersMakeAdmin
    VendorAppsListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsList
    AuthProfileChangeLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authProfileChange
    ServerlessDeploymentBucketName: jakub-dev-portal-novpc-d-serverlessdeploymentbuck-wv24jrgpeb6w
    VendorAppsVersionsListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsVersionsList
    VendorAppsIconsLinksLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsIconsLinks
    VendorAppsUpdateLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsUpdate
    VendorAppsIconsUploadLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsIconsUpload
    VendorDetailLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorDetail
    VendorAppsVersionsRollbackLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsVersionsRollback
    AppsVersionsListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-appsVersionsList
    AdminUsersListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminUsersList
    RdsPort: 3306
    AppsListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-appsList
    AdminAppsListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminAppsList
    AdminAppsDetailLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminAppsDetail
    AuthConfirmPostLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authConfirmPost
    AuthLoginLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authLogin
    AuthorizerLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authorizer
    VendorAppsDetailLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsDetail
    AdminAppsApproveLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminAppsApprove
    AuthProfileLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authProfile
    RdsUri: jakub-dev-portal-novpc-rds.cptjrpubo0om.eu-west-1.rds.amazonaws.com
    AuthEmailTriggerLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authEmailTrigger
    VendorAppsApproveLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsApprove
    VendorsListLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorsList
    AuthForgotConfirmLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authForgotConfirm
    AuthSignupLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authSignup
    VendorAppsCreateLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-vendorAppsCreate
    AuthConfirmGetLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-authConfirmGet
    LoggerLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-logger
    AdminUsersEnableLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-adminUsersEnable
    AppsDetailLambdaFunctionArn: arn:aws:lambda:eu-west-1:061240556736:function:jakub-dev-portal-novpc-dev-appsDetail
    ServiceEndpoint: https://rqq1o200h8.execute-api.eu-west-1.amazonaws.com/dev
    
  4. pmuens commented on Dec 3, 2016

    @pmuens
    Contributor

    @JakubMatejka thanks for posting. That's a long list.

    Hmm. Nothing exceptional either... Is there any chance to split this up into multiple services as this seems pretty large.

    This refactoring might also help: #1825 (planned for 2.0).

  5. JakubMatejka commented on Dec 3, 2016

    @JakubMatejka
    Author

    Oh, that would mean a lot of rewriting I'm afraid (not just in the code itself but also in our deployment scripts built around Serverless). To be honest, I would be happier if it can be solved differently (and fast, above all). We wanted to have our service running already and were waiting just for the fix of deployment to VPC in v1.3. So this is a little bit unpleasant surprise. ;o) And what about this plugin from #2466: https://github.com/Brigad/serverless-remove-cf-outputs-plugin/blob/master/src/index.js, would it help? (I don't understand it's consequences.) Thanks.

  6. pmuens commented on Dec 4, 2016

    @pmuens
    Contributor

    Hmm true. Nice catch!

    That would be a breaking change. I've moved it to the v2.0 milestone. We'll look into this issue. Not sure about the plugin. It's removing the outputs but at a first glance it's hard to understand which outputs it actually removes...

  7. ryansb commented on Dec 5, 2016

    @ryansb
    Contributor

    This one isn't related to #2676, since it doesn't add outputs for old versions: only for the current one.

  8. ryansb commented on Dec 5, 2016

    @ryansb
    Contributor

    Would it be possible for you to post the generated template from v1.3? It should be located in .serverless/cloudformation-template-update-stack.json. Then we could see exactly what the output is, and where those other resources are being created.

    In the near term, https://github.com/Brigad/serverless-remove-cf-outputs-plugin may fix your issue.

  9. JakubMatejka commented on Dec 5, 2016

    @JakubMatejka
    Author

    Sure, here it is: cloudformation-template-update-stack.json.txt (I just did some obfuscations in env vars and added txt suffix to the filename because it seems that Github doesn't like jsons). Thanks for your help.

  10. pmuens commented on Dec 6, 2016

    @pmuens
    Contributor

    Thanks for the heads up @ryansb and thanks for posting the output @JakubMatejka

    I think these are the LOC which will cause most of the trouble: https://github.com/serverless/serverless/blob/master/lib/plugins/aws/deploy/compile/functions/index.js#L187-L196

    It will produce 1 output per function. Instead of doing this we should create one skeleton output in the compileFunctions method below. The ARNs can then be computed on the fly (e.g. for the info) plugin.

    Unfortunately this is a breaking change as people might use the ARNs form the output section in their code somehow... Still not sure if this means that Serverless will reach v2 soon or if splitting a large service with dozens of function up into multiple separate ones is a better solution for now...

  11. modified the milestones: 2.0, 1.4 on Dec 14, 2016
  12. shawnemullen commented on Dec 16, 2016

    @shawnemullen

    This issue is causing problems for me as well. I do not like the idea of "splitting up a large service into multiples" because I don't want multiple APIs for one logical service.

    I am not sure what problem is being solved by placing a limit in the first place. V1.2 doesn't seem to have an issue.

  13. 3 remaining items

  14. shawnemullen commented on Dec 31, 2016

    @shawnemullen

    After looking at this problem a little closer, i don't see this as a CloudFormation problem. Yes, there is a max of 60 aloud, but it looks as though serverless declares outputs for nearly everything in the template. I think a better solution would be to allow the developer to declare what the outputs should be. Maybe a simple flag in the function definition?

    There isn't a lot of documentation on the severless web site regarding the Resources section so maybe this is already possible.

  15. shawnemullen commented on Dec 31, 2016

    @shawnemullen

    BTW, I tried using the plugin mentioned above, but it adds over 10MB to my upload file. Maybe I am doing something wrong.

  16. pmuens commented on Jan 3, 2017

    @pmuens
    Contributor

    Just a quick update on this one.

    @ryansb was kind enough to PR a functionality where one can specify if the Lambda functions should be versioned (See the linked PR #3042) above. 👍

  17. modified the milestones: 2.0, 1.6 on Jan 18, 2017
  18. pmuens commented on Jan 20, 2017

    @pmuens
    Contributor

    Hey everyone! Here's a quick update:

    We've just merged @ryansb PR #3042 so that you can now opt out of function versioning.

    Furthermore we've PRed a changed so that function arns are no longer added as Outputs and will be computed on the fly when running the info command: #3125

    This way the Outputs size should be reduced dramatically.

  19. pmuens commented on Jan 24, 2017

    @pmuens
    Contributor

    Both, #3042 and #3125 are not merged.

    Closing this issue since the next Serverless release (v1.6) which is just around the corner will include those merged PRs. Feel free to comment if this is still a problem (after updating to v1.6) and we'll reopen.

  20. manishjha1991 commented on Feb 3, 2018

    @manishjha1991
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions