Data truncation due to data too long for column

お困りですか?

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

コミュニティに質問

症状

  1. When you're upgrading a JIRA application, a data truncation error may be encountered.
  2. After configuring a User Directory, synchronization fails with truncation errors.
  3. When adding a group to a Notification, this error will occur.

atlassian-jira.log に次のメッセージが表示される。

...
Caused by: com.atlassian.crowd.embedded.ofbiz.db.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:DirectoryAttribute][directoryId,10100][name,ldap.user.filter][value,(&(objectclass=unicornRider)(!(ou:dn:=Guardians of The Globe))(|(memberof=cn=Lightning Strike Thunderdome,ou=Groups,ou=The Avengers)(memberof=cn=jiradmins,ou=Groups,ou=The Avengers)(memberof=cn=strikeforceone,ou=Groups,ou=The Avengers)(memberof=cn=UAT,ou=Groups,ou=The Avengers)(memberof=cn=myspace,ou=Groups,ou=The Avengers))] (SQL Exception while executing the following:INSERT INTO cwd_directory_attribute (directory_id, attribute_name, attribute_value) VALUES (?, ?, ?) (Data truncation: Data too long for column 'attribute_value' at row 1))
...

原因

Most description columns in JIRA applications database have a maximum column width of 255 characters. For example, cwd_group.description or cwd_directory_attribute.attribute_value. Attempting to add a value greater than that column width will result in truncation errors. There are several bugs that have been raised for this behaviour within JIRA applications:

  • JRA-13329 - 課題詳細を取得中... ステータス
  • JRA-19990 - 課題詳細を取得中... ステータス
  • JRA-24526 - 課題詳細を取得中... ステータス
  • JRASERVER-36979 - 課題詳細を取得中... ステータス

And an Improvement request has been raised to add this restriction to the GUI:  JRA-28805 - Getting issue details... STATUS

回避策

データベースの変更を行う場合は 必ず事前にバックアップを取得してください。可能な場合はテスト サーバーで変更を試すことをおすすめします。

The columns within the database could be altered with the following SQL. This may require changes depending on your DBMS.

alter table cwd_group modify description varchar (400);
alter table cwd_group modify lower_description varchar (400);
alter table cwd_directory_attribute modify attribute_value varchar (400);

If you're using PostgreSQL, it will be:

alter table cwd_group alter column description type varchar (400);
alter table cwd_group alter column lower_description type varchar (400);
alter table cwd_directory_attribute alter column attribute_value type varchar (400);

If you're using MS SQL, it will be:

alter table cwd_group alter column description type varchar (400);
alter table cwd_group alter column lower_description type varchar (400);
alter table cwd_directory_attribute alter column attribute_value type varchar (400);


It is indeed possible that the number "(400)" may not be large enough for some instances. Adjust the number as necessary if the error occurs again even with the initial increase.

You can quickly check the changes by running the following SQL:

select column_name, data_type, character_maximum_length from information_schema.columns where table_name = 'myTable'

Making changes to the database is not something we recommend and can potentially lead to additional problems. If you ever migrate to another database the data truncation problems will occur again unless addressed in the new database.

ソリューション

Use shorter LDAP filters or group names.

(info) Please see our Troubleshooting LDAP User Management documentation for further assistance with diagnosing LDAP problems.




alter table cwd_group alter column lower_description nvarchar (400);

alter table cwd_group alter column description nvarchar (400);

alter table cwd_directory_attribute alter column attribute_value nvarchar (400);

最終更新日 2018 年 11 月 2 日

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

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