PostgreSQL cross-database references are not implemented

Trying to upgrade from JIRA 6.2 > JIRA 7.1.  Upgrade completes, when I attempt to access the url I see this, any help appreciated.

An error occurred performing JIRA upgrade

The data before the upgrade has been exported to /var/atlassian/application-data/jira/export/
2016-02-29 15:05:48error
Exception thrown during upgrade: ERROR: cross-database references are not implemented: "public.audit_item.idx_audit_item_log_id"
org.postgresql.util.PSQLException: ERROR: cross-database references are not implemented: "public.audit_item.idx_audit_item_log_id"
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(
	at org.postgresql.core.v3.QueryExecutorImpl.execute(
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(
	at org.apache.commons.dbcp2.DelegatingStatement.execute(
	at org.apache.commons.dbcp2.DelegatingStatement.execute(
	at com.atlassian.jira.upgrade.tasks.DropIndexTask.dropIndex(
	at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6256.doUpgrade(
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeTaskSuccess(
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.runUpgradeTasks(
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgrade(
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(
	at com.atlassian.jira.upgrade.UpgradeLauncher.checkIfUpgradeNeeded(
	at com.atlassian.jira.upgrade.UpgradeLauncher.start(
	at com.atlassian.jira.startup.ActiveServicesLauncher.start(
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postTenantArrived$807(
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$265/ Source)
	at com.atlassian.jira.startup.DefaultInstantUpgradeManager$
	at com.atlassian.jira.startup.DefaultInstantUpgradeManager.runTask(
	at com.atlassian.jira.startup.DefaultInstantUpgradeManager.doNowOrWhenInstanceBecomesActive(
	at com.atlassian.jira.startup.DefaultJiraLauncher.postTenantArrived(
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDBActivated$806(
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$264/ Source)
	at com.atlassian.jira.tenancy.DefaultTenantManager.doNowOrWhenTenantArrives(
	at com.atlassian.jira.startup.DefaultJiraLauncher.postDBActivated(
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$805(
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$34/ Source)
	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(
	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(
	at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$803(
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$5/ Source)
	at com.atlassian.jira.startup.DefaultJiraLauncher.start(
	at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(
	at com.atlassian.jira.startup.LauncherContextListener$$Lambda$3/ Source)

1 answer

0 votes
Chris Fuller Atlassian Team Feb 29, 2016

This sounds like a bug in entity-engine's syntax for dropping the index.  It is specifying the name in the format SCHEMA.TABLE.INDEX and postgres is interpreting it as DATABASE.SCHEMA.INDEX instead.  That is, it thinks the "public" is meant to be the name of a database when it is really a schema within the current database.

It isn't something that I've seen it do before, and postgres is the most heavily tested of the databases we support, so this really surprises me.  It may have something to do with exactly how your database is configured in dbconfig.xml.

You could work around it by dropping the index yourself, which means when the upgrade task runs again it will not find the old index that it is trying to drop.  I would, however, be a little bit worried that whatever is unusual about your database setup could cause other problems at some point.

Don't know what to think about the database, this server has been running JIRA for over 5 years and has gone through several upgrades without problem.  Currently running 6.2, I think I'll try to upgrade it to 6.4 and then try the 7 upgrade again and see what happens.  The PostgreSQL version is 8.4, don't know if upgrading that would be helpful.

Thanks for your response, I'll try the above and if that doesn't work we'll have to open a support ticket.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Statuspage

Introducing Statuspage Getting Started guides! First up: What is Statuspage?

Over the next several weeks we'll be sharing some of our Getting Started guides here in the community. Throughout this series of posts, we'd love to hear from customers and non-customers ab...

181 views 4 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you