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

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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.

*Except Fisheye and Crucible

Summary

Problem

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.

Issue #1 - Application Links

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

1 2 3 4 5 6 7 8 9 10 11 12 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:

1 2 3 4 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:

1 2 3 4 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

Diagnosis

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.

Cause

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.

Solution

Workaround

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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 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) );

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.