Action in Jira server fails with Could not find column in previously parsed query error in log
Symptoms
There are some functions of JIRA requiring database operations which may fail and present the above message. Below you will find an example of the problem affecting the XML Backup/Restore process.
The following can be seen in the browser:
The issue can also manifest itself when setting up JIRA from scratch, it will basically fail to add an Administrator user to the database logging the same exceptions as quoted below.
The following appears in catalina.out
:
2012-12-17 12:37:46,145 http-bio-8081-exec-15 ERROR jira_admin 757x191x1 1jljotx 0:0:0:0:0:0:0:1%0 /secure/admin/XmlBackup.jspa [web.action.util.XmlBackup] Exception occurred backing up: java.lang.IllegalStateException: Could not find column 'EXCLUDE_ISSUE_DETAILS' in previously parsed query!
java.lang.IllegalStateException: Could not find column 'EXCLUDE_ISSUE_DETAILS' in previously parsed query!
at net.java.ao.schema.helper.DatabaseMetaDataReaderImpl.getFields(DatabaseMetaDataReaderImpl.java:122)
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 com.atlassian.activeobjects.backup.ActiveObjectsTableReader.read(ActiveObjectsTableReader.java:54)
at com.atlassian.dbexporter.exporter.TableDefinitionExporter.export(TableDefinitionExporter.java:32)
at com.atlassian.dbexporter.DbExporter.exportData(DbExporter.java:53)
at com.atlassian.activeobjects.backup.ActiveObjectsBackup.save(ActiveObjectsBackup.java:112)
at com.atlassian.jira.bc.dataimport.DefaultExportService.exportActiveObjects(DefaultExportService.java:199)
at com.atlassian.jira.bc.dataimport.DefaultExportService.export(DefaultExportService.java:80)
at com.atlassian.jira.bc.dataimport.DefaultExportService.export(DefaultExportService.java:59)
The following appears in atlassian-jira.log
:
012-12-17 12:37:18,668 http-bio-8080-exec-25 ERROR jira_admin 757x20x1 ipjazt 0:0:0:0:0:0:0:1%0 /secure/admin/XmlBackup.jspa [web.action.util.XmlBackup] Exception occurred backing up: java.lang.IllegalStateException: Could not find column 'JQL' in previously parsed query!
java.lang.IllegalStateException: Could not find column 'JQL' in previously parsed query!
at net.java.ao.schema.helper.DatabaseMetaDataReaderImpl.getFields(DatabaseMetaDataReaderImpl.java:122)
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)
Causes
- Two JIRA instances are connecting to the same database, but individual database schemas. Each individual JIRA instance requires its own database on the database server. See more on our documentation for steps on connecting JIRA to Microsoft SQL Server:
- If using Oracle database, granting additional permission (such as
dba, 'SELECT ANY TABLE' or 'EXP_FULL_DATABASE'
) to the user that JIRA uses to connect with the database could cause the same problem as well. - Also in Oracle, please check if the user JIRA is configured to connect the database has permissions as described here and also access permission to the tablespace.
- This could also be caused by two database schemas being referenced in the same database.
- If using MySQL with Connector/J version 8, this error can also occur if the
nullCatalogMeansCurrent=true
ornullDatabaseMeansCurrent=true
parameters were not added to the JDBC URL indbconfig.xml
as instructed in Connecting Jira applications to MySQL 8.0.
Resolution
Each JIRA instance must have its own database on the database server. Running multiple JIRA instances against the same database, although using individual schemas will not work.
Cause 1
Simply stopping one of the JIRA instances may not be enough to resolve the problem. If the second JIRA instance has created its own tables with a different schema, you should remove the tables created by the secondary instance. Before removing any tables, ensure you've got a full database backup.
Setup individual database and schema on the server for each JIRA instance as described in the documentation below:
- Connecting JIRA to SQL Server 2017
- Connecting JIRA to SQL Server 2016
- Connecting JIRA to SQL Server 2014
- Connecting JIRA to SQL Server 2012
- Connecting JIRA to SQL Server 2008
- Connecting JIRA to SQL Server 2005
- Connecting JIRA to Oracle
Causes 2-3
Ensure that the database user configured in Jira's dbconfig.xml
has the permissions described in Connecting Jira applications to Oracle, and only those permissions.
Cause 4
Follow the steps in Change the schema name for Jira database tables to alter the schema directly in the database, so that only one schema is referenced.
Cause 5
Add one of the following parameters to the JDBC URL in dbconfig.xml
, as described in Connecting Jira applications to MySQL 8.0:
nullCatalogMeansCurrent=true
(MySQL Connector/J versions 8.0 - 8.0.16)nullDatabaseMeansCurrent=true
(MySQL Connector/J version 8.0.17 and newer)