"Could not get unique fields for table" when creating a XML backup

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. Attempting to generate a backup fails with the below exception.
  2. Various other operations within JIRA may throw the below exception in the logs.

One or a combination the following three messages appear in the atlassian-jira.log:

Caused by: java.lang.RuntimeException: Could not get unique fields for table 'AO_563AEE_ACTIVITY_ENTITY'
	at net.java.ao.schema.helper.DatabaseMetaDataReaderImpl.getFields(DatabaseMetaDataReaderImpl.java:81)
	at net.java.ao.schema.ddl.SchemaReader.readFields(SchemaReader.java:125)
	at net.java.ao.schema.ddl.SchemaReader.readTable(SchemaReader.java:108)
	at net.java.ao.schema.ddl.SchemaReader.access$000(SchemaReader.java:46)
	at net.java.ao.schema.ddl.SchemaReader$1.apply(SchemaReader.java:96)
	at net.java.ao.schema.ddl.SchemaReader$1.apply(SchemaReader.java:93)
	at com.google.common.collect.Iterators$8.next(Iterators.java:782)
	at com.google.common.collect.Lists.newArrayList(Lists.java:139)
	at com.google.common.collect.Lists.newArrayList(Lists.java:119)
	at net.java.ao.schema.ddl.SchemaReader.readSchema(SchemaReader.java:92)
	at net.java.ao.schema.ddl.SchemaReader.readSchema(SchemaReader.java:80)
	at net.java.ao.schema.ddl.SchemaReader.readSchema(SchemaReader.java:71)
	at net.java.ao.schema.SchemaGenerator.generateImpl(SchemaGenerator.java:109)
	at net.java.ao.schema.SchemaGenerator.migrate(SchemaGenerator.java:83)
	at net.java.ao.EntityManager.migrate(EntityManager.java:147)
2013-03-26 16:58:47,907 main INFO [jira.config.database.DatabaseConfigurationManagerImpl] Now running Database Checklist Launcher
2013-03-26 16:58:55,460 main WARN [NoModule] Error getting index info for table: fieldscreenlayoutitem using lookupSchemaName JIRA2.2
java.sql.SQLException: Invalid argument(s) in call
2013-03-26 16:58:55,535 main WARN [NoModule] Error getting index info for table: issuetype using lookupSchemaName JIRA2.2
java.sql.SQLException: Invalid argument(s) in call
2013-03-26 16:58:55,545 main WARN [NoModule] Error getting index info for table: mailserver using lookupSchemaName JIRA2.2
java.sql.SQLException: Invalid argument(s) in call
2013-03-26 16:58:55,554 main WARN [NoModule] Error getting index info for table: OS_HISTORYSTEP using lookupSchemaName JIRA2.2
java.sql.SQLException: Invalid argument(s) in call
2016-04-28 19:30:46,888 Caesium-1-1 ERROR anonymous Backup Service [c.a.j.s.services.export.ExportService] An exception while running the export service "Backup Service": Could not read fields for table AO_044626_NOTIFICATION_CFG_AO
java.lang.RuntimeException: Could not read fields for table AO_044626_NOTIFICATION_CFG_AO
at net.java.ao.schema.helper.DatabaseMetaDataReaderImpl.getFields(DatabaseMetaDataReaderImpl.java:124)
at net.java.ao.schema.ddl.SchemaReader.readFields(SchemaReader.java:123)
at net.java.ao.schema.ddl.SchemaReader.readTable(SchemaReader.java:107)

Cause

There are three known causes for this problem:

  1. JIRA cannot read (and, subsequently, backup) an unknown ActiveObjects table data. For the above mentioned error, AO_563AEE_ACTIVITY_ENTITY table doesn't belong to Confluence, but JIRA. This normally happens when Confluence and JIRA were installed within the same database (which is not recommended).
  2. The schema name for the Oracle DB does not meet the required naming convention, for example: JIRA2.2 instead of JIRA2_2. This is described on Oracle documentation:

    Non-quoted identifiers can contain only alphanumeric characters from your database character set and the underscore (_), dollar sign ($), and pound sign (#).
    Database links can also contain periods (.) and "at" signs (@). Oracle strongly discourages you from using $ and # in non-quoted identifiers.

     

  3. A 3rd party add-on is still running on an incompatible version.

Resolution

Follow one of the below resolutions based on the cause detected in your environment.

  1. Separate JIRA and Confluence tables into separate database first before creating an XML backup.

    You can generate a database schema from your instance by following the steps described on this document

  2. Rename the schema in Oracle and in the JIRA configuration file and restart JIRA.

  3. Go to the Manage Add-ons from the Administration menu and ensure that all plugins are update to the latest version as per Updating add-ons.



 

Last modified on Nov 15, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.