This article explains how to resolve an HTTP 500 Internal Server Error that can occur in Manage when saving dashboard or user settings in an environment where mod_jk communicates with Tomcat using the AJP protocol.
Symptoms
The issue may occur when performing actions such as:
Setting a dashboard as the default dashboard.
Saving user settings.
Saving global settings.
Manage may return an HTTP 500 Internal Server Error. In some cases, Manage GUI icons may also stop responding after updating Global Settings.
Cause
The issue is caused by a mismatch between the AJP packet-size settings configured for mod_jk and Tomcat.
-
mod_jk:max_packet_sizeinworkers.properties -
Tomcat:
packetSizeon the AJP<Connector>inserver.xml
Tomcat uses a default AJP packet size of 8192 bytes. If mod_jk is configured with a larger value, such as 65536, while Tomcat is still using the default value, the AJP connection may fail when Manage sends a request that requires a larger packet.
This can cause Tomcat to close the connection or report communication errors, resulting in an HTTP 500 Internal Server Error.
Resolution
Perfect Match Required: According to the official Apache Tomcat AJP Connector Reference, the packetSize attribute must be the exact same value as the max_packet_size directive configured in mod_jk workers.properties file.
Ensure that the Tomcat AJP Connector packetSize value matches the max_packet_size value configured in mod_jk.
Check the mod_jk configuration
Open the workers.properties file and identify the configured max_packet_size value.
For example:
max_packet_size=65536
Configuring server.xml
-
Open
conf/server.xmland locate the<Connector>. Add or update thepacketSizeattribute to match themax_packet_sizevalue in themod_jksetting.<Connector protocol="AJP/1.3" port="8009" redirectPort="8443" packetSize="65536" secretRequired="true" secret="your_secure_secret_here" />Adjust
port,redirectPort,address, andsecretto match your existing environment only thepacketSizeattribute needs to be added/changed. - Restart the Tomcat service for the configuration change to take effect.
Verification
After restarting Tomcat, verify the following:
- Set a non-default dashboard as the default dashboard and confirm that it opens correctly after logging out and logging back in.
- Set Workspace back as the default dashboard and confirm that it opens correctly after logging in again.
- User and Global Settings can be updated and saved successfully.
- The updated settings persist after logging out and logging back in.