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
- Have your environment set up with sun.jnu.encoding as ANSI_X3.4-1968 by default
- 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"
Form Name |
---|
According to http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-December/037528.html,
Just saying