Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9017

Set sun.jnu.encoding to UTF-8 by default in setenv.sh

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 5.0.0
    • None
    • None

    Description

      Summary

      sun.jnu.encoding is not explicitly defined in the startup of the Bitbucket JVM, and so it's possible for this to be set to an unexpected value in a customer's environment which causes issues with extended UTF-8 characters, e.g. working with branches containing accented characters

      Environment

      N/A

      Steps to Reproduce

      1. Have your environment set up with sun.jnu.encoding as ANSI_X3.4-1968 by default
      2. Create a branch with special characters, for example:

      Expected Results

      Even if your JVM is configured like that by default, Bitbucket server should force it to be UTF-8.

      Actual Results

      The below exception is thrown in the atlassian-bitbucket.log file:

      2016-07-22 09:22:12,054 ERROR [http-nio-7990-exec-8] picardh @9AGEXWx562x490792x1 1ilhyds 208.94.108.146,127.0.0.1 "POST /rest/pull-request-source-branch-deletion/1.0/projects/PRD/repos/groove/pull-requests/52 HTTP/1.1" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exception while processing REST request: "POST /rest/pull-request-source-branch-deletion/1.0/projects/PRD/repos/groove/pull-requests/52 HTTP/1.1" java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /var/atlassian/application-data/bitbucket/shared/data/repositories/9/refs/heads/feature/PR-725-RévisionDesJumeaux
      
      2016-07-22 11:05:28,559 ERROR [pull-request-rescoping:thread-1] c.a.s.i.c.HazelcastBucketedExecutor Attempt 1 of 1 at processing bucket 'pull-request-rescoping@9' for executor 'pull-request-rescoping' failed:
      java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /var/atlassian/application-data/bitbucket/shared/data/repositories/9/refs/heads/feature/PR-725-RévisionDesJumeaux
      
      
      
      

      Workaround

      Set sun.jnu.encoding explicitly to UTF-8 in <BITBUCKET_INSTALL>/bin/setenv.sh

      This can be manually set in $BITBUCKET_INSTALL/bin/setenv.sh under JVM_SUPPORT_RECOMMENDED_ARGS:

      $BITBUCKET_INSTALL/bin/setenv.sh
      JVM_SUPPORT_RECOMMENDED_ARGS="-Dsun.jnu.encoding=UTF-8"
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dchevell Dave Chevell
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: