KB-1161 "HTTP/1.1 413 Request Entity Too Large"/"Email body failed to render" errors thrown in application server log

Symptoms

Users may experience one of the following symptoms:

Symptom 1

The HTTP File Upload Smart Service fails to upload files larger than 64KB (the threshold can be larger) with the following message in the application server log:

com.appian.integration.httpclient.smartnode.HttpFileUploadSmartNode - ConnectorRuntimeException [title=HTTP error connecting to ##URL##, com.appian.integration.core.exception.ConnectorRuntimeException: HTTP/1.1 413 Request Entity Too Large]

In the smart service’s output, an HTTP response code of 413 is returned.

Symptom 2

Appian auto-generated email alerts are not sent by the server with the following error in the application server log:

...
Caused by: java.io.IOException: Server returned HTTP response code: 414 for URL: XXXX
Caused by: com.appiancorp.process.engine.EmailBodyException: Email body failed to render: MailBody{filename=/ntf/emailHtml/XXXX_emailHtml.jsp}

Symptom 3

When a specific user performs an action that works for other users, like clicking on a form, task or report, they receive a pink box error:

An internal error has occurred. The page could not be loaded. [HTTP Code = 413] (APNX-1-4279-001)

If using Apache, you will see the following error in mod_jk.log:

[error] ajp_marshal_into_msgb::jk_ajp_common.c (469): failed appending the header value” in the mod_jk log.

Cause

This usually occurs because the web server has received a request that is larger than the configured limit. The web server is currently configured to limit the file size and will throw an error when it receives a request that is too large.

Depending on the exact action being performed by the user, and the subsequent request being made to the web server, the error could be due to the size of the request’s header, message body or the total size of the request as a whole.

Action

To prevent this error from reoccurring, and to allow the requests to be fulfilled by the web server, we need to raise the maximum allowed size for the area of the message (header, body, etc) that is causing the error.

For Symptoms 1 and 2

When the size of the request’s body is too large:

For IIS, the maxReceivedMessageSize parameter will have to be increased. By default, it is 64KB to prevent DOS attacks. For Apache, the parameter to be modified is LimitRequestBody.

For Symptom 3

When the size of the request’s header is too large:

JBoss

  1. Add the following properties to the JBoss standalone.xml file under the <system-properties> tag:
    <property name="org.apache.coyote.http11.Http11Protocol.MAX_HEADER_SIZE" value="65535"/>
    <property name="org.apache.coyote.ajp.MAX_PACKET_SIZE" value="65536"/> 
    
  2. Restart the application server.

Tomcat

  1. Find the <connector> tag in the Tomcat server.xml file (Located in the directory <APPIAN_HOME>\tomcat\apache-tomcat\conf) for the AJP protocol:
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
  2. Add the packetSize property to the tag, the default is set to 8192 and the max is 65536:
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" packetSize="24576"/>
  3. Restart the application server.

Additional Configurations if Using IIS as a Web Server

  1. Add the following property to your IIS workers.properties file (Located in the directory <ISAPI_HOME>\conf) matching value previously set to the server.xml file:
    worker.ajp13w1.max_packet_size=24576
    worker.ajp13w2.max_packet_size=24576
  2. Restart IIS.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: November 2018

Related
Recommended