Broken Build Processor Inserts fail on SQL Server when no IDENTITY column defined
プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。
問題
When the Broken Build Processor is inserting responsible user information into the database, the inserts can fail because auto-increment ("IDENTITY") is not defined on certain columns in the related tables:
- AO_7A45FB_AOTRACKING_ENTRY
- AO_7A45FB_AOTRACKING_RESULT
- AO_7A45FB_AOTRACKING_USER
The following appears in the atlassian-bamboo
.log
2017-03-16 14:23:45,742 ERROR [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-16] [ChainPluginSupportImpl] file:<bamboo-install>/atlassian-bamboo/WEB-INF/atlassian-bundled-plugins/atlassian-bamboo-plugin-brokenbuildtracker-<version>.jar, BrokenBuildPostProcessor: com.atlassian.bamboo.brokenbuildtracker.BrokenBuildPostProcessor: There was a SQL exception thrown by the Active Objects library:
Database:
- name:Microsoft SQL Server
- version:12.00.4100
- minor version:0
- major version:12
Driver:
- name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase
- version:1.3.1
java.sql.SQLException: Cannot insert the value NULL into column 'TRACKING_ID', table '<bamboo-db>.dbo.AO_7A45FB_AOTRACKING_ENTRY'; column does not allow nulls. INSERT fails.
com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
Database:
- name:Microsoft SQL Server
- version:12.00.4100
- minor version:0
- major version:12
Driver:
- name:jTDS Type 4 JDBC Driver for MS SQL Server and Sybase
- version:1.3.1
java.sql.SQLException: Cannot insert the value NULL into column 'TRACKING_ID', table '<bamboo-db>.dbo.AO_7A45FB_AOTRACKING_ENTRY'; column does not allow nulls. INSERT fails.
...
Caused by: java.sql.SQLException: Cannot insert the value NULL into column 'TRACKING_ID', table '<bamboo-db>.dbo.AO_7A45FB_AOTRACKING_ENTRY'; column does not allow nulls. INSERT fails.
...
診断
環境
- MS SQL Server
診断ステップ
Please run the following commands on your database:
sp_help '[dbo].[AO_7A45FB_AOTRACKING_RESULT]'
sp_help '[dbo].[AO_7A45FB_AOTRACKING_USER]'
sp_help '[dbo].[AO_7A45FB_AOTRACKING_ENTRY]'
Please check the output for the phrase No identity column defined. If that phrase exists, please continue reading for cause and resolution.
原因
Root cause is currently undefined, but the tables were not created with IDENTITY columns. Bamboo relies on these columns when inserting, for the auto-increment functionality.
ソリューション
Since these tables are created on Bamboo startup, please:
- Stop Bamboo
- Drop the following tables:
AO_7A45FB_AOTRACKING_ENTRY
AO_7A45FB_AOTRACKING_RESULT
AO_7A45FB_AOTRACKING_USER
- Start Bamboo