Jira returns HTTP 500 for requests with more than 10 Accept-Language entries

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • 11.3.15, 10.3.29
    • Affects Version/s: 11.3.13, 10.3.27
    • Component/s: Data Center - Other
    • None
    • 10.03
    • 10
    • Severity 2 - Major
    • 79

      Issue Summary

      Jira 10.3.27 and 11.3.13 bundle Tomcat 9.0.123 and 10.1.61. These Tomcat releases added a Connector attribute, maxLocaleCount, with a default of 10. The bundled conf/server.xml does not set it. When a request carries more than 10 entries in the Accept-Language header, request.getLocale() throws IllegalArgumentException. Jira calls getLocale() at the start of every webwork request, so the request ends as an HTTP 500.

      Only the request that carries the long header fails.

      Steps to Reproduce

      1. Start the Jira 10.3.27 or 11.3.13.
      2. Send a request with 10 entries. It returns 200:
        curl -sL -o /dev/null -w '%{http_code}\n' -H 'Accept-Language: pl,en,de,fr,es,it,pt,nl,cs,sk' http://localhost:8080/
        
      1. Send the same request with 11 entries. It returns 500:
        curl -sL -o /dev/null -w '%{http_code}\n' -H 'Accept-Language: pl,en,de,fr,es,it,pt,nl,cs,sk,uk' http://localhost:8080/
        

         

      Expected Results

      The page renders for any Accept-Language value. Jira falls back to the user's or the default locale.

      Actual Results

      The second request returns HTTP 500. On a configured instance the same happened on the dashboard, issue navigator, project list, issue creation, filter management and admin pages, and URLs that would normally return 404 returned 500 as well. Logging in worked, but the first page after login was already a 500. 

      Duplicates and the wildcard * count toward the 10, and several Accept-Language header lines are added together. Empty elements and q values do not change the count.

      atlassian-jira.log contains the following.

      2026-01-01 00:00:00,000+0000 http-nio-8080-exec-1 url: /secure/Dashboard.jspa ERROR anonymous 1x1x1 abcdef 0.0.0.0 /secure/Dashboard.jspa [o.a.c.c.C.[Catalina].[localhost].[/jira]] Unhandled exception occurred whilst decorating page
      java.lang.IllegalArgumentException: More than the maximum allowed number of locales, [10], were detected. Use the maxLocaleCount attribute of the connector to resolve this if the application should accept more locales.
      	at org.apache.catalina.connector.Request.parseLocales(Request.java:3359)
      	at org.apache.catalina.connector.Request.getLocale(Request.java:1147)
      	at org.apache.catalina.connector.RequestFacade.getLocale(RequestFacade.java:428)
      	at com.atlassian.jira.web.debug.BreakpointReadyHttpServletRequest.getLocale(BreakpointReadyHttpServletRequest.java:299)
      	at webwork.action.ServletActionContext.setContext(ServletActionContext.java:99)
      	at com.atlassian.jira.action.ActionContextKit.setContext(ActionContextKit.java:53)
      

      Workaround

      • Add maxLocaleCount="-1" to the active <Connector> in conf/server.xml and restart. If you proxy through Apache or nginx, put the attribute on the Connector variant you use.
      • Or remove or shorten the Accept-Language header at the reverse proxy. Jira answers 200 without the header.
      • The server.xml change has to be re-applied after each upgrade, because the upgrade instructions tell you to copy your server.xml customizations over from a backup.

              Assignee:
              Natalia Wroblewska
              Reporter:
              Natalia Wroblewska
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated: