Relation "trusted_apps" does not exist errors after performing Bamboo Cloud to Server migration

お困りですか?

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

コミュニティに質問

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

問題

After Migrating from Bamboo Cloud to Bamboo Server, both attempting to set up new application links and export functionality fail with relation "trusted_apps" does not exist errors. The same error may also present when attempting to perform the migration with Bamboo 6.0.x and halt start-up.

Selecting Administration > Application Links results in the following error on screen:

Stack Trace:
com.atlassian.templaterenderer.RenderingException: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getOrphanedTrustCertificates' in  class com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw exception org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet at com/atlassian/applinks/ui/admin/common_header.vm[line 10, column 20]
	...
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getOrphanedTrustCertificates' in  class com.atlassian.applinks.ui.velocity.ListApplicationLinksContext threw exception org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet at com/atlassian/applinks/ui/admin/common_header.vm[line 10, column 20]
	...
Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
	...
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
	...
Caused by: org.postgresql.util.PSQLException: ERROR: relation "trusted_apps" does not exist
  Position: 195
	...
Issue #2 - Export

The export fails with the following message logged in the application log:

016-10-20 09:05:39,385 INFO [http-nio-8085-exec-4] [XmlMigrator] Writing xml to file: /home/bamboo/exports/export_bamboo_51315_20161020.zip/db-export/trustedApps.xml
2016-10-20 09:05:39,386 INFO [http-nio-8085-exec-4] [XmlMigrator] Exporting with: com.atlassian.bamboo.migration.stream.TrustedApplicationsMapper
2016-10-20 09:05:39,400 WARN [http-nio-8085-exec-4] [SqlExceptionHelper] SQL Error: 0, SQLState: 42P01
2016-10-20 09:05:39,400 ERROR [http-nio-8085-exec-4] [SqlExceptionHelper] ERROR: relation "trusted_apps" does not exist
Issue #3 - Bamboo 6.0.x fails to start after Cloud Migration

The below message is logged in the <bamboo-install>/logs/catalina.out:

2017-06-14 07:07:39,411 FATAL [localhost-startStop-1] [DefaultBootstrapManager] Pre-bootstrap upgrade tasks failed
com.atlassian.upgrade.UpgradeException: Pre-bootstrap upgrade tasks failed: [Task for build 51604 failed with exception: ERROR: relation "trusted_apps" does not exist]
	at com.atlassian.bamboo.setup.DefaultBootstrapManager.performPersistenceUpgrade(DefaultBootstrapManager.java:287)
	at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.init(DefaultAtlassianBootstrapManager.java:77

診断

Issue #1 and #2:

The following tables are intentionally excluded from the Bamboo Cloud database export since they contain data that isn't relevant in the Server environment:

  • trusted_apps
  • trusted_apps_ips
  • trusted_apps_urls

The Hibernate code that Bamboo uses to persist application data is able to fix the database schema and recreate these tables (empty) but only when there is one schema present. The existence of multiple schemas prevents the corrective abilities of Hibernate.

Issue #3:

Bamboo 6.0+ is used for the migration.

原因

Issue #1 and #2:

Three tables are missing from the public schema which are required for application link configuration. 

Issue #3:

Bamboo 6.0+ does not work well with the migration.

回避策

Issue #1 and #2:

After importing the database per the instructions provided in Migrating from Bamboo Cloud to Bamboo Server, remove any schemas other than public. For example, you may have other schemas in the database sharing the prefix archive_:

    • archive_147123456
    • archive_179123456
Issue #3:

Migrate to Bamboo 5.15.x first before upgrading to Bamboo 6.0+

Or create the tables manually by running the below SQL on your Bamboo database:

create table TRUSTED_APPS (
        TRUSTED_APPS_ID int8 not null,
        APP_ID varchar(255) not null,
        PUBLIC_KEY_CLOB text,
        APP_NAME varchar(255),
        TIMEOUT int8 not null,
        primary key (TRUSTED_APPS_ID)
);

create table TRUSTED_APPS_IPS (
        IP_PATTERN_ID int8 not null,
        IP_PATTERN varchar(255)
);

create table TRUSTED_APPS_URLS (
        URL_PATTERN_ID int8 not null,
        URL_PATTERN varchar(255)
);

 

 

最終更新日 2017 年 7 月 7 日

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

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