bogdaaamn / deta-deploy-action

Simple GitHub Action to deploy current repo to a Deta Micro
https://github.com/marketplace/actions/deploy-to-deta
MIT License
79 stars 17 forks source link

Request entity too large error #5

Open HarshKapadia2 opened 2 years ago

HarshKapadia2 commented 2 years ago

While deploying my web app to Deta, the Action errors out with the following error: Error: failed to deploy: Request entity too large.

Failed workflow run: https://github.com/OurTechCommunity/catchup/runs/5065242922

How can this error be resolved?

NOTE: After the workflow failed, I tried to deploy my web app to the Micro directly from my local CLI and that worked. So there is some issue going on with the Action, I guess.

Andrew-2609 commented 2 years ago

This happened to me too, I resolved it when I realized that my workflow sent some extra folders because I didn't configure it right :no_mouth:. Try to download your micro from Deta, and see if the files in the folders are correct. I had to make a new micro and deploy it again, and configure the workflow correctly to send only the necessary directory.

HarshKapadia2 commented 2 years ago

I just cloned my Micro to check what was happening and I think I got the issue.

This is what my cloned Micro looks like

The Action clones the Micro into a tmp directory to gain access to the .deta directory, but does not delete that tmp directory, which leads to it being pushed to the Micro.

Now this happens every time a deploy occurs, which leads to the tmp directory getting pushed to the Micro with every deploy, thereby increasing the size exponentially.

I think this is what caused the Request entity too large error.

HarshKapadia2 commented 2 years ago

A simple deletion of the tmp directory after copying the .deta directory should solve the problem.

I'll open a PR for this.

HarshKapadia2 commented 2 years ago

There is PR #4 open for this, but it removes the tmp directory in the 'Deploy to Deta' step rather than in the 'Clone Deta Metadata' step itself.

I think it would be better to delete the tmp directory in the same step as it was created (Clone Deta Metadata). I'll put in comment about this on PR #4.

HarshKapadia2 commented 2 years ago

Till the author of the Action does not merge the PR, what one can do is to clone the Micro, delete the topmost tmp directory and then deploy to Deta manually. This will have to be done every time such an error is encountered.

cody-scott commented 2 years ago

An alternative I took to the was just creating the action in my own repo until it is merged.

Unfortunate that it'll be needed in every repo, but at least it is a simple fix for now.

https://github.com/namur007/JJE_Automation/.github

bogdaaamn commented 2 years ago

Oh damn, very good catch. Thanks a lot folks!! Will merge later tonight.

HarshKapadia2 commented 2 years ago

As mentioned in a previous comment:

Till the author of the Action does not merge the PR, what one can do is to clone the Micro, delete the topmost tmp directory and then deploy to Deta manually. This will have to be done every time such an error is encountered.

Deta is currently having an edge case with deta clone that is preventing deletion of files. Creating a new Micro is one way to go about it.

HarshKapadia2 commented 2 years ago

Due to inactivity here, I created a new Action (which is a fork of this repository): https://github.com/HarshKapadia2/deta-deploy