maxLocaleCount needs to be configurable through Bitbucket Properties

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: High
    • None
    • Affects Version/s: 10.2.9
    • Component/s: Architecture
    • None
    • 1
    • Severity 2 - Major
    • 6
      • Jira has a fix for this that is waiting for release

      Issue Summary

      This is a similar issue to https://jira.atlassian.com/browse/JRASERVER-79586

      When more than the default number of Accept-Language entries are provided, a 500 response is returned.

      The solution in Jira is to modify maxLocaleCount in server.xml. Bitbucket doesn't use server.xml anymore, and research suggests that there isn't a way to set this value via bitbucket.properties

      Steps to Reproduce

      • Have more than 10 Accept-Language entries in the header

      Expected Results

      • Provide a setting that allows the number of Accept-Language entries to be configurable

      Actual Results

      • 500 Error

      Workaround

      • Remove or shorten the Accept-Language header in the reverse proxy/load balancer

      Requested Fix

      Expose Tomcat maxLocaleCount through bitbucket.properties by providing a supported connector property for configuring Tomcat’s maxLocaleCount.

      Bitbucket uses embedded Tomcat and configures connectors through bitbucket.properties, rather than an editable server.xml. Administrators therefore need an explicit property mapping to tune this setting.

      Problem and potential impact:

      Tomcat 10.1.61 introduced a default limit of 10 parsed locales from Accept-Language. Exceeding that limit causes getLocale() / getLocales() to throw an IllegalArgumentException, potentially resulting in HTTP 500 responses for browsers with many configured languages.

      Spring Boot 3.5 does not bind server.tomcat.max-locale-count; adding that property alone does not configure the connector. The setting must be applied directly to the Tomcat Connector.
      Undertow → Tomcat Migration — Technical Breakdown

      Requested implementation:

      Introduce supported properties along these lines:

      1. Proposed names only — not existing configuration instructions
      2. Primary connector: server.max-locale-count=25
      3. Optional per-additional-connector override: server.additional-connector.1.max-locale-count=25

      Requested semantics:

      • Positive integers configure a finite locale-count limit.
      • -1 disables the locale-count limit.
      • Additional connectors inherit the primary value unless explicitly overridden.
      • Document the default, valid values, inheritance, and restart requirement.

      Please confirm:

      • Whether an undocumented existing mechanism is available in 10.2.9.
      • Whether this can be addressed in a maintenance release and backported to 10.2.x.
      • Any interim mitigation that can be suggested

              Assignee:
              Unassigned
              Reporter:
              Craig Drummond
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: