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/jira_autoexport_20160229_150535.zip
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(QueryExecutorImpl.java:2101)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1834)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:510)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:372)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:364)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
	at com.atlassian.jira.upgrade.tasks.DropIndexTask.dropIndex(DropIndexTask.java:24)
	at com.atlassian.jira.upgrade.tasks.UpgradeTask_Build6256.doUpgrade(UpgradeTask_Build6256.java:56)
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeTaskSuccess(UpgradeManagerImpl.java:718)
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.runUpgradeTasks(UpgradeManagerImpl.java:609)
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgrade(UpgradeManagerImpl.java:493)
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeeded(UpgradeManagerImpl.java:435)
	at com.atlassian.jira.upgrade.UpgradeManagerImpl.doUpgradeIfNeededAndAllowed(UpgradeManagerImpl.java:379)
	at com.atlassian.jira.upgrade.UpgradeLauncher.checkIfUpgradeNeeded(UpgradeLauncher.java:90)
	at com.atlassian.jira.upgrade.UpgradeLauncher.start(UpgradeLauncher.java:47)
	at com.atlassian.jira.startup.ActiveServicesLauncher.start(ActiveServicesLauncher.java:49)
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postTenantArrived$807(DefaultJiraLauncher.java:180)
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$265/1202200478.run(Unknown Source)
	at com.atlassian.jira.startup.DefaultInstantUpgradeManager$StatupTask.run(DefaultInstantUpgradeManager.java:113)
	at com.atlassian.jira.startup.DefaultInstantUpgradeManager.runTask(DefaultInstantUpgradeManager.java:46)
	at com.atlassian.jira.startup.DefaultInstantUpgradeManager.doNowOrWhenInstanceBecomesActive(DefaultInstantUpgradeManager.java:35)
	at com.atlassian.jira.startup.DefaultJiraLauncher.postTenantArrived(DefaultJiraLauncher.java:173)
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDBActivated$806(DefaultJiraLauncher.java:161)
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$264/367669836.run(Unknown Source)
	at com.atlassian.jira.tenancy.DefaultTenantManager.doNowOrWhenTenantArrives(DefaultTenantManager.java:55)
	at com.atlassian.jira.startup.DefaultJiraLauncher.postDBActivated(DefaultJiraLauncher.java:158)
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$805(DefaultJiraLauncher.java:147)
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$34/1497456543.run(Unknown Source)
	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:298)
	at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:194)
	at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:137)
	at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$803(DefaultJiraLauncher.java:103)
	at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$5/1376125129.run(Unknown Source)
	at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
	at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:101)
	at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:115)
	at com.atlassian.jira.startup.LauncherContextListener$$Lambda$3/1748884284.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:745)

1 answer

This widget could not be displayed.
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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

69 views 2 3
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