Trying to import a trac project results in ERROR: relation "ticket" 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

Symptoms

The following appears in the atlassian-jira.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 2013-11-12 01:10:40,310 http-bio-8080-exec-20 ERROR xxxxx 70x665x1 xxxxx xxx.xx.x.xx,0:0:0:0:0:0:0:1 /secure/admin/ImporterFieldMappingsPage!default.jspa [plugins.importer.web.ImporterFieldMappingsPage] Unexpected exception com.atlassian.jira.plugins.importer.SQLRuntimeException: ERROR: relation "ticket" does not exist Position: 29 at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDb(JdbcConnection.java:177) at com.atlassian.jira.plugins.importer.web.JdbcConnection.queryDbAppendCollection(JdbcConnection.java:152) at com.atlassian.jira.plugins.importer.imports.AbstractStatusValueMapper.getDistinctValues(AbstractStatusValueMapper.java:61) .... Caused by: org.postgresql.util.PSQLException: ERROR: relation "ticket" does not exist Position: 29 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) ...

Cause

Tarc database doesn't see have table 'ticket' and it's required for trac to import in JIRA mechanism.

Resolution

First Assessment:

If the table 'ticket' doesn't exist in trac database, please create the table (it can be empty) such as :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 CREATE TABLE `ticket` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `type` text, `time` bigint(20) DEFAULT NULL, `changetime` bigint(20) DEFAULT NULL, `component` text, `severity` text, `priority` text, `owner` text, `reporter` text, `cc` text, `version` text, `milestone` text, `status` text, `resolution` text, `summary` text, `description` text, `keywords` text, PRIMARY KEY (`id`), KEY `ticket_time_idx` (`time`), KEY `ticket_status_idx` (`status`(255)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Second Assessment:

Make sure the trac table is point to the correct schema.

E.g:

1 jdbc:postgresql://localhost:5432/mydatabase?searchpath=myschema

Run the following SQL command to manually change your database schema

1 ALTER USER trac SET search_path to '<myschema>';

ℹ️resulted in the correct schema being used.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.