Accented or extended UTF-8 characters cause "Malformed input or input contains unmappable characters" error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

問題

Extended UTF-8 or accented characters could cause unexpected behavior in Bitbucket server. For example a branch with these characters can cause unexpected behavior and error similar to following one in the atlassian.bitbucket.log

java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: <repo path>/1052/refs/heads/大家好
        at java.base/sun.nio.fs.UnixPath.encode(UnixPath.java:145)
        at java.base/sun.nio.fs.UnixPath.<init>(UnixPath.java:69)
        at java.base/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:280)
        at java.base/java.io.File.toPath(File.java:2290)
        at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:437)
        at com.atlassian.stash.internal.scm.git.RawGitAgent.execute(RawGitAgent.java:433)
        at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveBranch(RawGitAgent.java:585)
        at com.atlassian.stash.internal.scm.git.RawGitAgent.resolveHead(RawGitAgent.java:222)
        at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$2.call(DefaultGitCommandFactory.java:297)
        at com.atlassian.stash.internal.scm.git.DefaultGitCommandFactory$2.call(DefaultGitCommandFactory.java:293)
        at com.atlassian.stash.internal.repository.DefaultRefService.getDefaultBranch(DefaultRefService.java:191)
..

診断

環境

  • Bitbucket is hosted on Windows and MacOS is unaffected.

  • Impacts Bitbucket server 6.0+ installed on Linux servers, running Java 11 and LANG environment variable set to non-utf8 locale

原因

Java 11 won't support setting sun.jnu.encoding to UTF-8 via the command line to use UTF-8 for encoding file paths. It will silently ignore it and will not have any effect.

回避策

  • If Bitbucket is running as service set LANG="en_US.UTF-8" in /etc/init.d/atlbitbucket and will be honoured.
  • Set LANG="en_US.UTF-8" in the environment of the user with which Bitbucket is started


説明extended UTF-8 characters cause "Malformed input or input contains unmappable characters"
製品Bitbucket Server
最終更新日: 2019 年 2 月 11 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.