java.lang.IllegalStateException: Character set is not defined for uploadItem

お困りですか?

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

コミュニティに質問

プラットフォームについて: 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 は除く

Platform Notice: Server, Data Center, and Cloud By Request - This article was written for the Atlassian server and data center platforms but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.

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 は除く

問題

Whenever you try opening a review the following error can be found in the atlassian-fisheye.log:


2019-08-02 13:42:03,071 ERROR [qtp943573036-841 ] fisheye FRXDO-mapInlineComments - Error mapping comments. Cannot display comments on review CR-1. Error: Character set is not defined for uploadItem file.txt
java.lang.IllegalStateException: Character set is not defined for uploadItem file.txt
	at com.cenqua.crucible.revision.managers.DefaultEncodedContentProvider.getCharset(DefaultEncodedContentProvider.java:103) [fisheye.jar:?]
	at com.cenqua.crucible.revision.managers.DefaultEncodedContentProvider.getContent(DefaultEncodedContentProvider.java:86) [fisheye.jar:?]
	at com.cenqua.crucible.revision.managers.DefaultContentManager.getContents(DefaultContentManager.java:641) [fisheye.jar:?]
	at com.cenqua.fisheye.diff.DiffHelper.getHunkList(DiffHelper.java:135) [fisheye.jar:?]
	at com.cenqua.crucible.revision.source.Source.getHunkList(Source.java:224) [fisheye.jar:?]
	at com.cenqua.crucible.view.FRXDO.getHunkList(FRXDO.java:1298) [fisheye.jar:?]
	at com.cenqua.crucible.view.FRXDO.getTetrisGrid(FRXDO.java:811) [fisheye.jar:?]
	at com.cenqua.crucible.view.FRXDO.mapInlineComments(FRXDO.java:829) [fisheye.jar:?]
	at com.cenqua.crucible.view.FRXDO.<init>(FRXDO.java:213) [fisheye.jar:?]
	at com.cenqua.crucible.revision.managers.DefaultContentManager.makeFRXDO(DefaultContentManager.java:130) [fisheye.jar:?]
	at com.atlassian.crucible.actions.ReviewBaseAction.makeFRXDO(ReviewBaseAction.java:546) [fisheye.jar:?]
	at com.atlassian.crucible.actions.ViewFRXAction$1.doInTransaction(ViewFRXAction.java:193) [fisheye.jar:?]
	at com.atlassian.crucible.actions.ViewFRXAction$1.doInTransaction(ViewFRXAction.java:166) [fisheye.jar:?]
	at com.atlassian.fisheye.spi.impl.DefaultTxTemplate.execute(DefaultTxTemplate.java:78) [fisheye.jar:?]
	at com.atlassian.crucible.actions.ViewFRXAction.execute(ViewFRXAction.java:166) [fisheye.jar:?]
	...

原因

This problem may happen when the review has files uploaded as Attachments or as Pre-commit patches.

At the moment these files get uploaded they don't have a charset / encoding defined (or Crucible fails to detect it), and this information goes missing into the database.

The error happens when Crucible tries to retrieve the information from the database and the charset cannot be found.

ソリューション

  1. Shut down Crucible

  2. Backup the database using the database vendor software, just to be on the safe side.
  3. Query the database for the file mentioned in the stack trace (e.g., file.txt in the example above) by running this query:

    SELECT cru_charset, cru_upload_id, cru_original_name FROM cru_upload_item WHERE cru_original_name = 'file.txt';
  4. You may get a multiple rows in the query output, and among them you may see a few rows with cru_charset empty (or null):

     cru_charset | cru_upload_id | cru_original_name
    -------------+---------------+-------------------
     UTF-8       |         35205 | file.txt
     UTF-8       |         35206 | file.txt
     UTF-8       |         35264 | file.txt
     UTF-8       |         35265 | file.txt
                 |         35377 | file.txt
                 |         35376 | file.txt
  5. Fix the problem by adding 'UTF-8' to cru_charset where they're missing by running this query:

    UPDATE cru_upload_item SET cru_charset = 'UTF-8' WHERE cru_upload_id = 35376 AND cru_original_name = 'file.txt';
    UPDATE cru_upload_item SET cru_charset = 'UTF-8' WHERE cru_upload_id = 35377 AND cru_original_name = 'file.txt';
  6. Start Crucible


説明 An IllegalStateException error happens when opening a review that contains uploaded files because no charset is found at database level
製品Crucible
最終更新日 2019 年 8 月 6 日

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

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