Error with Oracle Database - Tablespace does not exist

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

Problem

When starting or restarting Bitbucket Server a database error is thrown in the application log. The following appears in the atlassian-bitbucket.log:

1 2 2016-12-02 11:33:29,369 ERROR [active-objects-init-compatibility-tenant-0] net.java.ao.sql Exception executing SQL update <CREATE INDEX "index_ao_bd73c3_pro578890136" ON "AO_BD73C3_PROJECT_AUDIT"("PROJECT_ID")> java.sql.SQLSyntaxErrorException: ORA-00959: tablespace '<Tablespace_Name>' does not exist

Diagnosis

The Tablespace_Name referred to in the error message is the same as the user Bitbucket Server uses to connect to the database. When a default tablespace is not defined for a user, Oracle uses the connection username as the name of the default tablespace.

Cause

The default tablespace originally defined for the user used by Bitbucket Server to connect to the database was disassociated from the user.

Resolution

Determine which database object is associated with the Bitbucket Server database user:

1 select count(1) from all_objects where owner='<bitbucket_user>' and object_type='VIEW' and object_name='ALL_OBJECTS';

If the result set returns a value more than 1, redefine the default tablespace for the Bitbucket Server user used to connect to the database (as defined in BITBUCKET_HOME/bitbucket.properties):

1 ALTER USER <bitbucket_user> DEFAULT TABLESPACE <correct tablespace name here>;

If the result set is empty, the view needs to be created:

1 2 3 4 5 6 7 8 CREATE VIEW bitbucket.all_objects AS SELECT * FROM sys.all_objects WHERE owner = upper('<bitbucket_user>');

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

Updated on April 14, 2025

Still need help?

The Atlassian Community is here for you.