aws-amplify / aws-amplify/amplify-hosting

GitHub webhook push event receives response: "414 Request-URI Too Large"

Open
#2,327 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-console/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-console/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-console/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

### App Id

not relevant

### Region

us-east-1

### Amplify Console feature

GitHub integration - builds

### Describe the bug

Upon merging a PR, GitHub sends the push event to Amplify's Lambda for processing to trigger a build. When that PR is large with many changes (in our case, when updating many dependencies with Yarn Berry Zero-Installs), the Lambda responds with the following result:

Status: `202`
Headers:
```
Content-Length: 186
Content-Type: application/json
Date: Tue, 19 Oct 2021 13:26:34 GMT
Via: 1.1 17c056a089c69d54a02a9a3ca804fdd6.cloudfront.net (CloudFront)
X-Amz-Apigw-Id: HdQdsH4poAMFVkQ=
X-Amz-Cf-Id: pniIjaO2AkF6Vg4amtTGUQC3_u_n40kOct8bi8zwZomy9F4p9_CdVw==
X-Amz-Cf-Pop: IAD66-C2
X-Amzn-Requestid: 72b91a91-4cb4-4f98-8ec9-e8ecc7f92d69
X-Amzn-Trace-Id: Root=1-616ec78a-38c7077d16a3e633500da450
X-Cache: Miss from cloudfront
```

Response:
```html

414 Request-URI Too Large

414 Request-URI Too Large

RequestId=1A45013225E1F98F

```

As a result, the build is not triggered. To remediate, I have to push an empty commit to triger a build.

### Expected behavior

Amplify's Lambda supports a large payload on GitHub build triggers

### Reproduction steps

1. Generate a large changelog of PRs, possibly with many dependencies changed with Yarn Berry Zero-Installs
2. Merge that PR
3. Check the response from the GitHub webhook settings of the repository

### Build Settings

_No response_

### Additional information

One [hint](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414), perhaps something in AWS is converting the POST to a GET

> when a client has improperly converted a POST request to a GET request with long query information,

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with a large changelog or dependency update, then inspect the response in the repository's GitHub webhook settings and the Amplify Lambda build trigger. Done means a large GitHub push event is accepted and the build is triggered without the 414 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, github
Domain
ci-cd, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.