Viewing full files in Merge requests results in "Error loading full diff. Please try again."
Description
- Users attempting to view some merge request diffs encounter the error message:
Error loading full diff. Please try again.
- Looking at the browser's developer tools console shows the error message:
net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
- The browser's developer tools Network tab shows an empty response for
/diff?full=true&from_merge_request=true
Environment
- Self-managed GitLab instances behind an Apache reverse proxy
Impacted offerings:
- GitLab Self-Managed
Solution
Ensure that the SubstituteMaxLineLength
setting for mod_substitute
in httpd.conf
is set to a high enough value. 5M
is a good place to start:
SubstituteMaxLineLength 5M
After raising the value, restart Apache.
Cause
This issue occurs when using Apache as a reverse proxy in front of GitLab with a too-low SubstituteMaxLineLength
value. This
causes mod_substitute to truncate reponses from GitLab, which breaks certain requests.
Additional Information
- Further details on this issue can be found in Apache bug 56176.
- According to the mod_substitute documentation, raising
SubstituteMaxLineLength
can slightly increase memory usage.