Open czalkin opened 8 months ago
Hello @czalkin.
When I remove a number of these files, the error goes away.
Do you mean you deleted these files temporarily or you updated the static site manifest to not include specific files? I wonder if you accidentally included too many files instead of "Total size for the entire site upload is under 4 MB.", since 1775140864 bytes is more than 1 GB 🤔 But either way the binary shouldn't panic, which indicates there's a bug for us to fix.
I meant that I removed the files from the folder before attempting a new deploy. I also tried updating the manifest to ignore the folder, and it still generated the same errors. I would not expect copilot to even scan the folder when excluded in the manifest.
I double checked and, the images folder is under 4MB, the site is 5.5MB. It's a far cry from the 1775140864 bytes!
bash-5.2$ cd www
bash-5.2$ du -h .
4.0K ./assets/icon
12K ./assets/img
124K ./assets/json
88K ./assets/pics
68K ./assets/svg
300K ./assets
3.1M ./svg
5.5M .
bash-5.2$ cat ../copilot/myappname/manifest.yml
name: myappname
type: Static Site
http:
path: '/'
alias: 'myappname.mydomainname.com'
files:
- source: ./www
recursive: true
Hello @czalkin. I can't reproduce the issue. Do you feel comfortable sending the compressed static assets folder to aws-copilot-feedback@amazon.com?
Cloudwatch shows the following in /aws/lambda/$app-$env-TriggerStateMachineFunction
How did you get this error if it failed even before deploying any CFN stack?
I have sent a test case that reproduces the issue on my end. Thank you for looking into it.
I was able to run "svc init" and "svc deploy" with a mostly blank content. That created the CFN stack and initialized as expected. I added the rest of the site files, and the error returned and is visible in cloudwatch.
Hello @czalkin. Thank you for sharing the test case. I am able to produce an error but it's not the same one as you got. I didn't get the out of memory panic.
From my understanding, the issue is because there is a file we use to store the mapping information for copying the cached file we uploaded earlier before the CFN stack deployment, to the real static site bucket. That mapping file size grows as the more total files you have and was above the result
limit when the state machine performed s3:getObject
. We might need to split the file into multiple smaller files when the size is above 256k.
As a temporary workaround before we fix the issue, could you have a relatively smaller number of total files managed by files
in static site manifest by reducing the number or having some of them uploaded manually (we won't delete anything from the static site bucket until deleting the bucket). You can also use exclude
to exclude some files. Sorry for the inconvenience and let me know if you have more questions!
That does explain why removing the folder with 1338 files solved the issue and why I could not pin down an individual file that triggered the error. We are currently manually updating those files to S3, and we can keep down that path for the foreseeable future. Thank you for the quick investigation and workaround.
When deploying a static site, i am getting an out of memory exception, followed by a number of other errors (attached)
I have narrowed it down to including the svg files from ionicon (part of ionic in our angular application). When I remove a number of these files, the error goes away. I haven't been able to pin it down to a specific set of files. All of the files are under 5kb. Total size for the entire site upload is under 4 MB.
Cloudwatch shows the following in /aws/lambda/$app-$env-TriggerStateMachineFunction
And this prints to the command line from copilot:
Whole log attached.
err.txt