You're viewing **Apigee Edge** documentation.  
[Go to the
**Apigee X** documentation](http://cloud.google.com/apigee/docs/api-platform/errorcatalog/mp-runtime-errorcatalog). info

## Symptom


The client application gets an HTTP status code of `414 Request-URI Too Long` with
error code `protocol.http.TooBigLine `as a response for API calls.

## Error message


Client application gets the following response code:

```
HTTP/1.1 414 Request-URI Too Long
```


In addition, you may observe the following error message:

```
{
   "fault":{
      "faultstring":"request line size exceeding 7,168",
      "detail":{
         "errorcode":"protocol.http.TooBigLine"
      }
   }
}
```


Note that the `faultstring` in the above error message contains the limit allowed
for the request line in Apigee Edge, which is `7168 bytes` (7 KB).

## Possible causes

This error occurs if the size of the [request line](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#understanding-rl) sent by the client application to Apigee Edge
as part of HTTP request is greater than the [allowed limit in Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits).


Before we look at the possible causes for this error, let's understand what the request line
means and how to check its size.

### Understanding Request-Line


A typical HTTP request consists of three parts:

1. [Request-Line](https://datatracker.ietf.org/doc/html/rfc2616#section-5.1)
2. ( Set of HTTP headers )
3. \[ Body \]


The request line consists of three parts as shown below.

```
Request-Line = <Method> <Request-URI> <HTTP-Version>
```


When an HTTP request is made by the client application to a server, the first line that goes to
the server contains the ***Request-Line*** described above. This is followed by the
headers and request body/payload.

The following sample screenshot shows a typical `curl` request, the **Request**
part (along with Request-Line) and the **Response** part.
![](https://docs.apigee.com/static/api-platform/images/414-toobigline-curl-request.png)

### Understanding Request-Line size

1. In the sample discussed above, the *start* line (first line) in the request, also referred as **Request-Line** , is as follows:

   ```
   GET /test/ HTTP/1.1
   ```

   The size of the Request-Line is `~19 bytes` since it contains
   `19 ASCII characters`. Since this is within the [allowed limit in Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits), the request is processed without any errors
   and you get a successful response.
2. Similarly if you look at the `faultstring` in the [Error message](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#error-message) shown above, it contains `"request line size exceeding 7,168"`. This indicates that the Request-Line in the HTTP request made by the client exceeded 7,168 bytes.


Here are the possible causes for this error:

| Cause | Description | Troubleshooting instructions applicable for |
|---|---|---|
| [Request payload size is greater than allowed limit](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#request-greater) | The size of the Request-URI sent by the client application as part of the HTTP request to Apigee Edge is greater than the [allowed limit in Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits). | Edge Public and Private Cloud users |

## Common diagnosis steps


Use one of the following tools/techniques to diagnose this error:

### API Monitoring

> [!NOTE]
> **Note:** The instructions in this section are applicable for Public Cloud users only.


To diagnose the error using API Monitoring:

1. [Sign in to Apigee Edge UI](https://docs.apigee.com/api-platform/get-started/sign-in-manage-account.md.txt#sign_in_to_your_apigee_edge_account) as a user with an [appropriate role](https://docs.apigee.com/api-monitoring/access.md.txt#roles).
2. Switch to the organization in which you want to investigate the issue.

   ![](https://docs.apigee.com/static/api-platform/images/414-toobigline-orgs.png)
3. Navigate to the **Analyze \> API Monitoring \> Investigate** page.
4. Select the specific timeframe in which you observed the errors.
5. Plot **Fault Code** against **Time**.
6. Select a cell which has the fault code `protocol.http.TooBigLine` and status code `414` as shown below:

   ([view larger image](https://docs.apigee.com/static/api-platform/images/414-toobigline-fault-code-cell.png))
   ![](https://docs.apigee.com/static/api-platform/images/414-toobigline-fault-code-cell.png)
7. You will see the information about the fault code `protocol.http.TooBigline`
   as shown below:

   ([view larger image](https://docs.apigee.com/static/api-platform/images/414-toobigline-fault-code-info.png))
   ![](https://docs.apigee.com/static/api-platform/images/414-toobigline-fault-code-info.png)
8. Click **View logs** and expand the row for the failed request:

   ([view larger image](https://docs.apigee.com/static/api-platform/images/414-toobigline-logs.png))
   ![](https://docs.apigee.com/static/api-platform/images/414-toobigline-logs.png)
9. From the **Logs** window, note the following details:

   - **Status Code:** `414`
   - **Fault Source:** `apigee`
   - **Fault Code:** `protocol.http.TooBigLine`.
   - **Request Length(bytes):** `7244 (> 7KB)`
10. If the **Fault Source** has the value `apigee` or `MP`, the **Fault Code** has the value `protocol.http.TooBigLine` and **Request-Length** is more than 7 KB then that indicates that the HTTP request from the client has a request URI greater than the [allowed limit in Apigee](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits).

### Trace tool

> [!NOTE]
> **Note:** The requests failing with this error can not be captured in the [Trace Tool](https://docs.apigee.com/api-platform/debug/using-trace-tool-0.md.txt), since the Message Processor performs the validations in a very early phase much before processing the request and executing any policy in the API Proxy.

### NGINX

> [!NOTE]
> **Note:** The instructions in this section are for Edge Private Cloud users only.


To diagnose the error using NGINX access logs:

1. If you are a **Private Cloud user** , then you can use NGINX access logs to determine the key information about HTTP `414` errors.
2. Check the NGINX access logs:

   `/opt/apigee/var/log/edge-router/nginx/ORG~ENV.PORT#_access_log`

   **Where:** <var translate="no">ORG</var>, <var translate="no">ENV</var>, and <var translate="no">PORT#</var> are replaced with actual values.
3. Search to see if there are any `414` errors during a specific duration (if the problem happened in the past) or if there are any requests still failing with `414`.
4. If you do find any `414` errors with the **X-Apigee-fault-code** matching the value of**`protocol.http.TooBigLine`** , then determine
   the value of the **X-Apigee-fault-source.**

   ![](https://docs.apigee.com/static/api-platform/images/414-toobigline-nginx.png)

   The above sample entry from the NGINX access log has the following values for
   **X-Apigee-fault-code** and **X-Apigee-fault-source:**

   | Response Headers | Value |
   |---|---|
   | X-Apigee-fault-code | `protocol.http.TooBigLine` |
   | X-Apigee-fault-source | `policy` |

   **Note the Request Length:** `7244` (7.244KB \> allowed limit)

## Cause: Request payload size is greater than allowed limit

### Diagnosis

1. Determine the **Fault Code** , **Fault Source** and **Request-Length size** for the error observed using API Monitoring, Trace Tool or NGINX Access logs as explained in [Common diagnosis steps](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#common).
2. If the **Fault Source** has the value `apigee` or `MP`, then this indicates that the request size sent by the client application to Apigee is greater than the [allowed limit in Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits).
3. You can validate that the request line size has exceeded the 7 KB allowed limit using one of the following methods:

   ### Error message

   To validate using the error message:

   If you have access to the complete error message received from Apigee Edge, then
   refer to the `faultstring`. The `faultstring` indicates that
   the Request-Line size exceeded the allowed limit of 7 KB.

   **Sample error message:**

   ```
   "faultstring":"request line size exceeding 7,168"
   ```

   ### Actual request

   To validate using the actual request:

   If you have access to the actual request made by the client application,
   then perform the following steps:
   1. Verify the size of the URI passed in the request.
   2. If you find that the size of the URI is more than the
      [allowed limit in Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits), then that is
      the cause of the issue.

      **Sample request:**

      ```
      curl http://<hostalias>/testtoobigline?_qparam=000000000000000000……..000000<trimmed> -k -X POST
      ```

      In the above case, the value of the query parameter `qparam`
      is larger than 7 KB, that is, it contains more than 7 K ASCII characters.

      If you are using some other client, you can review the client logs and
      try to find out the size of the request line being sent to Apigee Edge.

   ### Message Processor logs

   To validate using Message Processor logs:

   > [!NOTE]
   > **Note:** The instructions in this section are for Edge Private Cloud users only.

   If you are a Private Cloud user, then you can use Message Processor logs to
   validate if the Request-Line size has exceeded the
   [allowed limit in Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits).
   1. Check the Message Processor logs:

      `/opt/apigee/var/log/edge-message-processor/logs/system.log`
   2. Search to see if there are any `414` Errors during a specific duration (if the problem happened in the past) or if there are any requests still failing with `414`. You may use the following search strings.

      ```
      grep -ri "exceeding"
      ```

      ```
      grep -ri "RequestURITooLong"
      ```
   3. You will find lines from `system.log` similar to the following:

      ```
      2021-07-12 08:53:31,461  NIOThread@0 ERROR ADAPTORS.HTTP.FLOW -
      AbstractRequestListener.onException() : Request:null, uri:null,
      message Id:null, exception:com.apigee.errors.http.user.RequestURITooLong{
      code = protocol.http.TooBigLine, message = request line size exceeding 7,168,
      associated contexts = []}, context:Context@366f4217
      input=ClientInputChannel(SSLClientChannel[Accepted: Remote:192.168.195.90:8443
      Local:192.168.67.23:34256]@301912 useCount=1 bytesRead=0 bytesWritten=45849
      age=2254670ms lastIO=0ms isOpen=true)
      ```

      The text `message = request line size exceeding 7,168` in the
      above error message indicates that the Request URI size is more than 7 KB.
      Therefore, Apigee Edge throws the exception
      `com.apigee.errors.http.user.RequestURITooLong` and returns
      `414` status code with fault code `protocol.http.TooBigline
      `to client applications.

### Resolution

> [!WARNING]
> **Warning:** Sending a request URI size greater than 7 KB, the allowed limit in Apigee Edge, can lead to increased latency, performance issues, and timeouts. It is always recommended to send a URI size less than 7 KB through Apigee Edge. Refer to the solutions listed below and use the recommended option only.


### Fix size

**Option #1 \[Recommended\]: Fix the client application not to send request URI size greater than the allowed limit**

> [!NOTE]
> **Note:** This is the recommended option to fix this issue.

1. Analyze the reason for the specific client to send request URI size more than allowed limit as defined in [Limits](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#limits).
2. If it is not desirable, modify your client application so that it sends request URI
   size less than the allowed limit.

   In the example discussed above, you can fix the issue by passing the long query
   parameter as part of the request body/payload instead of passing it as part of the
   request URL as shown below:

   ```
   curl https://<host>/testtoobigline -k -X GET -d '{_qparam=000000000000000000<trimmed>}' -v
   ```
3. If it is desirable and you want to send a URI more than the allowed limit, go to the next options.

### CwC

**Option #2 : Use CwC property to increase the request line limit**

> [!NOTE]
> **Note:**
>
> 1. This is applicable only for Private Cloud customers.
> 2. This option should only be used when you cannot use any of the recommended options as there might be performance issues if the default size is increased.

Apigee provides a [CwC](https://docs.apigee.com/private-cloud/latest/how-configure-edge) property which allows it to increase the request line size limit.
For details see
[Set the request line limit on the Message Processor](https://docs.apigee.com/private-cloud/latest/setting-http-requestresponse-header-limits#configuring-limits-for-the-message-processor)

> [!WARNING]
> **Warning:** While this option can help you work around the 7 KB request line limit enforced by the product, Apigee doesn't recommend that you increase the limit and can't support issues such as performance issues, timeouts, etc. that arise due to exceeding that limit.

## Limits

Apigee expects the client application and backend server do not send Request/Response-Lines
whose sizes are greater than the allowed limit as documented for **Request/Response Line Limit**
in [Apigee Edge Limits](https://docs.apigee.com/api-platform/reference/limits.md.txt#system).

1. If you are a **Public Cloud user** , then the maximum limit for Request and Response Line size is as documented for **Request/Response-Line size** in [Apigee Edge Limits](https://docs.apigee.com/api-platform/reference/limits.md.txt#system).
2. If you are a **Private Cloud user,** then you may have modified the default maximum limit for Request and Response-Line size (even though it is not a recommended practice). You can determine the maximum Request-Line size limit by following instructions in [How to check the current limit](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#check-limit).

### How to check the current limit?

> [!NOTE]
> **Note:** The instructions in this section are for Edge Private Cloud users only.


This section explains how to verify that the property `HTTPRequest.line.limit` has
been updated with a new value on the Message Processors.

1. On the Message Processor machine, search for the property `HTTPRequest.line.limit` in the `/opt/apigee/edge-message-processor/conf` directory and check to see what value has been set as shown below:

   ```
   grep -ri "HTTPRequest.line.limit" /opt/apigee/edge-message-processor/conf
   ```
2. The sample result from the above command is as follows:

   ```
   /opt/apigee/edge-message-processor/conf/http.properties:HTTPRequest.line.limit=7k
   ```
3. In the example output above, note that the property `HTTPRequest.line.limit`
   has been set with the value `7k` in `http.properties`.

   This indicates that the limit for the Request-Line size configured in Apigee for Private
   Cloud is **7 KB.**

If you still need any assistance from Apigee Support, go to
[Must gather diagnostic information](https://docs.apigee.com/api-platform/troubleshoot/runtime/414-toobigline.md.txt#must-gather).

## Must gather diagnostic information

Gather the following diagnostic information, and then contact [Apigee Edge Support](https://docs.apigee.com/api-platform/troubleshoot/support.md.txt):

If you are a **Public Cloud user**, provide the following information:

- Organization name
- Environment name
- API Proxy name
- Complete `curl` command used to reproduce the `414` error
- Trace file for the API requests

If you are a **Private Cloud user**, provide the following information:

- Complete error message observed for the failing requests
- Organization name
- Environment name
- API Proxy bundle
- Trace file for the failing API requests
- Complete `curl` command used to reproduce the `414` error
- NGINX access logs `/opt/apigee/var/log/edge-router/nginx/ORG~ENV.PORT#_access_log`

  **Where:** <var translate="no">ORG</var>, <var translate="no">ENV</var> and <var translate="no">PORT#</var> are replaced with
  actual values.
- Message Processor system logs `/opt/apigee/var/log/edge-message-processor/logs/system.log`