ORA-01400 cannot insert NULL into errors after restore using the Backup Client

お困りですか?

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

コミュニティに質問

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

問題

Restoring a backup with the Backup Client causes errors when using the following following functions:

  • SSH keys cannot be added
  • Build status is not updated
  • Branch permissions cannot be created
  • Audit logs are not updated

One or more of the following errors appears in the atlassian-bitbucket.log:

java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("BITBUCKET"."AO_CFE8FA_BUILD_STATUS"."ID")
 
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("BITBUCKET"."AO_BD73C3_PROJECT_AUDIT"."AUDIT_ITEM_ID")
 
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("BITBUCKET"."AO_616D7B_BRANCH_TYPE"."ID")
 
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("BITBUCKET"."AO_6978BB_RESTRICTED_REF"."REF_ID")
 
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("BITBUCKET"."AO_FB71B4_SSH_PUBLIC_KEY"."ENTITY_ID")

診断

Extracting the active-objects-data.xml file from the backup file reveals that the autoIncrement attribute has been set to false for the primary key on Active Object tables.

<table name="AO_FB71B4_SSH_PUBLIC_KEY">
    <column name="ENTITY_ID" primaryKey="true" autoIncrement="false" sqlType="2" precision="11"/>
    <column name="KEY_MD5" primaryKey="false" autoIncrement="false" sqlType="12" precision="32"/>
    <column name="KEY_TEXT" primaryKey="false" autoIncrement="false" sqlType="2005" precision="2147483647"/>
    <column name="LABEL" primaryKey="false" autoIncrement="false" sqlType="12" precision="255"/>
    <column name="USER_ID" primaryKey="false" autoIncrement="false" sqlType="2" precision="11"/>
</table>

In the above example, the ENTITY_ID column should have autoIncrement="true".

原因

The Oracle JDBC driver 12.1.0.2 was in use by Bitbucket Server when the backup was taken. There is a bug with this driver that causes the autoIncrement flag to be set incorrectly.

The latest Bitbucket Server is bundled with version 12.1.0.1 of the driver which is not affected by this issue. We do not recommend changing the JDBC driver that comes bundled with Bitbucket Server.

回避策

Use the DIY Backup to perform the backup which is not affected by this issue.

ソリューション

Downgrade the Oracle JDBC driver to 12.1.0.1 which was originally bundled with Bitbucket Server and run the Backup Client again.


説明Restoring a backup with the Backup Client causes error when using the following functions:

SSH keys cannot be added, build status is not updated, branch permissions cannot be created, audit logs are not updated.



最終更新日 2019 年 1 月 3 日

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

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