How to change the wrong encoding in Bamboo that is causing crashes or characters to display incorrectly

お困りですか?

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

コミュニティに質問

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

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約 

  1. You are trying to create a Jira issue from Bamboo and it crashed
  2. Code changes with special characters such as umlauts are replaced with different characters
  3. Angled brackets in the UI are replaced with different characters
  4. The build logs are getting cluttered with different characters
  5. Errors regarding Illegal characters. For example:
例外
error 19-Jul-2022 10:12:34 java.nio.file.InvalidPathException: Illegal char <?> at index 41: Sample ? filename.txt

原因

The system character encoding is wrong with the expected being UTF8

ソリューション

  1. Shutdown Bamboo

  2. Edit $BAMBOO_INSTALL/bin/setenv.sh (.bat for Windows or follow this article if you are starting as a service)

  3. Add this line in quotes under JVM_SUPPORT_RECOMMENDED_ARGS=

    -Dfile.encoding=utf-8 -Dsun.jnu.encoding=utf-8
  4. Restart Bamboo and check that your system encoding changes to UTF-8 from the System information page.

If the issue is manifesting on your remote agents, e.g. the the build logs are replacing UTF-8 characters with question marks or there are errors about illegal characters in your builds that occur on a remote agent: 

  1. Shutdown the remote agent
  2. Edit $BAMBOO_AGENT_HOME/conf/wrapper.conf
  3. Add the below lines:

    wrapper.java.additional.#=-Dfile.encoding=utf-8
    wrapper.java.additional.#=-Dsun.jnu.encoding=utf-8
    Please replace the # with the next available digit in the series of java additionals. The numbers must be sequential for the argument to apply.
  4. Restart the agent and check that your system encoding changes to utf-8 from the general configuration page.



Last modified on Mar 22, 2024

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

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