aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 79 forks source link

Template may not exceed 1000000 bytes in size #2153

Open Anirudhastikar opened 11 months ago

Anirudhastikar commented 11 months ago

Amplify CLI Version

12.0.3

Question

This error is blocking us from making any further changes to our API. We have a large schema and sometimes when we try to push it gives us the error Template may not exceed 1000000 bytes in size. So why did this error come apparently?

These are two GitHub issues as references:

  1. https://github.com/aws-amplify/amplify-category-api/issues/1453
  2. https://github.com/aws-amplify/amplify-cli/issues/7680

image (2)

AnilMaktala commented 11 months ago

Hi @Anirudhastikar, Thanks for raising this issue. I see that using the --minify option was suggested in issue #1453 as a potential solution. Have you already tried implementing that proposed --minify option but are still running into this error?

dpilch commented 11 months ago

We met with the customer and determined they are reaching a hard limit set by AppSync. For anyone else that encounters this issue, AppSync is working to increase the limit for all customers. Please refer to this ticket for the status of that feature.

JeetTatva commented 6 months ago

Hello @Anirudhastikar, did you managed to solve this issue? I am also facing this on my production and cannot release the new changes. The same deployment on staging env was a success

dpilch commented 6 months ago

AppSync is starting to roll out the change that should resolve this.

@JeetTatva are you seeing the Template may not exceed 1000000 bytes in size error or is it the Maximum number of CloudFormation resources a nested stack can create, update, or delete per operation. error? https://github.com/aws-amplify/amplify-category-api/issues/2432

JeetTatva commented 6 months ago

AppSync is starting to roll out the change that should resolve this.

@JeetTatva are you seeing the Template may not exceed 1000000 bytes in size error or is it the Maximum number of CloudFormation resources a nested stack can create, update, or delete per operation. error? #2432

@dpilch I get the Template may not exceed 1000000 bytes in size error

dpilch commented 5 months ago

AppSync has released the change in all regions. @JeetTatva are you still experiencing the issue?

LukaASoban commented 4 months ago

@dpilch I am using Gen 2 and I see this warning. Does this mean I can ignore it and I should be good?

[Warning at /amplify-mprj-luka-sandbox-5e82b4985b/data] Template size is approaching limit: 904019/1000000. Split resources into multiple stacks or set suppressTemplateIndentation to reduce template size. [ack: @aws-cdk/core:Stack.templateSize]

dpilch commented 3 months ago

No, this should not be ignored. You might be encountering a different issue (but with the same error message) than the original poster. You probably need to preform stack mapping in this case.

I'm not able to find the docs for this ATM. I'll comment back here when I find it.

JeetTatva commented 3 months ago

AppSync has released the change in all regions. @JeetTatva are you still experiencing the issue?

When did they released the change?

dpilch commented 3 months ago

The change was deployed region as of May 28.

LukaASoban commented 3 months ago

@dpilch were you able to find anything for Gen 2? Just wondering if there is any work around or something I can do so that I don't hit the limit

maschtag commented 3 months ago

Hi @dpilch, thanks for your help on this issue.

I got the same following Error on amplify build logs : 2024-08-15T16:17:12.511Z [INFO]: 🛑 ["Index: 0 State: {\"rollback\":\"rollingBack\"} Message: Template may not exceed 1000000 bytes in size."]

It is probably due to our large graphql schema, but I am not 100% sure.

LukaASoban commented 3 months ago

It's definitely either due to a large schema and or appsync pipeline resolvers. Would really like a work around here because it basically blocks any further development work.

maschtag commented 3 months ago

Also, it seem that the project is stuck in this error mode. Even if I remove some tables to reduce the size of the file, I still get the error. I tried to rollback but no success.

EDIT : In the "#current-cloud-backend" folder, I found the template file >1Mb, so it seems that it has been accepted once, and then stuck the app?

EDIT 2 : The cloudformation file in the amplify-cfn-templates/ folder and the one in the "#current-cloud-backend" are not 100% the same : the first one has 1 space indentation and the second one has 2 spaces. As consequence they don't have the same size, the second one is >1Mb while the first one is not. Also, event if I manually minify the file, when I run amplify push, the file is updated and overrided by a new one >1Mb

vinothj-aa commented 2 months ago

I'm facing the same issue with Amplify Gen 2: Template may not exceed 1000000 bytes in size. As per the documentation, I do not have the option to minify the file (as mentioned above).

To give you some context (as on September 16 2024): Models: 1 Custom Types: 32 (we have duplication check & aggregation) Custom Queries: 36 Custom Mutations: 43 And we have several modules to be developed and the counts would be significantly higher. I'm stuck with this error and I'm not sure how to move forward from here!

I really appreciate it if someone could help me to solve this issue with Amplify Gen 2. Thanks in advance.

sarthak-patidar-paz commented 1 week ago

Any updates on this issue?? Can't add even a single field in my schema.