Home > Software design >  Why do I hit a hook limitation using AWS Amplify with Github?
Why do I hit a hook limitation using AWS Amplify with Github?

Time:10-13

I want to deploy an AWS Amplify app from a Github web project (HTML and CSS only). I have previously deployed the app, but now I get a hook limitation error when I try to redeploy it

There was an issue setting up your repository.
Please try again later.
({
    "message": "Validation Failed",
    "errors": [
        {
            "resource": "Hook",
            "code": "custom",
            "message": "The \"push\" event cannot have more than 20 hooks"
        }
    ],
    "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-repository-webhook"
})

I am using AWS website (UI) to deploy my app.

What are these hooks ?

CodePudding user response:

You have hit the GitHub limit on the number of webhooks you can have, which is 20 as mentioned in the documentation.

You can create up to 20 webhooks for each event on each installation target (specific organization or specific repository).


It looks like you have reached this limit based on your error "The 'push' event cannot have more than 20 hooks".

I'm not sure how you're deploying your app but whatever way you are using, it looks like it's creating too many GitHub webhooks.

Take a look to see if there are any options to use pre-existing hooks in your deployment strategy or just simply delete extra hooks from (repository) Settings > Webhooks.

CodePudding user response:

Hooks limitation comes from github (they are listed in Settings > Webhooks)

When deploying an app with Amplify, AWS automatically:

  • adds a webhook on the "push" event,
  • adds a public SSH key key to the repository Afterward a push on the remote repo triggers a redeployment of the application.

In my case I deployed too many times the app. This issue can be encountered when deploying with Terraform.

Special thanks to @Ermiya Eskandary

  • Related